forked from apache/superset
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
45 lines (45 loc) · 1.6 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
import org.jenkinsci.plugins.pipeline.modeldefinition.Utils
pipeline {
agent none
environment {
CLUSTER_PROD = 'kubernetes-sirclo-prod'
ENTRYPOINT = '/home/jenkins/entrypoint/entrypoint.sh'
}
stages {
stage("are you sure to release to a production?") {
steps {
script {
try {
timeout(time: 1, unit: "HOURS") {
input( message: 'release to production', ok: 'deploy')
}
} catch (Throwable e) {
env.SKIP_DEPLOY_PROD = "true"
echo "Caught ${e.toString()}"
Utils.markStageSkippedForConditional('are you sure to release to a production?')
}
}
}
}
stage("release to production") {
agent {
kubernetes {
cloud "${CLUSTER_PROD}"
inheritFrom 'jenkins-agent'
}
}
steps {
script {
if (env.SKIP_DEPLOY_PROD == 'true') {
Utils.markStageSkippedForConditional('release to production')
} else {
container('deployer') {
sh "${ENTRYPOINT}"
sh 'deployer --build-from-pod --use-helmfile --use-jenkins-agent --project=sirclo-prod --docker-tag=${GIT_COMMIT}-${BUILD_NUMBER}'
}
}
}
}
}
}
}