readable scripts
This commit is contained in:
@@ -66,4 +66,19 @@ runs:
|
||||
)
|
||||
|
||||
ssh "${SSH_OPTS[@]}" "$DEPLOY_USER@$DEPLOY_HOST" \
|
||||
"APP_KEY=$(printf '%q' "$APP_KEY") APP_UPSTREAM_HOST=$(printf '%q' "$APP_UPSTREAM_HOST") PENDING_PORT=$(printf '%q' "$PENDING_PORT") PENDING_COLOR=$(printf '%q' "$PENDING_COLOR") AUTO_DEPLOY_PATH=$(printf '%q' "$AUTO_DEPLOY_PATH") AUTO_DEPLOY_BRANCH=$(printf '%q' "$AUTO_DEPLOY_BRANCH") bash -se -c 'cd \"\$AUTO_DEPLOY_PATH\"; git checkout \"\$AUTO_DEPLOY_BRANCH\"; git pull --ff-only; git submodule sync --recursive; git submodule update --init --recursive; echo \"[remote] auto-deploy repo updated on nginx server\"; ./common/nginx/manage-nginx.sh switch \"\$APP_KEY\" \"\$APP_UPSTREAM_HOST\" \"\$PENDING_PORT\"; echo \"[remote] nginx switched \$APP_KEY to \$APP_UPSTREAM_HOST:\$PENDING_PORT (\$PENDING_COLOR)\"'"
|
||||
"APP_KEY=$(printf '%q' "$APP_KEY") \
|
||||
APP_UPSTREAM_HOST=$(printf '%q' "$APP_UPSTREAM_HOST") \
|
||||
PENDING_PORT=$(printf '%q' "$PENDING_PORT") \
|
||||
PENDING_COLOR=$(printf '%q' "$PENDING_COLOR") \
|
||||
AUTO_DEPLOY_PATH=$(printf '%q' "$AUTO_DEPLOY_PATH") \
|
||||
AUTO_DEPLOY_BRANCH=$(printf '%q' "$AUTO_DEPLOY_BRANCH") \
|
||||
bash -se" << 'EOF'
|
||||
cd "$AUTO_DEPLOY_PATH"
|
||||
git checkout "$AUTO_DEPLOY_BRANCH"
|
||||
git pull --ff-only
|
||||
git submodule sync --recursive
|
||||
git submodule update --init --recursive
|
||||
echo "[remote] auto-deploy repo updated on nginx server"
|
||||
./common/nginx/manage-nginx.sh switch "$APP_KEY" "$APP_UPSTREAM_HOST" "$PENDING_PORT"
|
||||
echo "[remote] nginx switched $APP_KEY to $APP_UPSTREAM_HOST:$PENDING_PORT ($PENDING_COLOR)"
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user