-
Notifications
You must be signed in to change notification settings - Fork 580
/
Copy pathbuild.yaml
49 lines (49 loc) · 1.28 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
45
46
47
48
49
apiVersion: tekton.dev/v1alpha1
kind: Task
metadata:
name: golang-build
spec:
inputs:
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: "1.12"
- 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
resources:
- name: source
type: git
targetPath: src/${inputs.params.package}
steps:
- name: build
image: golang:${inputs.params.version}
workingdir: /workspace/src/${inputs.params.package}
command:
- /bin/bash
args:
- -c
- "go build ${inputs.params.flags} ${inputs.params.packages}"
env:
- name: GOPATH
value: /workspace
- name: GOOS
value: "${inputs.params.GOOS}"
- name: GOARCH
value: "${inputs.params.GOARCH}"
- name: GO111MODULE
value: "${inputs.params.GO111MODULE}"