CI / desktop (ubuntu-latest) (push) Successful in 2h34m54s
CI / mobile (push) Failing after 4m52s
CI / desktop (macos-latest) (push) Canceled after 0s
CI / desktop (windows-latest) (push) Canceled after 0s
CI / docker (push) Successful in 53m34s
Docs / build (push) Canceled after 0s
Docs / deploy (push) Canceled after 0s
CI / go (Media) (push) Successful in 13m0s
CI / go (Server) (push) Successful in 24m4s
CI / go (Web-App) (push) Successful in 12m35s
CI / frontend (push) Failing after 11m51s
CHANGELOG.md gets the 0.3.0 notes: everything since 0.2.0 by area, and the steps for upgrading a 0.2.0 install (new compose files with a stock PocketBase on 8070, pb_data at /pb/pb_data, the media service, and the SMTP password to enter once more). The release workflow now uses the tag's CHANGELOG section as the Gitea release text. A v0.2.0 compose stack with data was upgraded in place to this commit and kept its data. Also fixes what CI would have failed on: - Server lint (golangci-lint v2.14): errors.Is/As for sentinel errors, the bbolt/errors package instead of the deprecated bolt error, one needless conversion, and commented nolints for gosec false positives. - SPDX headers on Database/export-schema.sh and Server/entrypoint.sh. - Prettier on two files; the generated pbschema/schema.json is ignored. - The editor-bridge dist page rebuilt to match the phone app's copy. PLAN.md and the upgrade guide point to the release notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
48 lines
1.6 KiB
Bash
48 lines
1.6 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Regenerates Server/internal/pbschema/schema.json from pb_migrations.
|
|
#
|
|
# docwell-server applies that snapshot to PocketBase on every start, so after
|
|
# adding or changing a migration here, run this and commit the new JSON:
|
|
#
|
|
# sh Database/export-schema.sh
|
|
#
|
|
# Needs Docker and Go. Starts a throwaway PocketBase (the same base image the
|
|
# stack runs), lets it apply the migrations to an empty database, exports the
|
|
# collections, and removes the container.
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")/.."
|
|
ROOT=$(pwd)
|
|
# Docker Desktop on Windows wants E:/..., not Git Bash's /e/...
|
|
MOUNT_ROOT=$(pwd -W 2>/dev/null || pwd)
|
|
IMAGE="${PB_IMAGE:-tajniak81/pocketbase-docker-root:0.40.6}"
|
|
NAME=docwell-schema-export
|
|
PORT=18070
|
|
EMAIL=export@docwell.localhost
|
|
PASSWORD=export-only-password
|
|
|
|
docker rm -f "$NAME" >/dev/null 2>&1 || true
|
|
trap 'docker rm -f "$NAME" >/dev/null 2>&1 || true' EXIT
|
|
|
|
# Git Bash on Windows rewrites /pb/... paths unless told not to.
|
|
MSYS_NO_PATHCONV=1 docker run -d --name "$NAME" -p "127.0.0.1:$PORT:8070" \
|
|
-e PB_ADMIN_EMAIL="$EMAIL" -e PB_ADMIN_PASSWORD="$PASSWORD" \
|
|
-v "$MOUNT_ROOT/Database/pb_migrations:/pb/pb_migrations:ro" \
|
|
"$IMAGE" >/dev/null
|
|
|
|
i=0
|
|
until docker exec "$NAME" wget -qO- http://127.0.0.1:8070/api/health >/dev/null 2>&1; do
|
|
i=$((i + 1))
|
|
if [ "$i" -gt 60 ]; then
|
|
docker logs "$NAME"
|
|
echo "PocketBase did not start" >&2
|
|
exit 1
|
|
fi
|
|
sleep 1
|
|
done
|
|
|
|
cd "$ROOT/Server"
|
|
go run ./cmd/pbschema-export -url "http://127.0.0.1:$PORT" -email "$EMAIL" -password "$PASSWORD" \
|
|
-out internal/pbschema/schema.json
|