gitlink-cli/.devops/wyx_gitlink_cli_build.yml

42 lines
1.6 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

version: 2
name: wyx_gitlink_cli_build
description: "master 分支收到合并后编译构建并验证新命令是否注册成功"
trigger:
webhook: gitlink@1.0.0
event:
- ref: push
ruleset-operator: AND
global:
concurrent: 1
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/jiangtx/gitlink-cli.git"'
ref: '"refs/heads/master"'
commit_id: '""'
depth: 1
needs:
- start
- ref: ssh_cmd_0
name: 编译并验证命令
task: ssh_cmd@1.1.1
input:
ssh_ip: '"121.41.212.97"'
ssh_port: '"22"'
ssh_user: '"root"'
ssh_pass: ((gitlink_cli.wyx_ssh_pass))
ssh_cmd: >-
"cd /root && rm -rf gitlink-cli && git clone --depth=1 -b master https://gitlink.org.cn/jiangtx/gitlink-cli.git && cd gitlink-cli && export PATH=$PATH:/usr/local/go/bin && export GOPROXY=https://goproxy.cn,direct && echo '>>> 编译二进制' && go build -o gitlink-cli . && echo '>>> 验证根命令' && ./gitlink-cli --help | head -20 && echo '>>> 验证 pm 模块6条命令' && ./gitlink-cli pm --help && echo '>>> 验证 wiki 模块5条命令' && ./gitlink-cli wiki --help && echo '>>> 验证 export 模块3条命令' && ./gitlink-cli export --help && echo '>>> 验证 alias 命令' && ./gitlink-cli alias --help && echo '>>> 验证 browse 命令' && ./gitlink-cli browse --help && echo '>>> 验证 status 命令' && ./gitlink-cli status && echo '✅ 所有命令验证通过'"
needs:
- git_clone_0
- ref: end
name: 结束
task: end
needs:
- ssh_cmd_0