mirror of
https://github.com/kuaifan/dootask.git
synced 2026-08-28 23:58:40 +00:00
ci: verify database-backed deployment API
This commit is contained in:
parent
3d917997a1
commit
0d320c2d89
12
.github/scripts/deployment-regression.sh
vendored
12
.github/scripts/deployment-regression.sh
vendored
@ -63,7 +63,7 @@ wait_for_services() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
check_installation() {
|
check_installation() {
|
||||||
local port prefix user_count migration_status
|
local port prefix user_count migration_status expected_version setting_response
|
||||||
wait_for_services
|
wait_for_services
|
||||||
|
|
||||||
port="$(env_value APP_PORT)"
|
port="$(env_value APP_PORT)"
|
||||||
@ -71,6 +71,16 @@ check_installation() {
|
|||||||
--retry 30 --retry-delay 2 --retry-connrefused \
|
--retry 30 --retry-delay 2 --retry-connrefused \
|
||||||
"http://127.0.0.1:${port}/health" >/dev/null
|
"http://127.0.0.1:${port}/health" >/dev/null
|
||||||
|
|
||||||
|
expected_version="$(jq -r '.version' package.json)"
|
||||||
|
setting_response="$(curl --fail --silent --show-error \
|
||||||
|
--retry 5 --retry-delay 2 --retry-connrefused \
|
||||||
|
"http://127.0.0.1:${port}/api/system/setting")"
|
||||||
|
jq -e --arg expected_version "$expected_version" '
|
||||||
|
.ret == 1
|
||||||
|
and .data.reg == "open"
|
||||||
|
and .data.server_version == $expected_version
|
||||||
|
' <<<"$setting_response" >/dev/null
|
||||||
|
|
||||||
prefix="$(table_prefix)"
|
prefix="$(table_prefix)"
|
||||||
user_count="$(printf 'SELECT COUNT(*) FROM `%susers`;\n' "$prefix" | db_exec | tr -d '[:space:]')"
|
user_count="$(printf 'SELECT COUNT(*) FROM `%susers`;\n' "$prefix" | db_exec | tr -d '[:space:]')"
|
||||||
if [[ ! "$user_count" =~ ^[1-9][0-9]*$ ]]; then
|
if [[ ! "$user_count" =~ ^[1-9][0-9]*$ ]]; then
|
||||||
|
|||||||
5
.github/workflows/deployment-regression.yml
vendored
5
.github/workflows/deployment-regression.yml
vendored
@ -102,6 +102,11 @@ jobs:
|
|||||||
- name: Install v1.6.89
|
- name: Install v1.6.89
|
||||||
run: sudo ./cmd install
|
run: sudo ./cmd install
|
||||||
|
|
||||||
|
- name: Reload v1.6.89 services
|
||||||
|
run: |
|
||||||
|
sudo ./cmd restart php
|
||||||
|
sudo ./cmd up
|
||||||
|
|
||||||
- name: Seed upgrade sentinel
|
- name: Seed upgrade sentinel
|
||||||
run: |
|
run: |
|
||||||
"$RUNNER_TEMP/deployment-regression.sh" check-installation
|
"$RUNNER_TEMP/deployment-regression.sh" check-installation
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user