-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathJenkinsfile
134 lines (133 loc) · 3.41 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
pipeline {
parameters {
string(
name: 'TAG_NAME',
trim: true
)
}
agent {
kubernetes {
yaml """\
apiVersion: v1
kind: Pod
metadata:
annotations:
cluster-autoscaler.kubernetes.io/safe-to-evict: false
spec:
imagePullSecrets:
- name: regcred-registry-mirantis-com
containers:
- name: jnlp
image: registry.mirantis.com/prodeng/ci-workspace:1.0.6
volumeMounts:
- name: docker-socket
mountPath: /var/run
resources:
limits:
cpu: 1
requests:
cpu: 0.5
- name: docker-daemon
image: docker:24.0.9-dind
securityContext:
privileged: true
volumeMounts:
- name: docker-socket
mountPath: /var/run
- name: tmp-dir
mountPath: /tmp
resources:
limits:
cpu: 1
requests:
cpu: 0.5
- name: goreleaser
image: goreleaser/goreleaser:latest
imagePullPolicy: Always
resources:
limits:
cpu: 4
requests:
cpu: 4
command:
- sleep
args:
- 99d
- name: digicert
image: registry.mirantis.com/prodeng/digicert-keytools-jsign:latest
imagePullPolicy: Always
resources:
requests:
cpu: "1"
memory: 4Gi
command:
- sleep
args:
- 99d
volumes:
- name: docker-socket
emptyDir: {}
- name: tmp-dir # This volume mount is required since SSH_AUTH_SOCK is created in /tmp
emptyDir: {}
""".stripIndent()
}
}
stages {
stage('Release') {
steps {
container("goreleaser") {
withCredentials([
string(credentialsId: 'tools-segment--launchpad-production-token--secret-text', variable: 'SEGMENT_TOKEN'),
]) {
sh (
label: "build clean release",
script: """
git checkout \$(git rev-parse --verify ${params.TAG_NAME})
GORELEASER_CURRENT_TAG=${params.TAG_NAME} SEGMENT_TOKEN=${env.SEGMENT_TOKEN} make build-release
"""
)
}
}
container("digicert") {
withCredentials([
string(credentialsId: 'common-digicert--api-key--secret-text', variable: 'SM_API_KEY'),
file(credentialsId: 'common-digicert--auth-pkcs12--file', variable: 'SM_CLIENT_CERT_FILE'),
string(credentialsId: 'common-digicert--auth-pkcs12-passphrase--secret-text', variable: 'SM_CLIENT_CERT_PASSWORD'),
]) {
sh (
label: "signing release binaries (in digicert container)",
script: """
make SIGN=./sign sign-release
"""
)
}
}
container("jnlp") {
withCredentials([
[
$class: 'AmazonWebServicesCredentialsBinding',
accessKeyVariable: 'AWS_ACCESS_KEY_ID',
secretKeyVariable: 'AWS_SECRET_ACCESS_KEY',
credentialsId: 'tools-aws-de-production-access-keys',
],
usernamePassword(
usernameVariable: 'GITHUB_USERNAME',
passwordVariable: 'GITHUB_TOKEN',
credentialsId : 'tools-github-up',
),
]) {
sh (
label: "creating release",
script: """
make create-checksum
make verify-checksum
./release.sh
./upload_s3.sh
"""
)
}
}
}
}
}
}