-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
93 lines (88 loc) · 1.96 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
pipeline {
agent {
kubernetes {
label 'sc-live-topic-child-table-cleanup-consumer'
yaml """
apiVersion: v1
kind: Pod
spec:
containers:
- name: dind
image: sc-mum-armory.platform.internal/devops/dind:v2
securityContext:
privileged: true
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: DOCKER_TLS_CERTDIR
value: ""
volumeMounts:
- name: dind-storage
mountPath: /var/lib/docker
readinessProbe:
tcpSocket:
port: 2375
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 2375
initialDelaySeconds: 30
periodSeconds: 20
- name: builder
image: sc-mum-armory.platform.internal/devops/builder-image-armory
command:
- sleep
- infinity
env:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: DOCKER_BUILDKIT
value: "0"
volumeMounts:
- name: jenkins-sa
mountPath: /root/.gcp/
volumes:
- name: dind-storage
emptyDir: {}
- name: jenkins-sa
secret:
secretName: jenkins-sa
"""
}
}
options {
timeout(time: 10, unit: 'MINUTES')
copyArtifactPermission('*')
}
environment {
GITHUB_TOKEN = credentials('github-access')
sc_regions="mumbai"
app="sc-live-topic-table-database-cleanup-consumer"
buildarg_DEPLOYMENT_ID="sc-live-topic-table-database-cleanup-consumer-$GIT_COMMIT"
buildarg_GITHUB_TOKEN=credentials('github-access')
JS_REGISTRY_TOKEN = credentials('JS_REGISTRY_TOKEN')
buildarg_JS_REGISTRY_TOKEN = credentials('JS_REGISTRY_TOKEN')
}
stages {
stage('build') {
steps {
container('builder') {
sh 'armory build'
}
}
}
stage('push') {
when {
anyOf {
branch 'main'
}
}
steps {
container('builder') {
sh 'armory push'
}
}
}
}
}