feat: .devops/develop流水线.yml

This commit is contained in:
wangjing22e 2025-05-28 09:41:03 +08:00 committed by jianmu
parent 72614d142b
commit 0045e85cf2
1 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,57 @@
version: 2
name: develop流水线
description: ""
global:
concurrent: 1
workflow:
- ref: start
name: 开始
task: start
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0
- ref: git_clone_0
name: git clone
task: git_clone@1.2.9
input:
username: ((wangjing.git_username))
password: ((wangjing.git_password))
remote_url: '"https://gitlink.org.cn/wangjing22e/gitlink_help_center.git"'
ref: '"refs/heads/develop"'
commit_id: '""'
depth: 1
needs:
- start
- ref: docker_image_build_0
name: docker镜像构建
task: docker_image_build@1.6.0
input:
docker_username: ((wangjing.docker_username))
docker_password: ((wangjing.docker_password))
image_name: '"crpi-8cna9ehjfmfkjsuv.cn-shanghai.personal.cr.aliyuncs.com/software_devops/gitlink_help_center"'
image_tag: '"latest"'
registry_address: '"crpi-8cna9ehjfmfkjsuv.cn-shanghai.personal.cr.aliyuncs.com"'
docker_file: '"Dockerfile"'
docker_build_path: '"."'
workspace: git_clone_0.git_path
image_push: true
build_args: '""'
needs:
- git_clone_0
- ref: ssh_cmd_0
name: ssh执行命令
task: ssh_cmd@1.1.1
input:
ssh_pass: ((wangjing.remote_password))
ssh_ip: '"47.96.249.60"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"docker stop group4 || true && docker rm group4 || true && docker pull
crpi-8cna9ehjfmfkjsuv.cn-shanghai.personal.cr.aliyuncs.com/software_devops/gitlink_help_center:latest &&
docker run -d -p 3000:3000 --name group4
crpi-8cna9ehjfmfkjsuv.cn-shanghai.personal.cr.aliyuncs.com/software_devops/gitlink_help_center:latest"'
needs:
- docker_image_build_0