blob: 9e182d01b94e5f0f550991787ab2f5456a47c910 [file] [log] [blame]
Jonatan Antoni107fde42021-04-29 15:18:15 +02001@Library("cmsis")
Jonatan Antoni6485da42021-06-17 15:23:34 +02002import com.arm.dsg.cmsis.jenkins.ArtifactoryHelper
Jonatan Antoni107fde42021-04-29 15:18:15 +02003
4DOCKERINFO = [
Jonatan Antoni4b0ede32021-04-29 18:26:29 +02005 'staging': [
Jonatan Antoni107fde42021-04-29 15:18:15 +02006 'registryUrl': 'mcu--docker-staging.eu-west-1.artifactory.aws.arm.com',
7 'registryCredentialsId': 'artifactory',
8 'k8sPullSecret': 'artifactory-mcu-docker-staging',
9 'namespace': 'mcu--docker-staging',
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020010 'image': 'cmsis/linux',
Jonatan Antoni107fde42021-04-29 15:18:15 +020011 'label': "${JENKINS_ENV}-${JOB_BASE_NAME}-${BUILD_NUMBER}"
12 ],
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020013 'production': [
Jonatan Antoni107fde42021-04-29 15:18:15 +020014 'registryUrl': 'mcu--docker.eu-west-1.artifactory.aws.arm.com',
15 'registryCredentialsId': 'artifactory',
16 'namespace': 'mcu--docker',
17 'k8sPullSecret': 'artifactory-mcu-docker',
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020018 'image': 'cmsis/linux',
19 'label': 'latest'
Jonatan Antoni107fde42021-04-29 15:18:15 +020020 ]
21]
Jonatan Antonib5d07f02021-07-14 12:50:57 +020022HADOLINT_VERSION = '2.6.0-alpine'
Jonatan Antoni107fde42021-04-29 15:18:15 +020023
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020024dockerinfo = DOCKERINFO['production']
Jonatan Antoni107fde42021-04-29 15:18:15 +020025
26isPrecommit = (JOB_BASE_NAME == 'pre_commit')
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020027isPostcommit = (JOB_BASE_NAME == 'post_commit')
Jonatan Antoni107fde42021-04-29 15:18:15 +020028isNightly = (JOB_BASE_NAME == 'nightly')
Jonatan Antoni6485da42021-06-17 15:23:34 +020029isRelease = (JOB_BASE_NAME == 'release')
Jonatan Antoni107fde42021-04-29 15:18:15 +020030
Jonatan Antoni5f8564b2021-04-29 16:59:54 +020031patternGlobal = [
32 '^Jenkinsfile'
33]
34
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020035patternDocker = [
36 '^docker/.*'
37]
38
Jonatan Antoni107fde42021-04-29 15:18:15 +020039patternCoreM = [
40 '^CMSIS/Core/Include/.*',
41 '^Device/ARM/ARMCM.*'
42]
43
44patternCoreA = [
45 '^CMSIS/Core_A/Include/.*',
46 '^Device/ARM/ARMCA.*'
47]
48
49patternCoreValidation = [
50 '^CMSIS/CoreValidation/.*'
51]
52
53CONFIGURATIONS = [
54 'pre_commit': [
Jonatan Antoni027e8692022-10-31 13:37:25 +010055 'mdevices': ['CM0', 'CM3', 'CM4FP', 'CM7DP', 'CM23', 'CM33NS', 'CM35PS',
56 'CM55NS', 'CM85S'],
57 'adevices': ['CA7', 'CA9'],
Jonatan Antoni107fde42021-04-29 15:18:15 +020058 'devices' : [],
59 'configs' : [
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020060 'AC5': ['low', 'tiny'],
Jonatan Antoni107fde42021-04-29 15:18:15 +020061 'AC6': ['low', 'tiny'],
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020062 'AC6LTM': ['low', 'tiny'],
63 'GCC': ['low', 'tiny']
64 ]
65 ],
66 'post_commit': [
67 'devices' : ['CM0', 'CM0plus', 'CM3', 'CM4', 'CM4FP', 'CM7', 'CM7SP', 'CM7DP',
Jonatan Antoni027e8692022-10-31 13:37:25 +010068 'CM23', 'CM23S', 'CM23NS', 'CM33', 'CM33S', 'CM33NS',
69 'CM35P', 'CM35PS', 'CM35PNS', 'CM55', 'CM55S', 'CM55NS',
70 'CM85S', 'CM85NS',
71 'CA5', 'CA7', 'CA9'],
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020072 'configs' : [
73 'AC5': ['low', 'tiny'],
74 'AC6': ['low', 'tiny'],
75 'AC6LTM': ['low', 'tiny'],
76 'GCC': ['low', 'tiny']
Jonatan Antoni107fde42021-04-29 15:18:15 +020077 ]
78 ],
Jonatan Antoni6485da42021-06-17 15:23:34 +020079 'nightly': [
Jonatan Antoni107fde42021-04-29 15:18:15 +020080 'devices' : ['CM0', 'CM0plus', 'CM3', 'CM4', 'CM4FP', 'CM7', 'CM7SP', 'CM7DP',
Jonatan Antoni027e8692022-10-31 13:37:25 +010081 'CM23', 'CM23S', 'CM23NS', 'CM33', 'CM33S', 'CM33NS',
82 'CM35P', 'CM35PS', 'CM35PNS', 'CM55', 'CM55S', 'CM55NS',
83 'CM85S', 'CM85NS',
84 'CA5', 'CA7', 'CA9'],
Jonatan Antoni107fde42021-04-29 15:18:15 +020085 'configs' : [
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020086 'AC5': ['low', 'mid', 'high', 'size', 'tiny'],
Jonatan Antoni107fde42021-04-29 15:18:15 +020087 'AC6': ['low', 'mid', 'high', 'size', 'tiny'],
Jonatan Antoni4b0ede32021-04-29 18:26:29 +020088 'AC6LTM': ['low', 'mid', 'high', 'size', 'tiny'],
89 'GCC': ['low', 'mid', 'high', 'size', 'tiny']
Jonatan Antoni107fde42021-04-29 15:18:15 +020090 ]
Jonatan Antoni6485da42021-06-17 15:23:34 +020091 ],
92 'release': []
Jonatan Antoni107fde42021-04-29 15:18:15 +020093]
94CONFIGURATION = CONFIGURATIONS[JOB_BASE_NAME]
95
96// ---- PIPELINE CODE ----
97
98def getChangeset() {
99 def fileset = sh encoding: 'UTF-8', label: '', returnStdout: true, script: 'git diff --name-only HEAD~1..HEAD'
100 return fileset.split('\n')
101}
102
103def fileSetMatches(fileset, patternset) {
104 return patternset.any { p ->
105 fileset.any{ f -> f ==~ p }
106 }
107}
108
109FORCE_BUILD = false
Jonatan Antoni6485da42021-06-17 15:23:34 +0200110DOCKER_BUILD = isPrecommit || isPostcommit || isNightly
111CORE_VALIDATION = isPrecommit || isPostcommit || isNightly
Jonatan Antoni107fde42021-04-29 15:18:15 +0200112COMMIT = null
113VERSION = null
114
Jonatan Antoni6485da42021-06-17 15:23:34 +0200115artifactory = new ArtifactoryHelper(this)
116
Jonatan Antoni107fde42021-04-29 15:18:15 +0200117pipeline {
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200118 agent { label 'master' }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200119 options {
120 timestamps()
121 timeout(time: 1, unit: 'HOURS')
122 ansiColor('xterm')
123 skipDefaultCheckout()
124 }
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200125 environment {
126 CI_ACCOUNT = credentials('grasci')
127 ARTIFACTORY = credentials('artifactory')
128 USER = "${CI_ACCOUNT_USR}"
129 PASS = "${CI_ACCOUNT_PSW}"
130 ARTIFACTORY_API_KEY = "${ARTIFACTORY_PSW}"
131 }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200132 stages {
133 stage('Checkout') {
134 steps {
135 script {
136 COMMIT = checkoutScmWithRetry(3)
137 echo "COMMIT: ${COMMIT}"
Jonatan Antoni744e2392022-01-27 16:58:49 +0100138 VERSION = (sh(returnStdout: true, script: 'git describe --tags --always')).trim()
Jonatan Antoni107fde42021-04-29 15:18:15 +0200139 echo "VERSION: '${VERSION}'"
140 }
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200141
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200142 stash name: 'dockerfile', includes: 'docker/**'
Jonatan Antoni107fde42021-04-29 15:18:15 +0200143 }
144 }
145
146 stage('Analyse') {
147 when {
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200148 expression { return isPrecommit || isPostcommit }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200149 beforeOptions true
150 }
151 steps {
152 script {
153 def fileset = changeset
Jonatan Antoni5f8564b2021-04-29 16:59:54 +0200154 def hasGlobal = fileSetMatches(fileset, patternGlobal)
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200155 def hasDocker = fileSetMatches(fileset, patternDocker)
Jonatan Antoni107fde42021-04-29 15:18:15 +0200156 def hasCoreM = fileSetMatches(fileset, patternCoreM)
157 def hasCoreA = fileSetMatches(fileset, patternCoreA)
158 def hasCoreValidation = fileSetMatches(fileset, patternCoreValidation)
159
160echo """Change analysis:
Jonatan Antoni5f8564b2021-04-29 16:59:54 +0200161- hasGlobal = ${hasGlobal}
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200162- hasDocker = ${hasDocker}
Jonatan Antoni107fde42021-04-29 15:18:15 +0200163- hasCoreM = ${hasCoreM}
164- hasCoreA = ${hasCoreA}
165- hasCoreValidation = ${hasCoreValidation}
166"""
167
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200168 if (isPrecommit) {
169 if (hasGlobal || hasDocker || hasCoreM || hasCoreValidation) {
170 CONFIGURATION['devices'] += CONFIGURATION['mdevices']
171 }
172 if (hasGlobal || hasDocker || hasCoreA || hasCoreValidation) {
173 CONFIGURATION['devices'] += CONFIGURATION['adevices']
174 }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200175 }
176
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200177 DOCKER_BUILD &= hasDocker
178 CORE_VALIDATION &= hasGlobal || hasDocker || hasCoreM || hasCoreA || hasCoreValidation
179
Jonatan Antoni107fde42021-04-29 15:18:15 +0200180echo """Stage schedule:
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200181- DOCKER_BUILD = ${DOCKER_BUILD}
Jonatan Antoni107fde42021-04-29 15:18:15 +0200182- CORE_VALIDATION = ${CORE_VALIDATION}
183"""
184 }
185 }
186 }
187
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200188 stage('Docker Lint') {
189 when {
190 expression { return DOCKER_BUILD }
191 beforeOptions true
192 }
193 agent {
194 kubernetes {
195 defaultContainer 'hadolint'
196 slaveConnectTimeout 600
197 yaml """\
198 apiVersion: v1
199 kind: Pod
200 securityContext:
201 runAsUser: 1000
202 runAsGroup: 1000
203 spec:
204 imagePullSecrets:
205 - name: artifactory-mcu-docker
206 securityContext:
207 runAsUser: 1000
208 runAsGroup: 1000
209 containers:
210 - name: hadolint
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200211 image: mcu--docker.eu-west-1.artifactory.aws.arm.com/hadolint/hadolint:${HADOLINT_VERSION}
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200212 alwaysPullImage: true
213 imagePullPolicy: Always
214 command:
215 - sleep
216 args:
217 - infinity
218 resources:
219 requests:
Samuel Pelegrinello Caipers77e149c2022-06-22 12:48:59 +0200220 cpu: 900m
221 memory: 3Gi
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200222 """.stripIndent()
223 }
224 }
225 steps {
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200226 unstash 'dockerfile'
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200227
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200228 sh 'hadolint --format json docker/dockerfile* | tee hadolint.log'
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200229
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200230 recordIssues tools: [hadoLint(id: 'hadolint', pattern: 'hadolint.log')],
231 qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
232 referenceJobName: 'nightly', ignoreQualityGate: true
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200233 }
234 }
235
236 stage('Docker Build') {
237 when {
238 expression { return (isPrecommit || isPostcommit) && DOCKER_BUILD }
239 beforeOptions true
240 }
241 agent {
242 kubernetes {
243 defaultContainer 'docker-dind'
244 slaveConnectTimeout 600
245 yaml """\
246 apiVersion: v1
247 kind: Pod
248 spec:
249 imagePullSecrets:
250 - name: artifactory-mcu-docker
251 containers:
252 - name: docker-dind
253 image: docker:dind
254 securityContext:
255 privileged: true
256 volumeMounts:
257 - name: dind-storage
258 mountPath: /var/lib/docker
259 volumes:
260 - name: dind-storage
261 emptyDir: {}
262 """.stripIndent()
263 }
264 }
265 steps {
266 sh('apk add bash curl git')
267 script {
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200268 unstash 'dockerfile'
Jonatan Antoni6485da42021-06-17 15:23:34 +0200269
Jonatan Antonib5d07f02021-07-14 12:50:57 +0200270 dir('docker') {
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200271 dockerinfo = DOCKERINFO['staging']
272 withCredentials([sshUserPrivateKey(credentialsId: 'grasci_with_pk',
273 keyFileVariable: 'grasciPk',
274 passphraseVariable: '',
275 usernameVariable: 'grasciUsername')]) {
276 sh("GIT_SSH_COMMAND='ssh -i $grasciPk -o StrictHostKeyChecking=no' ./getDependencies.sh")
277 }
278 docker.withRegistry("https://${dockerinfo['registryUrl']}", dockerinfo['registryCredentialsId']) {
279 def image = docker.build("${dockerinfo['registryUrl']}/${dockerinfo['image']}:${dockerinfo['label']}", "--build-arg DOCKER_REGISTRY=${dockerinfo['registryUrl']} .")
280 image.push()
281 }
282 }
283 }
284 }
285 }
286
Jonatan Antonidef6f802021-05-06 17:31:38 +0200287 stage('Pack') {
288 agent {
289 kubernetes {
290 defaultContainer 'cmsis'
291 slaveConnectTimeout 600
292 yaml """\
293 apiVersion: v1
294 kind: Pod
295 spec:
296 imagePullSecrets:
297 - name: ${dockerinfo['k8sPullSecret']}
298 securityContext:
299 runAsUser: 1000
300 runAsGroup: 1000
301 containers:
302 - name: cmsis
303 image: ${dockerinfo['registryUrl']}/${dockerinfo['image']}:${dockerinfo['label']}
304 alwaysPullImage: true
305 imagePullPolicy: Always
306 command:
307 - sleep
308 args:
309 - infinity
310 resources:
311 requests:
Samuel Pelegrinello Caipers77e149c2022-06-22 12:48:59 +0200312 cpu: 900m
313 memory: 3Gi
Jonatan Antonidef6f802021-05-06 17:31:38 +0200314 """.stripIndent()
315 }
316 }
317 steps {
318 checkoutScmWithRetry(3)
Jonatan Antoni2d177712022-04-06 17:59:41 +0200319 sh('./CMSIS/Utilities/fetch_devtools.sh')
Jonatan Antonidef6f802021-05-06 17:31:38 +0200320 sh('./CMSIS/RTOS/RTX/LIB/fetch_libs.sh')
321 sh('./CMSIS/RTOS2/RTX/Library/fetch_libs.sh')
Jonatan Antoni6485da42021-06-17 15:23:34 +0200322
Jonatan Antonidef6f802021-05-06 17:31:38 +0200323 tee('doxygen.log') {
324 sh('./CMSIS/DoxyGen/gen_doc.sh')
325 }
326 sh('./CMSIS/Utilities/gen_pack.sh')
Jonatan Antoni6485da42021-06-17 15:23:34 +0200327
Jonatan Antonidef6f802021-05-06 17:31:38 +0200328 archiveArtifacts artifacts: 'output/ARM.CMSIS.*.pack', allowEmptyArchive: true
Jonatan Antoni6485da42021-06-17 15:23:34 +0200329 stash name: 'pack', includes: 'output/ARM.CMSIS.*.pack'
Jonatan Antonidef6f802021-05-06 17:31:38 +0200330
331 recordIssues tools: [doxygen(id: 'DOXYGEN', name: 'Doxygen', pattern: 'doxygen.log')],
332 qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
Jonatan Antoni6485da42021-06-17 15:23:34 +0200333 referenceJobName: 'nightly', ignoreQualityGate: true
Jonatan Antonidef6f802021-05-06 17:31:38 +0200334 }
335 }
336
Jonatan Antoni107fde42021-04-29 15:18:15 +0200337 stage('CoreValidation') {
338 when {
339 expression { return CORE_VALIDATION }
340 beforeOptions true
341 }
342 matrix {
343 axes {
344 axis {
345 name 'DEVICE'
346 values 'CM0', 'CM0plus', 'CM3', 'CM4', 'CM4FP', 'CM7', 'CM7SP', 'CM7DP',
347 'CM23', 'CM23S', 'CM23NS', 'CM33', 'CM33S', 'CM33NS',
Jonatan Antoni983aa0b2021-05-05 13:19:48 +0200348 'CM35P', 'CM35PS', 'CM35PNS', 'CM55', 'CM55S', 'CM55NS',
Jonatan Antoni107fde42021-04-29 15:18:15 +0200349 'CA5', 'CA5neon', 'CA7', 'CA7neon', 'CA9', 'CA9neon'
350 }
351 }
352 stages {
353 stage('Test') {
354 when {
355 expression { return DEVICE in CONFIGURATION['devices'] }
356 beforeOptions true
357 }
358 agent {
359 kubernetes {
360 defaultContainer 'cmsis'
361 slaveConnectTimeout 600
362 yaml """\
363 apiVersion: v1
364 kind: Pod
365 spec:
366 imagePullSecrets:
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200367 - name: ${dockerinfo['k8sPullSecret']}
Jonatan Antoni107fde42021-04-29 15:18:15 +0200368 securityContext:
369 runAsUser: 1000
370 runAsGroup: 1000
371 containers:
372 - name: cmsis
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200373 image: ${dockerinfo['registryUrl']}/${dockerinfo['image']}:${dockerinfo['label']}
Jonatan Antoni107fde42021-04-29 15:18:15 +0200374 alwaysPullImage: true
375 imagePullPolicy: Always
376 command:
377 - sleep
378 args:
379 - infinity
380 resources:
381 requests:
Samuel Pelegrinello Caipers77e149c2022-06-22 12:48:59 +0200382 cpu: 900m
383 memory: 3Gi
Jonatan Antoni107fde42021-04-29 15:18:15 +0200384 """.stripIndent()
385 }
386 }
387 steps {
388 checkoutScmWithRetry(3)
Jonatan Antoni027e8692022-10-31 13:37:25 +0100389 dir('CMSIS/CoreValidation/Project') {
Jonatan Antoni107fde42021-04-29 15:18:15 +0200390 script {
391 CONFIGURATION['configs'].each { COMPILER, OPTS ->
392 tee("CV_${COMPILER}_${DEVICE}.log") {
393 sh "python3 build.py -d ${DEVICE} -c ${COMPILER} -o ${OPTS.join(' -o ')} build run"
394 }
395 }
396 }
397
Jonatan Antonidef6f802021-05-06 17:31:38 +0200398 archiveArtifacts artifacts: 'CoreValidation_*.zip', allowEmptyArchive: true
Jonatan Antoni107fde42021-04-29 15:18:15 +0200399 stash name: "CV_${DEVICE}", includes: '*.log, *.junit'
400 }
401 }
402 }
403 }
404 }
405 }
406
407 stage('Results') {
Jonatan Antoni6d6cf132021-05-17 16:34:25 +0200408 when {
409 expression { return CORE_VALIDATION }
410 beforeOptions true
411 }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200412 steps {
413 dir('results') {
414 deleteDir()
415 script {
416 CONFIGURATION['devices'].each { unstash "CV_${it}" }
417 }
418
Jonatan Antoniaedfddf2021-05-03 18:32:14 +0200419 recordIssues tools: [armCc(id: 'AC5', name: 'Arm Compiler 5', pattern: 'CV_AC5_*.log'),
420 clang(id: 'AC6', name: 'Arm Compiler 6', pattern: 'CV_AC6_*.log'),
421 clang(id: 'AC6LTM', name: 'Arm Compiler 6 LTM', pattern: 'CV_AC6LTM_*.log'),
422 gcc(id: 'GCC', name: 'GNU Compiler', pattern: 'CV_GCC_*.log')],
Jonatan Antoni5f8564b2021-04-29 16:59:54 +0200423 qualityGates: [[threshold: 1, type: 'DELTA', unstable: true]],
424 referenceJobName: 'nightly', ignoreQualityGate: true
Jonatan Antoni107fde42021-04-29 15:18:15 +0200425 xunit([
426 JUnit(pattern: 'corevalidation_*.junit', failIfNotNew: false, skipNoTestFiles: true)
427 ])
428 }
429
430 }
431 }
Jonatan Antoni4b0ede32021-04-29 18:26:29 +0200432
433 stage('Docker Promote') {
434 when {
435 expression { return isPostcommit && DOCKER_BUILD }
436 beforeOptions true
437 }
438 agent {
439 kubernetes {
440 defaultContainer 'docker-dind'
441 slaveConnectTimeout 600
442 yaml """\
443 apiVersion: v1
444 kind: Pod
445 spec:
446 imagePullSecrets:
447 - name: artifactory-mcu-docker
448 containers:
449 - name: docker-dind
450 image: docker:dind
451 securityContext:
452 privileged: true
453 volumeMounts:
454 - name: dind-storage
455 mountPath: /var/lib/docker
456 volumes:
457 - name: dind-storage
458 emptyDir: {}
459 """.stripIndent()
460 }
461 }
462 steps {
463 script {
464 String postCommitTag = "${dockerinfo['registryUrl']}/${dockerinfo['image']}:${dockerinfo['label']}"
465 String prodCommitTag = "${DOCKERINFO['production']['registryUrl']}/${DOCKERINFO['production']['image']}:${DOCKERINFO['production']['label']}"
466
467 // Pull & retag Docker Staging Container to Production
468 docker.withRegistry("https://${dockerinfo['registryUrl']}", dockerinfo['registryCredentialsId']) {
469 def image = docker.image("$postCommitTag")
470 image.pull()
471 sh "docker tag $postCommitTag $prodCommitTag"
472 }
473 // Push to Docker Production
474 docker.withRegistry("https://${DOCKERINFO['production']['registryUrl']}", DOCKERINFO['production']['registryCredentialsId']) {
475 def image = docker.image("$prodCommitTag")
476 image.push()
477 }
478 }
479 }
480 }
Jonatan Antoni6485da42021-06-17 15:23:34 +0200481
482 stage('Release Promote') {
483 when {
484 expression { return isRelease }
485 beforeOptions true
486 }
487 steps {
488 unstash name: 'pack'
489 dir('output') {
490 script {
491 artifactory.upload pattern: 'ARM.CMSIS.*.pack',
492 target: "mcu.promoted/CMSIS_5/${VERSION}/",
493 props: "GIT_COMMIT=${COMMIT['GIT_COMMIT']}"
494 }
495 withCredentials([string(credentialsId: 'grasci_github', variable: 'ghtoken')]) {
Jonatan Antoni546c5c42021-06-17 16:02:24 +0200496 sh """
Jonatan Antoni6485da42021-06-17 15:23:34 +0200497 curl -XPOST \
498 -H "Authorization:token ${ghtoken}" \
499 -H "Content-Type:application/octet-stream" \
500 --data-binary @ARM.CMSIS.${VERSION}.pack \
Jonatan Antoni546c5c42021-06-17 16:02:24 +0200501 https://uploads.github.com/repos/ARM-software/CMSIS_5/releases/${VERSION}/assets?name=ARM.CMSIS.${VERSION}.pack
502 """
Jonatan Antoni6485da42021-06-17 15:23:34 +0200503 }
504 }
505 }
506 }
Jonatan Antoni107fde42021-04-29 15:18:15 +0200507 }
508}