Jenkinsfile refactor
gitea/vn-support/master This commit looks good
Details
gitea/vn-support/master This commit looks good
Details
This commit is contained in:
parent
5845ed0bf9
commit
9d0d7a4c70
|
@ -8,38 +8,24 @@ pipeline {
|
|||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
script {
|
||||
util.setEnv()
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
environment {
|
||||
CREDS = credentials('docker-registry')
|
||||
}
|
||||
steps {
|
||||
sh 'docker login --username $CREDS_USR --password $CREDS_PSW $REGISTRY'
|
||||
sh 'docker-compose build --parallel'
|
||||
sh 'docker-compose push'
|
||||
setEnv()
|
||||
}
|
||||
}
|
||||
stage('Deploy') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
environment {
|
||||
CREDENTIALS = credentials('docker-registry')
|
||||
}
|
||||
steps {
|
||||
sh "docker stack deploy --with-registry-auth --prune --compose-file docker-compose.yml ${env.PROJECT_NAME}"
|
||||
dockerDeploy()
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
util.sendEmail()
|
||||
}
|
||||
sendEmail()
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue