fix(ci): fetch branch-specific deploy script and fix config copy paths in deploy.sh
Deploy Canina / deploy (push) Failing after 0s
Deploy Canina / deploy (push) Failing after 0s
This commit is contained in:
1 parent
5ec99155c4
commit
59babf855c
2 files changed
+11
-13
No files matched your search
@@ -17,10 +17,9 @@ jobs:
|
||||
# 1. رفع مشکل DNS
|
||||
echo "87.248.133.138 git.parsaaghayi.ir" >> /etc/hosts
|
||||
|
||||
# 2. دانلود و اجرای اسکریپت deploy.sh از داخل پوشهی scripts
|
||||
# 2. دانلود و اجرای اسکریپت deploy.sh بر اساس برنچ جاری
|
||||
mkdir -p scripts
|
||||
wget -qO scripts/deploy.sh https://git.parsaaghayi.ir/parsa/canina/raw/branch/main/scripts/deploy.sh || \
|
||||
wget -qO scripts/deploy.sh https://git.parsaaghayi.ir/parsa/canina/raw/branch/develop/scripts/deploy.sh
|
||||
wget -qO scripts/deploy.sh https://git.parsaaghayi.ir/parsa/canina/raw/branch/${BRANCH}/scripts/deploy.sh
|
||||
|
||||
chmod +x scripts/deploy.sh
|
||||
cd scripts
|
||||
|
||||
+9
-10
@@ -43,18 +43,17 @@ else
|
||||
cd -
|
||||
fi
|
||||
|
||||
# ✅ فایلهای کانفیگ را از پوشهی فعلی (scripts) به TARGET_DIR کپی میکنیم
|
||||
echo "Copying configuration files to $TARGET_DIR..."
|
||||
cp "$COMPOSE_FILE" "$TARGET_DIR/docker-compose.yml"
|
||||
sed -i 's/- REDIS_PORT: 6379/- REDIS_PORT=6379/g' "$TARGET_DIR/docker-compose.yml" 2>/dev/null || true
|
||||
cd "$TARGET_DIR"
|
||||
|
||||
# ✅ فایلهای کانفیگ را از پوشهی scripts مخزن به TARGET_DIR کپی میکنیم
|
||||
echo "Copying configuration files in $TARGET_DIR..."
|
||||
cp "scripts/$COMPOSE_FILE" "docker-compose.yml"
|
||||
sed -i 's/- REDIS_PORT: 6379/- REDIS_PORT=6379/g' "docker-compose.yml" 2>/dev/null || true
|
||||
|
||||
echo "Patching nginx.conf for environment..."
|
||||
cp nginx.conf "$TARGET_DIR/nginx.conf"
|
||||
sed -i "s/__BACKEND_HOST__/${BACKEND_HOST}/g" "$TARGET_DIR/nginx.conf"
|
||||
sed -i "s/__APP_HOST__/${APP_HOST}/g" "$TARGET_DIR/nginx.conf"
|
||||
sed -i "s/__ADMIN_HOST__/${ADMIN_HOST}/g" "$TARGET_DIR/nginx.conf"
|
||||
|
||||
cd "$TARGET_DIR"
|
||||
sed -i "s/__BACKEND_HOST__/${BACKEND_HOST}/g" "nginx.conf"
|
||||
sed -i "s/__APP_HOST__/${APP_HOST}/g" "nginx.conf"
|
||||
sed -i "s/__ADMIN_HOST__/${ADMIN_HOST}/g" "nginx.conf"
|
||||
|
||||
echo "Using Nexus npm proxy: $NPM_REGISTRY"
|
||||
NPM_REGISTRY_ARG="--build-arg NPM_REGISTRY=${NPM_REGISTRY}"
|
||||
|
||||
Reference in new issue
Block a user