-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
32 lines (27 loc) · 964 Bytes
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!groovy
node {
env.DOCKER_USE_HUB = 1
def deployable_branches = ["master"]
stage('Checkout') {
checkout scm
}
stage('Docker build') {
echo "Branch is: ${env.BRANCH_NAME}"
echo "Build is: ${env.BUILD_NUMBER}"
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
sh './develop.sh build'
}
}
if (deployable_branches.contains(env.BRANCH_NAME)) {
stage('Publish docker image') {
withCredentials([[$class: 'UsernamePasswordMultiBinding', credentialsId: 'dockerbot',
usernameVariable: 'DOCKER_USERNAME',
passwordVariable: 'DOCKER_PASSWORD']]) {
wrap([$class: 'AnsiColorBuildWrapper', 'colorMapName': 'XTerm']) {
sh './develop.sh ci_docker_login'
sh './develop.sh publish_docker_image'
}
}
}
}
}