From 4d4634335ced943e45b80d70c2fad0e27ad5fc67 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Wed, 29 Jun 2022 08:01:05 +0200 Subject: [PATCH] ci: rename scripts/relup/ to scripts/relup-test --- scripts/relup-test/README.md | 10 ++++++++++ scripts/{relup => relup-test}/check-results.sh | 0 scripts/{relup => relup-test}/relup.lux | 2 +- scripts/{relup => relup-test}/run-pkg.sh | 0 scripts/{relup => relup-test}/run-relup-lux.sh | 15 ++++++++++----- .../start-relup-test-cluster.sh | 4 ++-- 6 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 scripts/relup-test/README.md rename scripts/{relup => relup-test}/check-results.sh (100%) rename scripts/{relup => relup-test}/relup.lux (98%) rename scripts/{relup => relup-test}/run-pkg.sh (100%) rename scripts/{relup => relup-test}/run-relup-lux.sh (73%) rename scripts/{relup => relup-test}/start-relup-test-cluster.sh (96%) diff --git a/scripts/relup-test/README.md b/scripts/relup-test/README.md new file mode 100644 index 000000000..ff2db1ed9 --- /dev/null +++ b/scripts/relup-test/README.md @@ -0,0 +1,10 @@ +# Hot-upgrade test + +This collection of scripts is used in CI. + +It can also be used to run the test locally, but limited to ubuntu 20.04 so far. + +How to: +``` + +``` diff --git a/scripts/relup/check-results.sh b/scripts/relup-test/check-results.sh similarity index 100% rename from scripts/relup/check-results.sh rename to scripts/relup-test/check-results.sh diff --git a/scripts/relup/relup.lux b/scripts/relup-test/relup.lux similarity index 98% rename from scripts/relup/relup.lux rename to scripts/relup-test/relup.lux index 88a504cb8..8db8169f8 100644 --- a/scripts/relup/relup.lux +++ b/scripts/relup-test/relup.lux @@ -116,7 +116,7 @@ !sleep 5 ?SH-PROMPT - !$PROJ_ROOT/scripts/relup/check-results.sh + !$PROJ_ROOT/scripts/relup-test/check-results.sh !echo ==$$?== ???ALL_IS_WELL ?SH-PROMPT: diff --git a/scripts/relup/run-pkg.sh b/scripts/relup-test/run-pkg.sh similarity index 100% rename from scripts/relup/run-pkg.sh rename to scripts/relup-test/run-pkg.sh diff --git a/scripts/relup/run-relup-lux.sh b/scripts/relup-test/run-relup-lux.sh similarity index 73% rename from scripts/relup/run-relup-lux.sh rename to scripts/relup-test/run-relup-lux.sh index af0ecf4c7..54be86444 100755 --- a/scripts/relup/run-relup-lux.sh +++ b/scripts/relup-test/run-relup-lux.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash ## This script needs the 'lux' command in PATH -## it runs the scripts/relup/relup.lux script +## it runs the scripts/relup-test/relup.lux script set -euo pipefail @@ -16,13 +16,18 @@ cd -P -- "$(dirname -- "$0")/../.." set -x +if [ ! -d '.git' ] && [ -z "${CUR_VSN:-}" ]; then + echo "Unable to resolve current version, because it's not a git repo, and CUR_VSN is not set" + exit 1 +fi + case "$old_vsn" in e*) - cur_vsn="$(./pkg-vsn.sh emqx-enterprise)" + cur_vsn="${CUR_VSN:-$(./pkg-vsn.sh emqx-enterprise)}" profile='emqx-enterprise' ;; v*) - cur_vsn="$(./pkg-vsn.sh emqx)" + cur_vsn="${CUR_VSN:-$(./pkg-vsn.sh emqx)}" profile='emqx' ;; *) @@ -48,7 +53,7 @@ if [ ! -f "$CUR_PKG" ]; then fi # start two nodes and their friends (webhook server and a bench) in docker -./scripts/relup/start-relup-test-cluster.sh 'ubuntu:20.04' "$OLD_PKG" +./scripts/relup-test/start-relup-test-cluster.sh 'ubuntu:20.04' "$OLD_PKG" # run relup tests lux \ @@ -61,4 +66,4 @@ lux \ --var NODE1="node1.emqx.io" \ --var NODE2="node2.emqx.io" \ --var BENCH="bench.emqx.io" \ - ./scripts/relup/relup.lux + ./scripts/relup-test/relup.lux diff --git a/scripts/relup/start-relup-test-cluster.sh b/scripts/relup-test/start-relup-test-cluster.sh similarity index 96% rename from scripts/relup/start-relup-test-cluster.sh rename to scripts/relup-test/start-relup-test-cluster.sh index deaec4ad1..10bb25a60 100755 --- a/scripts/relup/start-relup-test-cluster.sh +++ b/scripts/relup-test/start-relup-test-cluster.sh @@ -42,7 +42,7 @@ docker run -d -t --name "$NODE1" \ -e EMQX_NODE_COOKIE="$COOKIE" \ -p 18083:18083 \ -v "$PKG:/emqx.tar.gz" \ - -v "$(pwd)/scripts/relup/run-pkg.sh:/run-pkg.sh" \ + -v "$(pwd)/scripts/relup-test/run-pkg.sh:/run-pkg.sh" \ "$IMAGE" /run-pkg.sh emqx.tar.gz docker run -d -t --name "$NODE2" \ @@ -52,7 +52,7 @@ docker run -d -t --name "$NODE2" \ -e EMQX_NODE_COOKIE="$COOKIE" \ -p 18084:18083 \ -v "$PKG:/emqx.tar.gz" \ - -v "$(pwd)/scripts/relup/run-pkg.sh:/run-pkg.sh" \ + -v "$(pwd)/scripts/relup-test/run-pkg.sh:/run-pkg.sh" \ "$IMAGE" /run-pkg.sh emqx.tar.gz docker run -d -t --name "$WEBHOOK" \