From 309ad2cb2931e54abe5b83fba9ec1c33b2d9e99c Mon Sep 17 00:00:00 2001 From: Jess G Date: Sun, 18 Aug 2019 07:51:33 -0700 Subject: [PATCH] jenkins: Backwards Compatibility use Postgres (#2810) * add postgres support * fix indentation * create db * rm prod configs file --- Jenkinsfile.public | 4 +++- scripts/test-sim-backwards.sh | 9 +++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.public b/Jenkinsfile.public index 8ed25df38..75453d1cf 100644 --- a/Jenkinsfile.public +++ b/Jenkinsfile.public @@ -95,11 +95,13 @@ pipeline { environment { STORJ_NETWORK_HOST4 = '127.0.0.3' STORJ_NETWORK_HOST6 = '127.0.0.3' + + STORJ_SIM_POSTGRES = 'postgres://postgres@localhost/teststorj3?sslmode=disable' } steps { + sh 'psql -U postgres -c \'create database teststorj3;\'' sh 'make test-sim-backwards-compatible' - } } } diff --git a/scripts/test-sim-backwards.sh b/scripts/test-sim-backwards.sh index 5c46d5b35..f9b5d0407 100755 --- a/scripts/test-sim-backwards.sh +++ b/scripts/test-sim-backwards.sh @@ -21,7 +21,7 @@ latestReleaseTag=$(git describe --tags `git rev-list --tags --max-count=1`) latestReleaseCommit=$(git rev-list -n 1 "$latestReleaseTag") echo "Checking out latest release tag: $latestReleaseTag" git worktree add -f "$RELEASE_DIR" "$latestReleaseCommit" -# to run with sqlite, we need to delete this release file that forces postgres +# delete this file that forces production config settings rm "$RELEASE_DIR/internal/version/release.go" SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" @@ -29,9 +29,14 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" make -C "$RELEASE_DIR" install-sim STORJ_NETWORK_HOST4=${STORJ_NETWORK_HOST4:-127.0.0.1} +STORJ_SIM_POSTGRES=${STORJ_SIM_POSTGRES:-""} # setup the network -storj-sim -x --host $STORJ_NETWORK_HOST4 network setup +if [ -z ${STORJ_SIM_POSTGRES} ]; then + storj-sim -x --host $STORJ_NETWORK_HOST4 network setup +else + storj-sim -x --host $STORJ_NETWORK_HOST4 network --postgres=$STORJ_SIM_POSTGRES setup +fi # run upload part of backward compatibility tests from the lastest release branch storj-sim -x --host $STORJ_NETWORK_HOST4 network test bash "$SCRIPTDIR"/test-backwards.sh upload