fix: restore shared production env during deploy
This commit is contained in:
+13
-2
@@ -3,8 +3,19 @@ set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
if [ ! -f .env ]; then
|
||||
echo "Missing .env in deployment directory"
|
||||
ENV_SOURCE="/opt/job-tracker/shared/.env"
|
||||
ENV_TARGET=".env"
|
||||
|
||||
if [ ! -f "$ENV_SOURCE" ]; then
|
||||
echo "Missing shared env file at $ENV_SOURCE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Keep runtime secrets outside the repo checkout so workflow uploads cannot wipe them.
|
||||
ln -sf "$ENV_SOURCE" "$ENV_TARGET"
|
||||
|
||||
if [ ! -f "$ENV_TARGET" ]; then
|
||||
echo "Failed to link deployment env file into $(pwd)/$ENV_TARGET"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user