Skip to content

Commit ba30a48

Browse files
sign resources
1 parent 837fdb7 commit ba30a48

File tree

2 files changed

+115
-112
lines changed

2 files changed

+115
-112
lines changed

task/golang-build/golang-build.yaml

+62-60
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,75 @@
11
apiVersion: tekton.dev/v1
22
kind: Task
33
metadata:
4-
name: golang-build
5-
labels:
6-
app.kubernetes.io/version: "1.0.0"
74
annotations:
8-
tekton.dev/pipelines.minVersion: "0.12.1"
9-
tekton.dev/categories: Build Tools
10-
tekton.dev/tags: build-tool
11-
tekton.dev/displayName: "golang build"
12-
tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le"
135
tekton.dev/catalog: tektoncd.golang
146
tekton.dev/catalog-support-tier: verified
157
tekton.dev/catalog-url: https://github.com/tektoncd-catalog/golang
8+
tekton.dev/categories: Build Tools
9+
tekton.dev/displayName: golang build
10+
tekton.dev/pipelines.minVersion: 0.12.1
11+
tekton.dev/platforms: linux/amd64,linux/s390x,linux/ppc64le
12+
tekton.dev/signature: MEYCIQD3SUEwqc1qbXXln+XMWd61fi5ks21FD3dEV37n/j2pzQIhAKfVG0ciLqbObDKdo5T/Y3urJ4x41v2eb3QeNIz0lCCq
13+
tekton.dev/tags: build-tool
14+
creationTimestamp: null
15+
labels:
16+
app.kubernetes.io/version: 1.0.0
17+
name: golang-build
1618
spec:
17-
description: >-
18-
This Task is Golang task to build Go projects.
19-
19+
description: This Task is Golang task to build Go projects.
2020
params:
21-
- name: package
22-
description: base package to build in
23-
- name: packages
24-
description: "packages to build (default: ./cmd/...)"
25-
default: "./cmd/..."
26-
- name: version
21+
- description: base package to build in
22+
name: package
23+
- default: ./cmd/...
24+
description: 'packages to build (default: ./cmd/...)'
25+
name: packages
26+
- default: latest
2727
description: golang version to use for builds
28-
default: "latest"
29-
- name: flags
28+
name: version
29+
- default: -v
3030
description: flags to use for the test command
31-
default: -v
32-
- name: GOOS
33-
description: "running program's operating system target"
34-
default: linux
35-
- name: GOARCH
36-
description: "running program's architecture target"
37-
default: amd64
38-
- name: GO111MODULE
39-
description: "value of module support"
40-
default: auto
41-
- name: GOCACHE
42-
description: "Go caching directory path"
43-
default: ""
44-
- name: GOMODCACHE
45-
description: "Go mod caching directory path"
46-
default: ""
47-
- name: CGO_ENABLED
48-
description: "Toggle cgo tool during Go build. Use value '0' to disable cgo (for static builds)."
49-
default: ""
50-
- name: GOSUMDB
51-
description: "Go checksum database url. Use value 'off' to disable checksum validation."
52-
default: ""
53-
workspaces:
54-
- name: source
31+
name: flags
32+
- default: linux
33+
description: running program's operating system target
34+
name: GOOS
35+
- default: amd64
36+
description: running program's architecture target
37+
name: GOARCH
38+
- default: auto
39+
description: value of module support
40+
name: GO111MODULE
41+
- default: ""
42+
description: Go caching directory path
43+
name: GOCACHE
44+
- default: ""
45+
description: Go mod caching directory path
46+
name: GOMODCACHE
47+
- default: ""
48+
description: Toggle cgo tool during Go build. Use value '0' to disable cgo (for
49+
static builds).
50+
name: CGO_ENABLED
51+
- default: ""
52+
description: Go checksum database url. Use value 'off' to disable checksum validation.
53+
name: GOSUMDB
5554
steps:
56-
- name: build
55+
- env:
56+
- name: GOOS
57+
value: $(params.GOOS)
58+
- name: GOARCH
59+
value: $(params.GOARCH)
60+
- name: GO111MODULE
61+
value: $(params.GO111MODULE)
62+
- name: GOCACHE
63+
value: $(params.GOCACHE)
64+
- name: GOMODCACHE
65+
value: $(params.GOMODCACHE)
66+
- name: CGO_ENABLED
67+
value: $(params.CGO_ENABLED)
68+
- name: GOSUMDB
69+
value: $(params.GOSUMDB)
5770
image: docker.io/library/golang:$(params.version)
58-
workingDir: $(workspaces.source.path)
71+
name: build
72+
resources: {}
5973
script: |
6074
if [ ! -e $GOPATH/src/$(params.package)/go.mod ];then
6175
SRC_PATH="$GOPATH/src/$(params.package)"
@@ -64,18 +78,6 @@ spec:
6478
cd $SRC_PATH
6579
fi
6680
go build $(params.flags) $(params.packages)
67-
env:
68-
- name: GOOS
69-
value: "$(params.GOOS)"
70-
- name: GOARCH
71-
value: "$(params.GOARCH)"
72-
- name: GO111MODULE
73-
value: "$(params.GO111MODULE)"
74-
- name: GOCACHE
75-
value: "$(params.GOCACHE)"
76-
- name: GOMODCACHE
77-
value: "$(params.GOMODCACHE)"
78-
- name: CGO_ENABLED
79-
value: "$(params.CGO_ENABLED)"
80-
- name: GOSUMDB
81-
value: "$(params.GOSUMDB)"
81+
workingDir: $(workspaces.source.path)
82+
workspaces:
83+
- name: source

