diff --git a/k8s/build_and_deploy.sh b/k8s/build_and_deploy.sh index 93f329c2..44ea23fa 100755 --- a/k8s/build_and_deploy.sh +++ b/k8s/build_and_deploy.sh @@ -35,20 +35,6 @@ while getopts "b:s:e:h" opt; do esac done -valid_services=("manage-front" "manage" "front" "all" "auth" "gateway" "system") -if [[ ! " ${valid_services[@]} " =~ " $service " ]]; then - echo "Invalid service name: $service" >&2 - echo "Valid services are: ${valid_services[*]}" - exit 1 -fi - -valid_envs=("dev" "test") -if [[ ! " ${valid_envs[@]} " =~ " $env " ]]; then - echo "Invalid environment: $env" >&2 - echo "Valid environments are: ${valid_envs[*]}" - exit 1 -fi - # 拉取指定分支的最新代码 echo "Checking out and pulling branch $branch..." @@ -68,6 +54,20 @@ fi chmod +777 ${baseDir}/k8s/*.sh +valid_services=("manage-front" "manage" "front" "all" "auth" "gateway" "system") +if [[ ! " ${valid_services[@]} " =~ " $service " ]]; then + echo "Invalid service name: $service" >&2 + echo "Valid services are: ${valid_services[*]}" + exit 1 +fi + +valid_envs=("dev" "test") +if [[ ! " ${valid_envs[@]} " =~ " $env " ]]; then + echo "Invalid environment: $env" >&2 + echo "Valid environments are: ${valid_envs[*]}" + exit 1 +fi + echo "start build" sh ${baseDir}/k8s/build.sh -b ${branch} -s ${service} if [ $? -ne 0 ]; then