ci,scripts/tests/rolling-upgrade: run rolling upgrade test on private jenkins

Change-Id: Ic1c9f7539ee0ac371bcb856bdbcac2ff6c0ccc65
This commit is contained in:
Moby von Briesen 2020-01-02 14:16:46 -05:00
parent aecea820fc
commit e34ac3ef3a
2 changed files with 41 additions and 6 deletions

31
Jenkinsfile vendored
View File

@ -40,6 +40,37 @@ node('node') {
}
}
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'
}
}
stage('Build Binaries') {
sh 'make binaries'

View File

@ -198,8 +198,10 @@ 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
# uncomment for Jenkins testing:
install_sim ${bin_dir}
# uncomment for local testing:
# 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"
@ -214,10 +216,12 @@ 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
# uncomment for Jenkins testing:
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
# uncomment for local testing:
# 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:"