This repository has been archived on 2024-07-12. You can view files and clone it, but cannot push or open issues or pull requests.
docker-discover/Jenkinsfile

45 lines
1.0 KiB
Plaintext
Raw Normal View History

#!/usr/bin/env groovy
pipeline {
agent any
environment {
2020-01-29 12:12:22 +00:00
PROJECT_NAME = 'discover'
}
stages {
stage('Checkout') {
steps {
script {
2020-01-30 15:37:57 +00:00
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'
}
}
stage('Deploy') {
when {
branch 'master'
}
steps {
sh "docker stack deploy --with-registry-auth --prune --compose-file docker-compose.yml ${env.PROJECT_NAME}"
}
}
}
post {
always {
script {
2020-01-30 15:37:57 +00:00
util.sendEmail()
}
}
}
}