Files
probably-rendering-one-more…/scripts/infra.sh
T
codex-bot 818b1894e7
PROMPT Docker CI and deployment / verify-and-deploy (push) Successful in 14m10s
Run the complete PROMPT stack and CI verification in Docker
2026-10-23 00:19:08 +08:00

13 lines
596 B
Bash

#!/usr/bin/env bash
set -Eeuo pipefail
IMAGE="${1:?Application image is required}"
# Preserve existing credentials and Docker project/volume names during migration.
if [ ! -f /etc/prompt.env ]; then
umask 077
TEMP_ENV=$(mktemp /etc/prompt.env.XXXXXX)
trap 'rm -f "$TEMP_ENV"' EXIT
docker run --rm --entrypoint node "$IMAGE" -e "const {randomBytes}=require('crypto');const hex=()=>randomBytes(32).toString('hex');console.log('POSTGRES_PASSWORD='+hex()+'\nS3_ACCESS_KEY='+hex()+'\nS3_SECRET_KEY='+hex()+'\nS3_BUCKET=prompt')" > "$TEMP_ENV"
mv "$TEMP_ENV" /etc/prompt.env
trap - EXIT
fi