mirror of
https://github.com/Dvorinka/Primora.git
synced 2026-10-28 07:41:23 +00:00
fix: strip build blocks in installer prebuilt path
The installer's GHCR path ships a compose file that still declares build: contexts pointing at apps/*/Dockerfile, which it never downloads. Any later `compose build` or `up --build` fails with "lstat apps: no such file or directory". Delete the build blocks after a successful prebuilt pull so the shipped file matches what is actually runnable. Authored By: TDvorak <[email protected]> Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
11aa82b459
commit
10c667dffd
1 file changed
+7
-4
+7
-4
@@ -20,6 +20,10 @@ NGINX_PORT="${NGINX_PORT:-80}"
|
|||||||
info() { echo "==> $*"; }
|
info() { echo "==> $*"; }
|
||||||
die() { echo "ERROR: $*" >&2; exit 1; }
|
die() { echo "ERROR: $*" >&2; exit 1; }
|
||||||
|
|
||||||
|
# '|' delimiter for sed: base64 output can contain '/', '+', '='.
|
||||||
|
SED=(sed -i)
|
||||||
|
[[ "$OSTYPE" == darwin* ]] && SED=(sed -i '')
|
||||||
|
|
||||||
command -v docker >/dev/null 2>&1 || die "docker is not installed"
|
command -v docker >/dev/null 2>&1 || die "docker is not installed"
|
||||||
docker compose version >/dev/null 2>&1 || die "docker compose plugin is not installed"
|
docker compose version >/dev/null 2>&1 || die "docker compose plugin is not installed"
|
||||||
command -v curl >/dev/null 2>&1 || die "curl is not installed"
|
command -v curl >/dev/null 2>&1 || die "curl is not installed"
|
||||||
@@ -42,10 +46,6 @@ if [ ! -f .env ]; then
|
|||||||
ENCRYPTION_KEY=$(openssl rand -hex 32)
|
ENCRYPTION_KEY=$(openssl rand -hex 32)
|
||||||
DB_PASSWORD=$(openssl rand -hex 16)
|
DB_PASSWORD=$(openssl rand -hex 16)
|
||||||
|
|
||||||
# '|' delimiter: base64 output can contain '/', '+', '='.
|
|
||||||
SED=(sed -i)
|
|
||||||
[[ "$OSTYPE" == darwin* ]] && SED=(sed -i '')
|
|
||||||
|
|
||||||
"${SED[@]}" "s|^POSTGRES_PASSWORD=.*|POSTGRES_PASSWORD=$DB_PASSWORD|" .env
|
"${SED[@]}" "s|^POSTGRES_PASSWORD=.*|POSTGRES_PASSWORD=$DB_PASSWORD|" .env
|
||||||
"${SED[@]}" "s|postgres://primora:primora@|postgres://primora:$DB_PASSWORD@|" .env
|
"${SED[@]}" "s|postgres://primora:primora@|postgres://primora:$DB_PASSWORD@|" .env
|
||||||
"${SED[@]}" "s|^JWT_SECRET=.*|JWT_SECRET=$JWT_SECRET|" .env
|
"${SED[@]}" "s|^JWT_SECRET=.*|JWT_SECRET=$JWT_SECRET|" .env
|
||||||
@@ -68,6 +68,9 @@ if docker pull "ghcr.io/$GHCR_OWNER/primora-backend:latest" \
|
|||||||
&& docker pull "ghcr.io/$GHCR_OWNER/primora-auth:latest" \
|
&& docker pull "ghcr.io/$GHCR_OWNER/primora-auth:latest" \
|
||||||
&& docker pull "ghcr.io/$GHCR_OWNER/primora-frontend:latest"; then
|
&& docker pull "ghcr.io/$GHCR_OWNER/primora-frontend:latest"; then
|
||||||
info "Starting prebuilt images"
|
info "Starting prebuilt images"
|
||||||
|
# The source tree isn't downloaded on this path — strip build: blocks so a
|
||||||
|
# later `compose build`/`up --build` can't fail on missing apps/*/Dockerfile.
|
||||||
|
"${SED[@]}" '/^[[:space:]]*build:/,/^[[:space:]]*dockerfile:/d' docker-compose.yml
|
||||||
docker compose up -d --no-build
|
docker compose up -d --no-build
|
||||||
else
|
else
|
||||||
# GHCR packages are private until first published release — build from source.
|
# GHCR packages are private until first published release — build from source.
|
||||||
|
|||||||
Reference in new issue
Block a user