disable blue-green deployment in test environment
This commit is contained in:
@@ -348,8 +348,7 @@ deploy_local() {
|
||||
|
||||
if [ "${TARGET_IS_LOCAL:-false}" = "true" ]; then
|
||||
echo "镜像已在目标服务器本机,直接部署: $IMAGE"
|
||||
if [ "$DEPLOY_ENV" = "production" ] \
|
||||
|| { [ "$DEPLOY_ENV" = "test" ] && [ "$SERVICE" != "gateway" ] && [ "$SERVICE" != "gateway-overseas" ]; }; then
|
||||
if [ "$DEPLOY_ENV" = "production" ]; then
|
||||
printf '%s' "$REGISTRY_PASSWORD" | docker login -u "$REGISTRY_USER" --password-stdin "$REGISTRY_HOST"
|
||||
trap local_registry_logout EXIT HUP INT TERM
|
||||
docker pull "$IMAGE"
|
||||
@@ -433,8 +432,7 @@ printf '%s' "$REGISTRY_PASSWORD" | run_ssh docker login -u "$REGISTRY_USER" --pa
|
||||
trap remote_registry_logout EXIT HUP INT TERM
|
||||
run_ssh docker pull "$IMAGE"
|
||||
|
||||
if [ "$DEPLOY_ENV" = "production" ] \
|
||||
|| { [ "$DEPLOY_ENV" = "test" ] && [ "$SERVICE" != "gateway" ] && [ "$SERVICE" != "gateway-overseas" ]; }; then
|
||||
if [ "$DEPLOY_ENV" = "production" ]; then
|
||||
echo "$DEPLOY_ENV 服务使用蓝绿执行器,旧实例在候选槽健康前保持运行"
|
||||
run_ssh sh "$REMOTE_DIR/$REMOTE_BLUE_GREEN_NAME" \
|
||||
"$DEPLOY_ENV" "$IMAGE_REPOSITORY" "$IMAGE_TAG" "$SERVICE" \
|
||||
|
||||
@@ -195,7 +195,7 @@ if [ "$DEPLOY_ENV" = "test" ] || [ "$DEPLOY_ENV" = "production" ]; then
|
||||
-f "$COMPOSE_FILE" \
|
||||
pull $SERVICES
|
||||
for service in $SERVICES; do
|
||||
if [ "$DEPLOY_ENV" = test ] && { [ "$service" = gateway ] || [ "$service" = gateway-overseas ]; }; then
|
||||
if [ "$DEPLOY_ENV" = test ]; then
|
||||
docker compose --project-name "$PROJECT_NAME" --env-file "$ENV_FILE" -f "$COMPOSE_FILE" \
|
||||
up -d --no-deps --pull never "$service"
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user