21 lines
1.1 KiB
Bash
21 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
root=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)
|
|
cd "$root"
|
|
stamp=$(date +%Y%m%d-%H%M%S)
|
|
docker image tag hainuo-relay:0.1.0 "hainuo-relay:before-userapi-$stamp"
|
|
docker build --network none --pull=false -f Dockerfile.offline -t hainuo-relay:0.1.0 .
|
|
args=(-f compose.yaml)
|
|
for override in compose.offline.yaml compose.edge-fix.yaml compose.h5.yaml compose.work.yaml compose.feishu.yaml compose.autoreg.yaml; do
|
|
if [[ -f "$override" ]]; then args+=(-f "$override"); fi
|
|
done
|
|
args+=(-f compose.userapi.yaml)
|
|
docker compose "${args[@]}" up -d --no-build --pull never --no-deps --force-recreate connector router
|
|
if [[ -n "$(docker compose -f compose.yaml ps -q longconn)" ]]; then
|
|
docker compose "${args[@]}" --profile longconn up -d --no-build --pull never --no-deps --force-recreate longconn
|
|
fi
|
|
docker compose "${args[@]}" ps
|
|
echo "Previous image: hainuo-relay:before-userapi-$stamp"
|
|
echo 'Keep compose.autoreg.yaml and compose.userapi.yaml in future application recreations.'
|
|
echo 'Configure platform callback/scopes, then each user completes personal authorization.'
|