task/golang-test/golang-test.yaml

+53-52
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,67 @@
11
apiVersion: tekton.dev/v1
22
kind: Task
33
metadata:
4-
name: golang-test
5-
labels:
6-
app.kubernetes.io/version: "1.0.0"
74
annotations:
8-
tekton.dev/pipelines.minVersion: "0.12.1"
9-
tekton.dev/categories: Testing
10-
tekton.dev/tags: test
11-
tekton.dev/displayName: "golang test"
12-
tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le"
135
tekton.dev/catalog: tektoncd.golang
146
tekton.dev/catalog-support-tier: verified
157
tekton.dev/catalog-url: https://github.com/tektoncd-catalog/golang
8+
tekton.dev/categories: Testing
9+
tekton.dev/displayName: golang test
10+
tekton.dev/pipelines.minVersion: 0.12.1
11+
tekton.dev/platforms: linux/amd64,linux/s390x,linux/ppc64le
12+
tekton.dev/signature: MEUCIE67H0hJ5o1jtKScgkXVAdZJWyLaSlM7yHDP19pl24O6AiEA0la1R3oc1k4G5dP0ukJS5gS2I+Djuak2OjVaUqFCnKI=
13+
tekton.dev/tags: test
14+
creationTimestamp: null
15+
labels:
16+
app.kubernetes.io/version: 1.0.0
17+
name: golang-test
1618
spec:
17-
description: >-
18-
This Task is Golang task to test Go projects.
19-
19+
description: This Task is Golang task to test Go projects.
2020
params:
21-
- name: package
22-
description: package (and its children) under test
23-
- name: packages
24-
description: "packages to test (default: ./...)"
25-
default: "./..."
26-
- name: context
21+
- description: package (and its children) under test
22+
name: package
23+
- default: ./...
24+
description: 'packages to test (default: ./...)'
25+
name: packages
26+
- default: .
2727
description: path to the directory to use as context.
28-
default: "."
29-
- name: version
28+
name: context
29+
- default: latest
3030
description: golang version to use for tests
31-
default: "latest"
32-
- name: flags
31+
name: version
32+
- default: -race -cover -v
3333
description: flags to use for the test command
34-
default: -race -cover -v
35-
- name: GOOS
36-
description: "running program's operating system target"
37-
default: linux
38-
- name: GOARCH
39-
description: "running program's architecture target"
40-
default: amd64
41-
- name: GO111MODULE
42-
description: "value of module support"
43-
default: auto
44-
- name: GOCACHE
45-
description: "Go caching directory path"
46-
default: ""
47-
- name: GOMODCACHE
48-
description: "Go mod caching directory path"
49-
default: ""
50-
workspaces:
51-
- name: source
34+
name: flags
35+
- default: linux
36+
description: running program's operating system target
37+
name: GOOS
38+
- default: amd64
39+
description: running program's architecture target
40+
name: GOARCH
41+
- default: auto
42+
description: value of module support
43+
name: GO111MODULE
44+
- default: ""
45+
description: Go caching directory path
46+
name: GOCACHE
47+
- default: ""
48+
description: Go mod caching directory path
49+
name: GOMODCACHE
5250
steps:
53-
- name: unit-test
51+
- env:
52+
- name: GOOS
53+
value: $(params.GOOS)
54+
- name: GOARCH
55+
value: $(params.GOARCH)
56+
- name: GO111MODULE
57+
value: $(params.GO111MODULE)
58+
- name: GOCACHE
59+
value: $(params.GOCACHE)
60+
- name: GOMODCACHE
61+
value: $(params.GOMODCACHE)
5462
image: docker.io/library/golang:$(params.version)
55-
workingDir: $(workspaces.source.path)
63+
name: unit-test
64+
resources: {}
5665
script: |
5766
if [ ! -e $GOPATH/src/$(params.package)/go.mod ];then
5867
SRC_PATH="$GOPATH/src/$(params.package)"
@@ -61,14 +70,6 @@ spec:
6170
cd $SRC_PATH
6271
fi
6372
go test $(params.flags) $(params.packages)
64-
env:
65-
- name: GOOS
66-
value: "$(params.GOOS)"
67-
- name: GOARCH
68-
value: "$(params.GOARCH)"
69-
- name: GO111MODULE
70-
value: "$(params.GO111MODULE)"
71-
- name: GOCACHE
72-
value: "$(params.GOCACHE)"
73-
- name: GOMODCACHE
74-
value: "$(params.GOMODCACHE)"
73+
workingDir: $(workspaces.source.path)
74+
workspaces:
75+
- name: source

0 commit comments

Comments
 (0)