-
Notifications
You must be signed in to change notification settings - Fork 579
/
build.yaml
44 lines (44 loc) · 1.13 KB
/
build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: golang-build
spec:
params:
- name: package
description: base package to build in
- name: packages
description: "packages to build (default: ./cmd/...)"
default: "./cmd/..."
- name: version
description: golang version to use for builds
default: "latest"
- name: flags
description: flags to use for the test command
default: -v
- name: GOOS
description: "running program's operating system target"
default: linux
- name: GOARCH
description: "running program's architecture target"
default: amd64
- name: GO111MODULE
description: "value of module support"
default: auto
workspaces:
- name: source
mountPath: /workspace/src/$(params.package)
steps:
- name: build
image: golang:$(params.version)
workingDir: $(workspaces.source.path)
script: |
go build $(params.flags) $(params.packages)
env:
- name: GOPATH
value: /workspace
- name: GOOS
value: "$(params.GOOS)"
- name: GOARCH
value: "$(params.GOARCH)"
- name: GO111MODULE
value: "$(params.GO111MODULE)"