Browse Source

修改部署文件部署华为云

pull/142/head
chenzhihang 1 year ago
parent
commit
d4a5b6e942
3 changed files with 22 additions and 26 deletions
  1. +0
    -19
      k8s/build.sh
  2. +16
    -1
      k8s/build_and_deploy.sh
  3. +6
    -6
      k8s/deploy.sh

+ 0
- 19
k8s/build.sh View File

@@ -41,25 +41,6 @@ fi
baseDir="/data/code/manage-platform"
cd ${baseDir}

# 拉取指定分支的最新代码
echo "Checking out and pulling branch $branch..."

git stash
git checkout $branch
if [ $? -ne 0 ]; then
echo "切换到分支 $branch 失败,请检查分支名称是否正确!"
exit 1
fi

git stash
git pull origin $branch
if [ $? -ne 0 ]; then
echo "拉取代码失败,请检查网络或联系管理员!"
exit 1
fi

chmod +777 ${baseDir}/k8s/*.sh

# 创建目录
mkdir -p ${baseDir}/k8s/dockerfiles/jar
mkdir -p ${baseDir}/k8s/dockerfiles/html


+ 16
- 1
k8s/build_and_deploy.sh View File

@@ -3,7 +3,6 @@
#记录开始时间
startTime=$(date +%s)


#build
# 默认参数
branch="master"
@@ -46,8 +45,24 @@ if [[ ! " ${valid_envs[@]} " =~ " $env " ]]; then
exit 1
fi

# 拉取指定分支的最新代码
echo "Checking out and pulling branch $branch..."

git stash
git checkout $branch
if [ $? -ne 0 ]; then
echo "切换到分支 $branch 失败,请检查分支名称是否正确!"
exit 1
fi

git stash
git pull origin $branch
if [ $? -ne 0 ]; then
echo "拉取代码失败,请检查网络或联系管理员!"
exit 1
fi

chmod +777 ${baseDir}/k8s/*.sh

# 登录到目标环境
baseDir="/data/code/manage-platform"


+ 6
- 6
k8s/deploy.sh View File

@@ -52,7 +52,7 @@ else
fi

baseDir=/data/code/manage-platform
tag=$(date +'%Y%m%d%H%M')
tag=$(date +'%Y%m%d')-arm
remote_deploy_dir=/home/deploy/manage-platform

# 构建镜像函数
@@ -143,15 +143,15 @@ fi

if [ "$service" == "all" ]; then
#部署前端
build_and_deploy "nginx-dockerfile" "172.20.32.187/ci4s/ci4s-front:${tag}" "k8s-12front.yaml"
build_and_deploy "nginx-dockerfile" "ccr.ccs.tencentyun.com/somunslotus/ci4s-front:${tag}" "k8s-12front.yaml"
#部署管理平台
build_and_deploy "managent-dockerfile" "172.20.32.187/ci4s/ci4s-managent:${tag}" "k8s-7management.yaml"
build_and_deploy "managent-dockerfile" "ccr.ccs.tencentyun.com/somunslotus/ci4s-managent:${tag}" "k8s-7management.yaml"
#部署认证中心
build_and_deploy "auth-dockerfile" "172.20.32.187/ci4s/ci4s-auth:${tag}" "k8s-5auth.yaml"
build_and_deploy "auth-dockerfile" "ccr.ccs.tencentyun.com/somunslotus/ci4s-auth:${tag}" "k8s-5auth.yaml"
#部署网关
build_and_deploy "gateway-dockerfile" "172.20.32.187/ci4s/ci4s-gateway:${tag}" "k8s-4gateway.yaml"
build_and_deploy "gateway-dockerfile" "ccr.ccs.tencentyun.com/somunslotus/ci4s-gateway:${tag}" "k8s-4gateway.yaml"
#部署系统服务
build_and_deploy "system-dockerfile" "172.20.32.187/ci4s/ci4s-system:${tag}" "k8s-6system.yaml"
build_and_deploy "system-dockerfile" "ccr.ccs.tencentyun.com/somunslotus/ci4s-system:${tag}" "k8s-6system.yaml"
#部署配置中心
deploy_nacos "k8s-3nacos.yaml"
fi


Loading…
Cancel
Save