feat: .devops/test.yml

This commit is contained in:
SheYuWu03 2024-06-25 04:15:46 +00:00 committed by jianmu
parent c8abeb9520
commit 0b14ed7a0f
1 changed files with 61 additions and 0 deletions

61
.devops/test.yml Normal file
View File

@ -0,0 +1,61 @@
version: 2
name: test
description: ""
global:
concurrent: 1
trigger:
webhook: gitlink@1.0.0
event:
- ref: pr
ruleset:
- param-ref: target_branch
operator: EQ
value: '"master"'
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/SheYuWu03/reposync.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:
image_name: '"registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center"'
image_tag: '"latest"'
registry_address: '"registry.cn-guangzhou.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_ip: '"116.62.120.115"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_cmd: '"docker stop ghc_group6 && docker rm ghc_group6 && docker pull
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest
&& docker run -d -p 3000:3000 --name ghc_group6
registry.cn-guangzhou.aliyuncs.com/nudt_devops/gitlink_help_center_group6:latest"'
needs:
- docker_image_build_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0