switch jenkins to BlueOcean builds and add healthcheck and Jenkinsfile.
not sure we can actually complete a pipeline deployment successfully, because of restart
This commit is contained in:
32
dockerfiles/services/jenkins/Jenkinsfile
vendored
Normal file
32
dockerfiles/services/jenkins/Jenkinsfile
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
node('docker') {
|
||||
def app_name = 'jenkins'
|
||||
def app_port = '8080'
|
||||
def workdir = 'dockerfiles/services/jenkins'
|
||||
|
||||
stage('prepare') {
|
||||
git credentialsId: 'f1f58215-c789-44a2-9b72-50e4425cb061', url: 'ssh://git@git.xai-corp.net:10022/xai-corp.net/provisioning.git'
|
||||
sh 'ls'
|
||||
}
|
||||
|
||||
stage('build') {
|
||||
dir(workdir) {
|
||||
sh "DOCKER_HOST=dkhost:2376 docker-compose -f docker-compose.yml pull"
|
||||
}
|
||||
}
|
||||
|
||||
stage('deploy') {
|
||||
dir(workdir) {
|
||||
sh """
|
||||
docker stack deploy -c docker-compose.yml jenkins
|
||||
docker service update jenkins_app
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
stage('smoke tests') {
|
||||
dir(workdir) {
|
||||
sleep 60
|
||||
sh "curl -If http://dkhost:8080/metrics/ejkxeVI-iKLy968ji9AnfYmOHGIh1kYd3gA500JqrRxzTeenT06ynR5Dqo0CQplO/healthcheck"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user