-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created_at: 2020-11-02 16:47:44
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ======================================================== | ||
# Golang 构建参考流水线样例 | ||
# 功能:构建一个简单的 Go 程序并编译不同操作系统下的可执行环境 | ||
# ======================================================== | ||
name: build-deploy-release # 定义一个唯一 ID 标识为 gitee-go-golang-example,名称为 “Golang-流水线示例” 的流水线 | ||
displayName: '新版本发布' | ||
triggers: # 流水线触发器配置 | ||
push: # 设置 master 分支 在产生代码 push 时精确触发(PRECISE)构建 | ||
- matchType: PRECISE | ||
branch: master | ||
commitMessage: '' # 通过匹配当前提交的 CommitMessage 决定是否执行流水线 | ||
stages: # 构建阶段配置 | ||
- stage: # 定义一个 ID 标识为 golang-build-stage,名为 “Golang Stage” 的阶段 | ||
name: golang-build | ||
displayName: '编译' | ||
failFast: false # 允许快速失败,即当 Stage 中有任务失败时,直接结束整个 Stage | ||
steps: # 构建步骤配置 | ||
- step: golangbuild@1 # 采用 Golang 编译环境 | ||
name: golang-build # 定义一个 ID 标识为 golang-build ,名为 “编译” 的阶段 | ||
displayName: '编译' | ||
inputs: # 构建输入参数设定 | ||
golangVersion: 1.15 # 指定 Golang 环境版本为 1.15 | ||
goals: | # 示例脚本:创建并编译构建程序 | ||
go mod vendor | ||
make deploy |