暂存提交
This commit is contained in:
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
# 复制本文件仅用于本地验证。Jenkins 中应创建“Secret file”凭据,禁止提交真实 .env。
|
||||
DEPLOY_ENV=test
|
||||
IMAGE_REPOSITORY=8.163.30.128:10082/java-project/baiyue-firstleg
|
||||
# Jenkins 部署时会覆盖为 baiyue-firstleg-test;本地手工部署可使用此默认值。
|
||||
IMAGE_REPOSITORY=baiyue-firstleg-test
|
||||
IMAGE_TAG=latest
|
||||
INFRA_NETWORK=firstleg-test-infra-network
|
||||
|
||||
|
||||
@@ -20,17 +20,23 @@ fi
|
||||
SERVICES=$(printf '%s' "$SERVICE_CSV" | tr ',' ' ')
|
||||
|
||||
export DEPLOY_ENV IMAGE_REPOSITORY IMAGE_TAG
|
||||
docker compose \
|
||||
--project-name "firstleg-${DEPLOY_ENV}" \
|
||||
--env-file "$ENV_FILE" \
|
||||
-f deploy/docker-compose.yml \
|
||||
pull $SERVICES
|
||||
|
||||
PULL_POLICY_ARGS=""
|
||||
if [ "$DEPLOY_ENV" = "test" ]; then
|
||||
PULL_POLICY_ARGS="--pull never"
|
||||
else
|
||||
docker compose \
|
||||
--project-name "firstleg-${DEPLOY_ENV}" \
|
||||
--env-file "$ENV_FILE" \
|
||||
-f deploy/docker-compose.yml \
|
||||
pull $SERVICES
|
||||
fi
|
||||
|
||||
docker compose \
|
||||
--project-name "firstleg-${DEPLOY_ENV}" \
|
||||
--env-file "$ENV_FILE" \
|
||||
-f deploy/docker-compose.yml \
|
||||
up -d --remove-orphans $SERVICES
|
||||
up -d --remove-orphans $PULL_POLICY_ARGS $SERVICES
|
||||
|
||||
docker compose \
|
||||
--project-name "firstleg-${DEPLOY_ENV}" \
|
||||
|
||||
Reference in New Issue
Block a user