make a jenkinsfile

This commit is contained in:
Kameron Kenny - pi501 2024-04-22 21:35:26 -04:00
parent 0a2d7314b6
commit e79ea8040e
1 changed files with 38 additions and 31 deletions

69
Jenkinsfile vendored
View File

@ -1,34 +1,41 @@
pipeline { pipeline {
agent any agent {
label 'agent1-pi501'
}
stages { stages {
stage('Build') { stage("verify tooling") {
steps { steps {
echo 'Building from Docker Compose...' sh '''
step( docker version
[ docker info
$class: 'DockerBuilderPublisher', docker compose version
cleanImages: false, '''
cleanupWithJenkinsJobDelete: false, }
cloud: '', }
dockerFileDirectory: '',
fromRegistry: [url: 'docker-registry1.in.thelinuxpro.net:5000'], stage("Build Containers and push to registry") {
pushCredentialsId: '', sh 'docker compose build --push'
pushOnSuccess: false, }
tagsString: ''
] stage('Start primary container') {
) steps {
} sh '''
} if [[ $(docker compose ps | wc -l) -eq 1 ]]; then
stage('Push to Registry') { docker compose up -d --no-color primary
steps { else
echo('docker push [disabled]') docker compose down primary
} docker compose up -d --no-color primary
} fi
stage('Deploy') { '''
steps { sh 'docker compose ps'
echo 'Deploying....' }
} }
}
} stage('Run tests against the container') {
steps {
}
}
}
} }