ci: add revert migration test

This commit is contained in:
naskya 2024-05-20 19:42:15 +09:00
parent 84c374da20
commit fddfcd890f
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
2 changed files with 7 additions and 2 deletions

View file

@ -78,6 +78,7 @@ test:build:
- pnpm install --frozen-lockfile
- pnpm run build:debug
- pnpm run migrate
- psql --host postgres --user "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" --command "$(cat docs/downgrade.sql)"
test:build:backend_ts_only:
stage: test
@ -93,6 +94,7 @@ test:build:backend_ts_only:
- package.json
- Cargo.toml
- Cargo.lock
- docs/downgrade.sql
when: never
- if: $CI_COMMIT_BRANCH == 'develop' || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == 'develop'
changes:
@ -118,6 +120,7 @@ test:build:backend_ts_only:
- pnpm install --frozen-lockfile
- pnpm --filter 'backend' --filter 'firefish-js' --filter 'megalodon' run build:debug
- pnpm run migrate
- psql --host postgres --user "${POSTGRES_USER}" --dbname "${POSTGRES_DB}" --command "$(cat docs/downgrade.sql)"
test:build:client_only:
stage: test

View file

@ -1,10 +1,11 @@
# Downgrading to `v20240206`
## systemd
## systemd/pm2
1. Stop the Firefish service
```sh
sudo systemctl stop your-firefish-service.service
# or pm2 stop firefish
```
1. Take a backup
1. Revert database migrations
@ -22,7 +23,7 @@
```
1. Switch back to the `v20240206` tag
```sh
git switch v20240206
git switch --detach v20240206
```
1. Rebuild Firefish
```sh
@ -32,6 +33,7 @@
1. Start the Firefish service and confirm that Firefish is downgraded
```sh
sudo systemctl start your-firefish-service.service
# or pm2 start firefish
```
## Docker/Podman