fix ci/cd bug
Signed-off-by: jagger <cossjie@foxmail.com> Former-commit-id: 21e0db72fa6fcbb8bba2b649b9c0002d1e69c864
This commit is contained in:
parent
dc59be8eba
commit
7aff254442
|
@ -1,87 +0,0 @@
|
||||||
version: 2
|
|
||||||
name: api
|
|
||||||
description: ""
|
|
||||||
global:
|
|
||||||
concurrent: 1
|
|
||||||
param:
|
|
||||||
- ref: deploy_path
|
|
||||||
name: deploy_path
|
|
||||||
value: '"pcm-coordinator-api.yaml"'
|
|
||||||
required: false
|
|
||||||
type: STRING
|
|
||||||
hidden: false
|
|
||||||
- ref: secret_name
|
|
||||||
name: ""
|
|
||||||
value: '"jcce-aliyuncs"'
|
|
||||||
required: false
|
|
||||||
type: STRING
|
|
||||||
hidden: false
|
|
||||||
- ref: project_name
|
|
||||||
name: ""
|
|
||||||
value: '"pcm-coordinator-api"'
|
|
||||||
required: false
|
|
||||||
type: STRING
|
|
||||||
hidden: false
|
|
||||||
trigger:
|
|
||||||
webhook: gitlink@1.0.0
|
|
||||||
event:
|
|
||||||
- ref: create_tag
|
|
||||||
ruleset:
|
|
||||||
- param-ref: tag
|
|
||||||
operator: EQ
|
|
||||||
value: '""'
|
|
||||||
ruleset-operator: AND
|
|
||||||
workflow:
|
|
||||||
- ref: start
|
|
||||||
name: 开始
|
|
||||||
task: start
|
|
||||||
- ref: git_clone_0
|
|
||||||
name: git clone
|
|
||||||
task: git_clone@1.2.6
|
|
||||||
input:
|
|
||||||
remote_url: '"https://gitlink.org.cn/JointCloud/pcm-coordinator.git"'
|
|
||||||
ref: '"refs/heads/master"'
|
|
||||||
commit_id: '""'
|
|
||||||
depth: 1
|
|
||||||
needs:
|
|
||||||
- start
|
|
||||||
- ref: docker_image_build_0
|
|
||||||
name: docker镜像构建
|
|
||||||
task: docker_image_build@1.6.0
|
|
||||||
input:
|
|
||||||
docker_username: ((dev.docker_user))
|
|
||||||
docker_password: ((dev.docker_password))
|
|
||||||
image_name: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-core-api"'
|
|
||||||
image_tag: '"latest"'
|
|
||||||
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
|
|
||||||
docker_file: git_clone_0.git_path + '/Dockerfile'
|
|
||||||
docker_build_path: git_clone_0.git_path
|
|
||||||
workspace: git_clone_0.git_path
|
|
||||||
image_clean: true
|
|
||||||
image_push: true
|
|
||||||
build_args: '""'
|
|
||||||
no_cache: true
|
|
||||||
needs:
|
|
||||||
- shell_0
|
|
||||||
- ref: end
|
|
||||||
name: 结束
|
|
||||||
task: end
|
|
||||||
needs:
|
|
||||||
- docker_image_build_0
|
|
||||||
- ref: shell_0
|
|
||||||
name: shell
|
|
||||||
image: docker.jianmuhub.com/library/debian:buster-slim
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-core-api"'
|
|
||||||
IMAGE_TAG: git_clone_0.commit_time
|
|
||||||
SECRET_NAME: global.secret_name
|
|
||||||
PROJECT_NAME: global.project_name
|
|
||||||
PROJECT_PATH: git_clone_0.git_path
|
|
||||||
script:
|
|
||||||
- cd ${PROJECT_PATH}/api
|
|
||||||
- sed -i "s#image_name#${IMAGE_NAME}:${IMAGE_TAG}#" ${PROJECT_NAME}.yaml
|
|
||||||
- sed -i "s#secret_name#${SECRET_NAME}#" ${PROJECT_NAME}.yaml
|
|
||||||
- cat ${PROJECT_NAME}.yaml
|
|
||||||
needs:
|
|
||||||
- git_clone_0
|
|
||||||
|
|
|
@ -1,12 +1,30 @@
|
||||||
version: 2
|
version: 2
|
||||||
name: build
|
name: 阿里云
|
||||||
description: ""
|
description: ""
|
||||||
global:
|
global:
|
||||||
concurrent: 1
|
concurrent: 1
|
||||||
|
param:
|
||||||
|
- ref: ssh_host
|
||||||
|
name: ""
|
||||||
|
value: '"47.92.39.128"'
|
||||||
|
required: false
|
||||||
|
type: STRING
|
||||||
|
hidden: true
|
||||||
|
- ref: ssh_user
|
||||||
|
name: ""
|
||||||
|
value: '"root"'
|
||||||
|
required: false
|
||||||
|
type: STRING
|
||||||
|
hidden: true
|
||||||
workflow:
|
workflow:
|
||||||
- ref: start
|
- ref: start
|
||||||
name: 开始
|
name: 开始
|
||||||
task: start
|
task: start
|
||||||
|
- ref: end
|
||||||
|
name: 结束
|
||||||
|
task: end
|
||||||
|
needs:
|
||||||
|
- ssh_cmd_0
|
||||||
- ref: git_clone_0
|
- ref: git_clone_0
|
||||||
name: git clone
|
name: git clone
|
||||||
task: git_clone@1.2.9
|
task: git_clone@1.2.9
|
||||||
|
@ -21,12 +39,12 @@ workflow:
|
||||||
name: docker镜像构建
|
name: docker镜像构建
|
||||||
task: docker_image_build@1.6.0
|
task: docker_image_build@1.6.0
|
||||||
input:
|
input:
|
||||||
docker_username: ((dev.docker_user))
|
docker_username: ((aly.docker_user))
|
||||||
docker_password: ((dev.docker_password))
|
docker_password: ((aly.docker_password))
|
||||||
image_name: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-core"'
|
image_name: '"registry.cn-hangzhou.aliyuncs.com/jcce/pcm-core-api"'
|
||||||
image_tag: '"latest"'
|
image_tag: '"latest"'
|
||||||
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
|
registry_address: '"registry.cn-hangzhou.aliyuncs.com"'
|
||||||
docker_file: git_clone_0.git_path+"/Dockerfile"
|
docker_file: '"Dockerfile"'
|
||||||
docker_build_path: git_clone_0.git_path
|
docker_build_path: git_clone_0.git_path
|
||||||
workspace: git_clone_0.git_path
|
workspace: git_clone_0.git_path
|
||||||
image_push: true
|
image_push: true
|
||||||
|
@ -37,16 +55,11 @@ workflow:
|
||||||
name: ssh执行命令
|
name: ssh执行命令
|
||||||
task: ssh_cmd@1.1.1
|
task: ssh_cmd@1.1.1
|
||||||
input:
|
input:
|
||||||
ssh_private_key: ((dev.gitlink_ssheky))
|
ssh_private_key: ((aly.ssh_private_key))
|
||||||
ssh_ip: '"47.92.39.128"'
|
ssh_ip: global.ssh_host
|
||||||
ssh_port: '"22"'
|
ssh_port: '"22"'
|
||||||
ssh_user: '"root"'
|
ssh_user: global.ssh_user
|
||||||
ssh_cmd: '"kubectl rollout restart deployment -n ns-admin pcm-core-api"'
|
ssh_cmd: '"kubectl rollout restart deployment pcm-core-api -n ns-admin"'
|
||||||
needs:
|
needs:
|
||||||
- docker_image_build_0
|
- docker_image_build_0
|
||||||
- ref: end
|
|
||||||
name: 结束
|
|
||||||
task: end
|
|
||||||
needs:
|
|
||||||
- ssh_cmd_0
|
|
||||||
|
|
Loading…
Reference in New Issue