feat: .devops/未命名项目.yml

This commit is contained in:
a3197878436 2024-05-30 12:35:00 +00:00 committed by jianmu
parent 058576c8d6
commit 00c9dee6b8
1 changed files with 64 additions and 0 deletions

View File

@ -0,0 +1,64 @@
version: 2
name: 未命名项目
description: ""
global:
concurrent: 1
trigger:
webhook: gitlink@1.0.0
event:
- ref: pr
ruleset:
- param-ref: merged
operator: EQ
value: "true"
ruleset-operator: AND
workflow:
- ref: start
name: 开始
task: start
- ref: git_clone_0
name: git clone
task: git_clone@1.2.9
input:
remote_url: '"https://gitlink.org.cn/wuyifan/gitlink_help_center.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: ((dockerhub.username))
docker_password: ((dockerhub.password))
image_name: '"registry.cn-hangzhou.aliyuncs.com/zhanglinhao/devops-test"'
image_tag: '"latest"'
registry_address: '"registry.cn-hangzhou.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: ((ssh.password))
ssh_ip: '"120.27.216.107"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"docker stop devops-test && docker rm devops-test && docker pull
registry.cn-hangzhou.aliyuncs.com/zhanglinhao/devops-test:latest &&
docker run -p 3000:3000 --name devops-test -d
registry.cn-hangzhou.aliyuncs.com/zhanglinhao/devops-test:latest"'
needs:
- docker_image_build_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0