-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
46 lines (46 loc) · 1.71 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
46
def label = "airflow-datapipeline-${UUID.randomUUID().toString()}"
podTemplate(label: label, yaml: """
apiVersion: v1
kind: Pod
metadata:
name: ${label}
annotations:
container.apparmor.security.beta.kubernetes.io/${label}: unconfined
labels:
app: ${label}
spec:
containers:
- name: ${label}
image: moby/buildkit:v0.9.2-rootless
imagePullPolicy: IfNotPresent
command:
- cat
tty: true
nodeSelector:
workload: batch
""",
slaveConnectTimeout: 3600
) {
node(label) {
stage('setup') {
git credentialsId: 'jenkins-user', url: 'https://ds1.capetown.gov.za/ds_gitlab/OPM/airflow-datapipeline.git'
}
stage('kubernetes-v2') {
retry(100) {
container(label) {
withCredentials([usernamePassword(credentialsId: 'opm-data-proxy-user', passwordVariable: 'OPM_DATA_PASSWORD', usernameVariable: 'OPM_DATA_USER'),
usernamePassword(credentialsId: 'docker-user', passwordVariable: 'DOCKER_PASS', usernameVariable: 'DOCKER_USER')]) {
sh '''
./bin/buildkit-docker.sh ${OPM_DATA_USER} ${OPM_DATA_PASSWORD} \\
${DOCKER_USER} ${DOCKER_PASS} \\
"${PWD}" \\
"docker.io/cityofcapetown/airflow:kubernetes-v2"
sleep 60
'''
}
updateGitlabCommitStatus name: 'kubernetes-v2', state: 'success'
}
}
}
}
}