2018-04-25 19:04:12 +01:00
|
|
|
node('node') {
|
2018-12-17 20:33:59 +00:00
|
|
|
properties([disableConcurrentBuilds()])
|
2018-04-25 19:04:12 +01:00
|
|
|
try {
|
2018-08-22 14:18:50 +01:00
|
|
|
currentBuild.result = "SUCCESS"
|
2018-04-25 19:04:12 +01:00
|
|
|
|
2018-07-13 16:02:33 +01:00
|
|
|
stage('Checkout') {
|
2018-08-22 14:18:50 +01:00
|
|
|
checkout scm
|
|
|
|
|
|
|
|
echo "Current build result: ${currentBuild.result}"
|
2018-07-13 16:02:33 +01:00
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
2019-12-19 05:29:47 +00:00
|
|
|
stage('Run Versions Test') {
|
|
|
|
try {
|
|
|
|
echo "Running Versions test"
|
|
|
|
|
|
|
|
env.STORJ_SIM_POSTGRES = 'postgres://postgres@postgres:5432/teststorj?sslmode=disable'
|
|
|
|
env.STORJ_SIM_REDIS = 'redis:6379'
|
|
|
|
|
|
|
|
echo "STORJ_SIM_POSTGRES: $STORJ_SIM_POSTGRES"
|
|
|
|
echo "STORJ_SIM_REDIS: $STORJ_SIM_REDIS"
|
|
|
|
sh 'docker run --rm -d --name postgres postgres:9.6'
|
|
|
|
sh 'docker run --rm -d --name redis redis:latest'
|
|
|
|
|
|
|
|
sh '''until $(docker logs postgres | grep "database system is ready to accept connections" > /dev/null)
|
|
|
|
do printf '.'
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
'''
|
|
|
|
sh 'docker exec postgres createdb -U postgres teststorj'
|
|
|
|
// fetch the remote master branch
|
|
|
|
sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/master:refs/remotes/origin/master'
|
2019-12-20 22:31:00 +00:00
|
|
|
sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/testversions/test-sim-versions.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis:redis --link postgres:postgres -e CC=gcc storjlabs/golang:1.13.5'
|
2019-12-19 05:29:47 +00:00
|
|
|
}
|
|
|
|
catch(err){
|
|
|
|
throw err
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
sh 'docker stop postgres || true'
|
|
|
|
sh 'docker stop redis || true'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-02 19:16:46 +00:00
|
|
|
stage('Run Rolling Upgrade Test') {
|
|
|
|
try {
|
|
|
|
echo "Running Rolling Upgrade test"
|
|
|
|
|
|
|
|
env.STORJ_SIM_POSTGRES = 'postgres://postgres@postgres:5432/teststorj?sslmode=disable'
|
|
|
|
env.STORJ_SIM_REDIS = 'redis:6379'
|
|
|
|
|
|
|
|
echo "STORJ_SIM_POSTGRES: $STORJ_SIM_POSTGRES"
|
|
|
|
echo "STORJ_SIM_REDIS: $STORJ_SIM_REDIS"
|
|
|
|
sh 'docker run --rm -d --name postgres postgres:9.6'
|
|
|
|
sh 'docker run --rm -d --name redis redis:latest'
|
|
|
|
|
|
|
|
sh '''until $(docker logs postgres | grep "database system is ready to accept connections" > /dev/null)
|
|
|
|
do printf '.'
|
|
|
|
sleep 5
|
|
|
|
done
|
|
|
|
'''
|
|
|
|
sh 'docker exec postgres createdb -U postgres teststorj'
|
|
|
|
// fetch the remote master branch
|
|
|
|
sh 'git fetch --no-tags --progress -- https://github.com/storj/storj.git +refs/heads/master:refs/remotes/origin/master'
|
|
|
|
sh 'docker run -u $(id -u):$(id -g) --rm -i -v $PWD:$PWD -w $PWD --entrypoint $PWD/scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh -e STORJ_SIM_POSTGRES -e STORJ_SIM_REDIS --link redis:redis --link postgres:postgres -e CC=gcc storjlabs/golang:1.13.5'
|
|
|
|
}
|
|
|
|
catch(err){
|
|
|
|
throw err
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
sh 'docker stop postgres || true'
|
|
|
|
sh 'docker stop redis || true'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-03 19:14:38 +01:00
|
|
|
stage('Build Binaries') {
|
|
|
|
sh 'make binaries'
|
2018-08-22 14:18:50 +01:00
|
|
|
|
2019-10-08 12:51:22 +01:00
|
|
|
stash name: "storagenode-binaries", includes: "release/**/storagenode*.exe"
|
|
|
|
|
|
|
|
echo "Current build result: ${currentBuild.result}"
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Build Windows Installer') {
|
2019-11-12 18:33:47 +00:00
|
|
|
node('windows') {
|
2019-10-08 12:51:22 +01:00
|
|
|
checkout scm
|
|
|
|
|
|
|
|
unstash "storagenode-binaries"
|
|
|
|
|
2020-01-03 13:28:04 +00:00
|
|
|
bat 'installer\\windows\\buildrelease.bat'
|
2019-10-08 12:51:22 +01:00
|
|
|
|
|
|
|
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'
|
|
|
|
|
2018-08-22 14:18:50 +01:00
|
|
|
echo "Current build result: ${currentBuild.result}"
|
2018-07-13 16:02:33 +01:00
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
2019-05-03 19:14:38 +01:00
|
|
|
stage('Build Images') {
|
|
|
|
sh 'make images'
|
2018-08-31 16:21:44 +01:00
|
|
|
|
|
|
|
echo "Current build result: ${currentBuild.result}"
|
|
|
|
}
|
|
|
|
|
2018-08-14 16:00:39 +01:00
|
|
|
stage('Push Images') {
|
2018-09-18 14:46:04 +01:00
|
|
|
echo 'Push to Repo'
|
|
|
|
sh 'make push-images'
|
2018-08-22 14:18:50 +01:00
|
|
|
echo "Current build result: ${currentBuild.result}"
|
2018-08-14 16:00:39 +01:00
|
|
|
}
|
|
|
|
|
2018-09-18 14:46:04 +01:00
|
|
|
stage('Upload') {
|
|
|
|
sh 'make binaries-upload'
|
|
|
|
echo "Current build result: ${currentBuild.result}"
|
|
|
|
}
|
2018-04-25 19:04:12 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
catch (err) {
|
2018-08-22 14:18:50 +01:00
|
|
|
echo "Caught errors! ${err}"
|
|
|
|
echo "Setting build result to FAILURE"
|
2018-04-25 19:04:12 +01:00
|
|
|
currentBuild.result = "FAILURE"
|
|
|
|
|
2020-01-03 16:54:01 +00:00
|
|
|
slackSend color: 'danger', message: "@build-team ${env.BRANCH_NAME} build failed during stage ${env.STAGE_NAME} ${env.BUILD_URL}"
|
2019-08-29 16:35:02 +01:00
|
|
|
|
2018-09-18 14:46:04 +01:00
|
|
|
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}"
|
2018-04-25 19:04:12 +01:00
|
|
|
|
|
|
|
throw err
|
2018-07-13 16:02:33 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
stage('Cleanup') {
|
2018-09-13 17:55:14 +01:00
|
|
|
sh 'make clean-images'
|
2018-07-13 16:02:33 +01:00
|
|
|
deleteDir()
|
|
|
|
}
|
|
|
|
|
2018-04-25 19:04:12 +01:00
|
|
|
}
|
|
|
|
}
|