Procházet zdrojové kódy

ci: rename scripts/relup/ to scripts/relup-test

Zaiming (Stone) Shi před 3 roky
rodič
revize
4d4634335c

+ 10 - 0
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:
+```
+
+```

scripts/relup/check-results.sh → scripts/relup-test/check-results.sh


+ 1 - 1
scripts/relup/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:

scripts/relup/run-pkg.sh → scripts/relup-test/run-pkg.sh


+ 10 - 5
scripts/relup/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

+ 2 - 2
scripts/relup/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" \