forked from yystopf/gitea_hat
66 lines
1.4 KiB
YAML
66 lines
1.4 KiB
YAML
version: 2
|
|
name: gitlink正式环境
|
|
description: ""
|
|
global:
|
|
concurrent: 1
|
|
trigger:
|
|
webhook: gitlink@1.0.0
|
|
event:
|
|
- ref: push
|
|
ruleset:
|
|
- param-ref: branch
|
|
operator: EQ
|
|
value: '"master"'
|
|
ruleset-operator: AND
|
|
workflow:
|
|
- ref: start
|
|
name: 开始
|
|
task: start
|
|
- ref: git_clone_0
|
|
name: git clone
|
|
on-failure: ignore
|
|
task: git_clone@1.2.6
|
|
input:
|
|
remote_url: '"https://gitlink.org.cn/Gitlink/gitea_hat.git"'
|
|
ref: '"refs/heads/master"'
|
|
commit_id: '""'
|
|
depth: 1
|
|
needs:
|
|
- start
|
|
- ref: golang_build_18_0
|
|
name: golang构建
|
|
on-failure: ignore
|
|
image: golang:1.18.1-buster
|
|
input:
|
|
workspace: git_clone_0.git_path
|
|
script:
|
|
- apt-get install git -y
|
|
- cd $WORKSPACE
|
|
- go env -w CGO_ENABLED=0
|
|
- go env -w GOPROXY=https://goproxy.cn
|
|
- go mod tidy
|
|
- go mod vendor
|
|
- GOOS=linux GOARCH=amd64 go build -o gitea main.go
|
|
- echo done
|
|
needs:
|
|
- git_clone_0
|
|
- ref: scp_resource_0
|
|
name: scp替换文件
|
|
task: scp_resource@1.4.1
|
|
input:
|
|
workspace: git_clone_0.git_path
|
|
ssh_private_key: ((ssh.siyao))
|
|
ssh_ip: '"123.59.135.93"'
|
|
ssh_port: '"51123"'
|
|
ssh_user: '"pdl"'
|
|
remote_file: '"/home/pdl"'
|
|
local_file: '$WORKSPACE/gitea'
|
|
needs:
|
|
- golang_build_18_0
|
|
- ref: end
|
|
name: 结束
|
|
task: end
|
|
needs:
|
|
- scp_resource_0
|
|
|