aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/linuxserver/test.sh
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 17:29:51 +0100
committerEgor Tensin <Egor.Tensin@gmail.com>2023-03-12 17:31:03 +0100
commit1fc10fd6fcbadb8c6c8f05895ae0ede1e57b79f8 (patch)
tree5b79205f6d1b01dd76740d4177c93774b7fd064d /test/linuxserver/test.sh
parenttest: add check_web.sh (diff)
downloadwg-api-web-1fc10fd6fcbadb8c6c8f05895ae0ede1e57b79f8.tar.gz
wg-api-web-1fc10fd6fcbadb8c6c8f05895ae0ede1e57b79f8.zip
test: add LinuxServer tests
Diffstat (limited to '')
-rwxr-xr-xtest/linuxserver/test.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/test/linuxserver/test.sh b/test/linuxserver/test.sh
new file mode 100755
index 0000000..d043ce1
--- /dev/null
+++ b/test/linuxserver/test.sh
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+
+set -o errexit -o nounset -o pipefail
+shopt -s inherit_errexit lastpipe
+
+script_dir="$( dirname -- "${BASH_SOURCE[0]}" )"
+script_dir="$( cd -- "$script_dir" && pwd )"
+readonly script_dir
+
+build_services() {
+ echo ------------------------------------------------------------------
+ echo Pull third-party images
+ echo ------------------------------------------------------------------
+ docker-compose pull wg api
+
+ echo ------------------------------------------------------------------
+ echo Build wg-api-web
+ echo ------------------------------------------------------------------
+ docker-compose build --force-rm --progress plain --pull web
+
+ echo ------------------------------------------------------------------
+ echo docker-compose up
+ echo ------------------------------------------------------------------
+ docker-compose up -d
+}
+
+cleanup() {
+ echo ------------------------------------------------------------------
+ echo Cleaning up
+ echo ------------------------------------------------------------------
+ docker-compose down -v --remove-orphans
+}
+
+main() {
+ cd -- "$script_dir"
+ trap cleanup EXIT
+
+ build_services
+ sleep 3
+ "$script_dir/../check_web.sh"
+}
+
+main