Skip to content

Commit

Permalink
ci,scripts/tests/rolling-upgrade: run rolling upgrade test on private…
Browse files Browse the repository at this point in the history
… jenkins

Change-Id: Ic1c9f7539ee0ac371bcb856bdbcac2ff6c0ccc65
  • Loading branch information
mobyvb committed Jan 2, 2020
1 parent aecea82 commit 4910c69
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 6 deletions.
35 changes: 35 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ node('node') {
echo "Current build result: ${currentBuild.result}"
}

/*
stage('Run Versions Test') {
try {
echo "Running Versions test"
Expand Down Expand Up @@ -39,6 +40,38 @@ node('node') {
sh 'docker stop redis || true'
}
}
*/

stage('Run Rolling Upgrade Test') {
try {
echo "Running Rolling Upgrade test"

env.STORJ_SIM_POSTGRES = 'postgres://postgres@postgres:5432/teststorj2?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 -p 5433:5432 --name postgres2 postgres:9.6'
sh 'docker run --rm -d -p 6380:6379 --name redis2 redis:latest'

sh '''until $(docker logs postgres2 | grep "database system is ready to accept connections" > /dev/null)
do printf '.'
sleep 5
done
'''
sh 'docker exec postgres2 createdb -U postgres teststorj2'
// 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 redis2:redis --link postgres2:postgres -e CC=gcc storjlabs/golang:1.13.5'
}
catch(err){
throw err
}
finally {
sh 'docker stop postgres2 || true'
sh 'docker stop redis2 || true'
}
}

stage('Build Binaries') {
sh 'make binaries'
Expand Down Expand Up @@ -93,13 +126,15 @@ node('node') {
echo "Setting build result to FAILURE"
currentBuild.result = "FAILURE"

/*
slackSend color: 'danger', message: "@channel ${env.BRANCH_NAME} build failed during stage ${env.STAGE_NAME} ${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

Expand Down
12 changes: 6 additions & 6 deletions scripts/tests/rollingupgrade/test-sim-rolling-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ for version in ${unique_versions}; do
then
echo "Installing storj-sim for ${version} in ${dir}."
pushd ${dir}
# install_sim ${bin_dir}
GOBIN=${bin_dir} make -C "${dir}" install-sim > /dev/null 2>&1
install_sim ${bin_dir}
# GOBIN=${bin_dir} make -C "${dir}" install-sim > /dev/null 2>&1
echo "finished installing"
popd
echo "Setting up storj-sim for ${version}. Bin: ${bin_dir}, Config: ${dir}/local-network"
Expand All @@ -214,10 +214,10 @@ for version in ${unique_versions}; do
echo "Installing uplink and gateway for ${version} in ${dir}."
pushd ${dir}
mkdir -p ${bin_dir}
# go install -race -v -o ${bin_dir}/uplink storj.io/storj/cmd/uplink >/dev/null 2>&1
# go install -race -v -o ${bin_dir}/gateway storj.io/storj/cmd/gateway >/dev/null 2>&1
GOBIN=${bin_dir} go install -race -v storj.io/storj/cmd/uplink > /dev/null 2>&1
GOBIN=${bin_dir} go install -race -v storj.io/storj/cmd/gateway > /dev/null 2>&1
go install -race -v -o ${bin_dir}/uplink storj.io/storj/cmd/uplink >/dev/null 2>&1
go install -race -v -o ${bin_dir}/gateway storj.io/storj/cmd/gateway >/dev/null 2>&1
# GOBIN=${bin_dir} go install -race -v storj.io/storj/cmd/uplink > /dev/null 2>&1
# GOBIN=${bin_dir} go install -race -v storj.io/storj/cmd/gateway > /dev/null 2>&1
popd
echo "Finished installing. ${bin_dir}:" $(ls ${bin_dir})
echo "Binary shasums:"
Expand Down

0 comments on commit 4910c69

Please sign in to comment.