diff --git a/build-signal.jenkins b/build-signal.jenkins index 388f739..5b1acb2 100644 --- a/build-signal.jenkins +++ b/build-signal.jenkins @@ -3,27 +3,30 @@ def repositoryCreds = "harbor-repository-creds" def workspace def latestTag -def label = "kubernetes-${UUID.randomUUID().toString()}" -def templateName = "pipeline-worker" def outputFile -podTemplate( - label: label, - name: templateName, - yaml: functions.podYaml( - repo: repository, - templateName: templateName, - alpine: true, - [ - [ - name: "node-18", - path: "${repository}/dockerhub/library/node:18.15", - command: "/bin/bash" - ] - ] - ) -) { - node (label) { +def label = "kubernetes-${UUID.randomUUID().toString()}" +def templateName = "pipeline-worker" + +pipeline { + agent { + kubernetes{ + yaml functions.podYaml( + repo: repository, + templateName: templateName, + alpine: true, + [ + [ + name: "node-18", + path: "${repository}/dockerhub/library/node:18.15", + command: "/bin/bash" + ] + ] + ) + } + } + + stages { stage ('Initalize Jenkins') { steps { script { @@ -63,62 +66,70 @@ podTemplate( } stage ("Clone Signal") { - dir("signal-desktop") { - checkout ([ - $class: "GitSCM", - branches: [ - [ - name: "refs/tags/" + latestTag, + steps { + dir("signal-desktop") { + checkout ([ + $class: "GitSCM", + branches: [ + [ + name: "refs/tags/" + latestTag, + ], ], - ], - userRemoteConfigs: [ - [ - url: "https://github.com/signalapp/Signal-Desktop.git", + userRemoteConfigs: [ + [ + url: "https://github.com/signalapp/Signal-Desktop.git", + ], ], - ], - extensions: [ - [ - $class: "CloneOption", - shallow: true, - depth: 1 + extensions: [ + [ + $class: "CloneOption", + shallow: true, + depth: 1 + ], + [ + $class: "CheckoutOption", + timeout: 2 + ], ], - [ - $class: "CheckoutOption", - timeout: 2 - ], - ], - ]) + ]) + } } } stage ("Build Signal") { - container ("node-18") { - writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getCurrentRootCA()) - sh """ - git config --global --add safe.directory '*' - apt-get update -yqq && apt-get full-upgrade -yqq - apt-get install -yqq curl wget git jq git-lfs - cd ${workspace}/signal-desktop - cat package.json | jq '.build.linux += {target:["AppImage"]}' > with_appimage_package.json - mv with_appimage_package.json package.json - yarn install - yarn build-release - """ + steps { + container ("node-18") { + writeFile(file: workspace + "/test-chamber-13.lan.root.crt", text: functions.getCurrentRootCA()) + sh """ + git config --global --add safe.directory '*' + apt-get update -yqq && apt-get full-upgrade -yqq + apt-get install -yqq curl wget git jq git-lfs + cd ${workspace}/signal-desktop + cat package.json | jq '.build.linux += {target:["AppImage"]}' > with_appimage_package.json + mv with_appimage_package.json package.json + yarn install + yarn build-release + """ - outputFile = sh ( - script: """ - basename \$(find ${workspace}/signal-desktop/ -name "*.AppImage") - """, - returnStdout: true - ).trim() + outputFile = sh ( + script: """ + basename \$(find ${workspace}/signal-desktop/ -name "*.AppImage") + """, + returnStdout: true + ).trim() + } } } - functions.pushArtifact( - repoCreds: "nexus-generic-upload-bot", - fileName: outputFile, - filePath: "${workspace}/release/", - fileURL: "https://nexus.c.test-chamber-13.lan/repository/generic/signal/" - ) + stage ('Push Artifacts') { + steps { + functions.pushArtifact( + repoCreds: "nexus-generic-upload-bot", + fileName: outputFile, + filePath: "${workspace}/release/", + fileURL: "https://nexus.c.test-chamber-13.lan/repository/generic/signal/" + ) + } + } } }