storj/Jenkinsfile
Kaloyan Raev 616b2f521a installer/windows: add to private Jenkins build (#3206)
* Build Windows Installer stage

* Run the Windows Installer build on thw windows node

* Disable Build Images, Push Images and Upload steps

* checkout scm on windows agent

* Execute MSBuild

* Use bat instead of sh

* Test stash

* Copy artifacts between nodes

* Fix typo

* Sign Windows Installer

* Fix Makefile

* Enable binaries-upload

* Set Product Version to 0.0.0

* Build installer with Release configuration

* Enable back docker image stages and slack alerts

* Restore SNOboard shortcut after resolving conflicts

* Remove empty line from build.bat
2019-10-08 13:51:22 +02:00

93 lines
2.1 KiB
Groovy

node('node') {
properties([disableConcurrentBuilds()])
try {
currentBuild.result = "SUCCESS"
stage('Checkout') {
checkout scm
echo "Current build result: ${currentBuild.result}"
}
stage('Build Binaries') {
sh 'make binaries'
stash name: "storagenode-binaries", includes: "release/**/storagenode*.exe"
echo "Current build result: ${currentBuild.result}"
}
stage('Build Windows Installer') {
node('windows') {
checkout scm
unstash "storagenode-binaries"
bat 'installer\\windows\\build.bat'
stash name: "storagenode-installer", includes: "release/**/storagenode*.msi"
echo "Current build result: ${currentBuild.result}"
}
}
stage('Sign Windows Installer') {
unstash "storagenode-installer"
sh 'make sign-windows-installer'
echo "Current build result: ${currentBuild.result}"
}
stage('Build Images') {
sh 'make images'
echo "Current build result: ${currentBuild.result}"
}
stage('Push Images') {
echo 'Push to Repo'
sh 'make push-images'
echo "Current build result: ${currentBuild.result}"
}
if (env.BRANCH_NAME == "master") {
/* This should only deploy to staging if the branch is master */
stage('Deploy to staging') {
sh 'make deploy'
echo "Current build result: ${currentBuild.result}"
}
}
stage('Upload') {
sh 'make binaries-upload'
echo "Current build result: ${currentBuild.result}"
}
}
catch (err) {
echo "Caught errors! ${err}"
echo "Setting build result to FAILURE"
currentBuild.result = "FAILURE"
slackSend color: 'danger', message: "@channel ${env.BRANCH_NAME} build failed ${env.BUILD_URL}"
mail from: 'builds@storj.io',
replyTo: 'builds@storj.io',
to: 'builds@storj.io',
subject: "storj/storj branch ${env.BRANCH_NAME} build failed",
body: "Project build log: ${env.BUILD_URL}"
throw err
}
finally {
stage('Cleanup') {
sh 'make clean-images'
deleteDir()
}
}
}