forked from tektoncd/catalog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This patch splits golang-build task from the golang directory
Changes include: - moves the golang-build task to the task directory - copies and modifies readme file to golang-build task from golang directory - copies OWNERS file from golang directory - copies test directory from golang directory to golang-build task - changes the yaml filename to match the resource name Issue: tektoncd#386 Signed-off-by: Shiv Verma <[email protected]>
- Loading branch information
1 parent
5107274
commit 26f7c1c
Showing
6 changed files
with
139 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,4 @@ | ||
approvers: | ||
- vdemeester | ||
reviewers: | ||
- vdemeester |
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,49 @@ | ||
# Golang Build | ||
|
||
This Task is Golang task to build Go projects. | ||
|
||
## Install the task | ||
|
||
``` | ||
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/master/task/golang-build/0.1/golang-build.yaml | ||
``` | ||
|
||
|
||
### Parameters | ||
|
||
* **package**: base package under test | ||
* **packages**: packages to test (_default:_ ./...) | ||
* **version**: golang version to use for tests (_default:_ latest) | ||
* **flags**: flags to use for `go build` command (_default:_ -v) | ||
* **GOOS**: operating system target (_default:_ linux) | ||
* **GOARCH**: architecture target (_default:_ amd64) | ||
* **GO111MODULE**: value of module support (_default:_ auto) | ||
|
||
### Workspaces | ||
|
||
* **source**: A [Workspace](https://github.com/tektoncd/pipeline/blob/master/docs/workspaces.md) volume containing the source to build. | ||
|
||
|
||
## Usage | ||
|
||
This TaskRun runs the Task to compile commands from | ||
[`tektoncd/pipeline`](https://github.com/tektoncd/pipeline). | ||
`golangci-lint`. | ||
|
||
```yaml | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: TaskRun | ||
metadata: | ||
name: build-my-code | ||
spec: | ||
taskRef: | ||
name: golang-build | ||
workspaces: | ||
- name: source | ||
persistentVolumeClaim: | ||
claimName: my-source | ||
params: | ||
- name: package | ||
value: github.com/tektoncd/pipeline | ||
``` |
File renamed without changes.
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Add an internal registry as sidecar to the task so we can upload it directly | ||
# from our tests without having to go to an external registry. | ||
add_sidecar_registry ${TMPF} | ||
|
||
# Add git-clone | ||
kubectl -n ${tns} apply -f ./git/git-clone.yaml |
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,10 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: golang-source-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 500Mi |
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,68 @@ | ||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: Pipeline | ||
metadata: | ||
name: golang-test-pipeline | ||
spec: | ||
workspaces: | ||
- name: shared-workspace | ||
tasks: | ||
- name: fetch-repository | ||
taskRef: | ||
name: git-clone | ||
workspaces: | ||
- name: output | ||
workspace: shared-workspace | ||
params: | ||
- name: url | ||
value: https://github.com/tektoncd/pipeline | ||
- name: subdirectory | ||
value: "" | ||
- name: deleteExisting | ||
value: "true" | ||
- name: run-lint | ||
taskRef: | ||
name: golangci-lint | ||
runAfter: | ||
- fetch-repository | ||
workspaces: | ||
- name: source | ||
workspace: shared-workspace | ||
params: | ||
- name: package | ||
value: github.com/tektoncd/pipeline | ||
- name: run-build | ||
taskRef: | ||
name: golang-build | ||
runAfter: | ||
- fetch-repository | ||
workspaces: | ||
- name: source | ||
workspace: shared-workspace | ||
params: | ||
- name: package | ||
value: github.com/tektoncd/pipeline | ||
- name: run-test | ||
taskRef: | ||
name: golang-test | ||
runAfter: | ||
- fetch-repository | ||
workspaces: | ||
- name: source | ||
workspace: shared-workspace | ||
params: | ||
- name: package | ||
value: github.com/tektoncd/pipeline | ||
|
||
--- | ||
apiVersion: tekton.dev/v1beta1 | ||
kind: PipelineRun | ||
metadata: | ||
name: golang-test-pipeline-run | ||
spec: | ||
pipelineRef: | ||
name: golang-test-pipeline | ||
workspaces: | ||
- name: shared-workspace | ||
persistentvolumeclaim: | ||
claimName: golang-source-pvc |