mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-29 19:36:51 +00:00
update : refactor auto-upstall and installation methods
This commit is contained in:
31
docker-compose/1_Auto_Upstall/tests/configure/monitor.bats
Executable file
31
docker-compose/1_Auto_Upstall/tests/configure/monitor.bats
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Properly runs monitor script" {
|
||||
../expects/configure/restart.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
31
docker-compose/1_Auto_Upstall/tests/configure/restart.bats
Executable file
31
docker-compose/1_Auto_Upstall/tests/configure/restart.bats
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check all containers are restarted" {
|
||||
../expects/configure/restart.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
33
docker-compose/1_Auto_Upstall/tests/configure/scale.bats
Executable file
33
docker-compose/1_Auto_Upstall/tests/configure/scale.bats
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check NocoDB is scaled to 3 instances" {
|
||||
nproc() {
|
||||
echo 4
|
||||
}
|
||||
|
||||
../expects/configure/scale.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
result=$(docker compose ps | grep -c "nocodb/nocodb")
|
||||
[ "${result}" -eq 3 ]
|
||||
}
|
||||
17
docker-compose/1_Auto_Upstall/tests/configure/setup.sh
Executable file
17
docker-compose/1_Auto_Upstall/tests/configure/setup.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -z "$NOCO_HOME" ]; then
|
||||
NOCO_HOME="./nocodb"
|
||||
fi
|
||||
|
||||
if [ -d "$NOCO_HOME" ]; then
|
||||
cd "$NOCO_HOME" || exit
|
||||
docker compose down
|
||||
fi
|
||||
|
||||
cd "$WORKING_DIR" || exit
|
||||
rm -rf "$NOCO_HOME"
|
||||
|
||||
if [ "$1" = "setup" ]; then
|
||||
../noco.sh <<< $'\n\nN\n'
|
||||
fi
|
||||
31
docker-compose/1_Auto_Upstall/tests/configure/start.bats
Executable file
31
docker-compose/1_Auto_Upstall/tests/configure/start.bats
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check all containers are up" {
|
||||
../expects/configure/start.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
30
docker-compose/1_Auto_Upstall/tests/configure/stop.bats
Executable file
30
docker-compose/1_Auto_Upstall/tests/configure/stop.bats
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh setup
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check all containers are down" {
|
||||
../expects/configure/stop.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is not running
|
||||
count=$(docker compose ps -q | wc -l)
|
||||
[ "$count" -eq 0 ]
|
||||
}
|
||||
31
docker-compose/1_Auto_Upstall/tests/configure/upgrade.bats
Executable file
31
docker-compose/1_Auto_Upstall/tests/configure/upgrade.bats
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
NOCO_HOME="./nocodb"
|
||||
export NOCO_HOME
|
||||
|
||||
|
||||
|
||||
setup() {
|
||||
cd "${WORKING_DIR}/configure" || exit 1
|
||||
./setup.sh "setup"
|
||||
}
|
||||
|
||||
teardown() {
|
||||
if [ -n "$SKIP_TEARDOWN" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
cd "${WORKING_DIR}/install" || exit 1
|
||||
./setup.sh
|
||||
}
|
||||
|
||||
@test "Check all containers are upgraded" {
|
||||
../expects/configure/upgrade.sh
|
||||
|
||||
cd "${NOCO_HOME}" || exit 1
|
||||
|
||||
# Verify container is running
|
||||
docker compose ps | grep -q 'redis'
|
||||
docker compose ps | grep -q 'watchtower'
|
||||
docker compose ps | grep -q 'nocodb'
|
||||
}
|
||||
Reference in New Issue
Block a user