-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
45 lines (45 loc) · 1.37 KB
/
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
33
34
35
36
37
38
39
40
41
42
43
44
45
pipeline {
agent any
options {
disableConcurrentBuilds()
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
stages {
stage('Create New PROD Docker Image'){
when {
branch 'master'
}
steps {
withCredentials(
[
usernamePassword(
credentialsId: 'docker-hub-perms',
passwordVariable: 'DOCKER_HUB_PASSWORD',
usernameVariable: 'DOCKER_HUB_USER_NAME'
)
]
) {
sh label: '', script : """bash -c \'
export DOCKER_HUB_PASSWORD="'"${DOCKER_HUB_PASSWORD}"'";
export DOCKER_HUB_USER_NAME=${DOCKER_HUB_USER_NAME};
export WALL_E_PYTHON_BASE_IMAGE=wall_e_python;
./build.sh;
\'"""
}
}
}
}
post {
always {
cleanWs(
cleanWhenAborted: true,
cleanWhenFailure: true,
cleanWhenNotBuilt: false,
cleanWhenSuccess: true,
cleanWhenUnstable: true,
deleteDirs: true,
disableDeferredWipeout: true
)
}
}
}