Skip to content

Commit

Permalink
Modifies build task from golang directory according to the new reorg …
Browse files Browse the repository at this point in the history
…proposal

**NOTE: This only modifies the content of the yaml, changing
        the location of the file will be done in a different
        commit to make review easier

Changes include:
  - adds version label
  - adds a minimum pipeline versions supported by the task
  - adds tags for task
  - adds display name for task
  - modified description to add a summary

Issue: tektoncd#386

Signed-off-by: Shiv Verma <[email protected]>
  • Loading branch information
pratap0007 committed Jun 30, 2020
1 parent 9e4b0bf commit bc8334a
Showing 1 changed file with 44 additions and 35 deletions.
79 changes: 44 additions & 35 deletions golang/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,52 @@ apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: golang-build
labels:
app.kubernetes.io/version: "0.1"
annotations:
tekton.dev/pipelines.minVersion: "0.12.1"
tags: build-tool
displayName: "golang build"
spec:
description: >-
This Task is Golang task to build Go projects.
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: 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
value: "$(params.GOOS)"
description: "running program's operating system target"
default: linux
- name: GOARCH
value: "$(params.GOARCH)"
description: "running program's architecture target"
default: amd64
- name: GO111MODULE
value: "$(params.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)"

0 comments on commit bc8334a

Please sign in to comment.