-
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.
- Loading branch information
1 parent
4c1e3bb
commit 6812ed8
Showing
11 changed files
with
228 additions
and
20 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
.ods/ | ||
.vscode/ |
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
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
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,101 @@ | ||
apiVersion: tekton.dev/v1alpha1 | ||
kind: StepAction | ||
metadata: | ||
name: ods-pipeline-go-build | ||
spec: | ||
params: | ||
- name: working-dir | ||
description: | | ||
Working directory. The path must be relative to the root of the repository, | ||
without leading `./` and trailing `/`. | ||
type: string | ||
default: "." | ||
- name: enable-cgo | ||
description: Whether to enable CGO. When not enabled the build will set `CGO_ENABLED=0`. | ||
type: string | ||
default: "false" | ||
- name: go-os | ||
description: "`GOOS` variable (the execution operating system such as `linux`, `windows`)." | ||
type: string | ||
default: "linux" | ||
- name: go-arch | ||
description: "`GOARCH` variable (the execution architecture such as `arm`, `amd64`)." | ||
type: string | ||
default: "amd64" | ||
- name: output-dir | ||
description: >- | ||
Path to the directory into which the resulting Go binary should be copied, relative to `working-dir`. | ||
This directory may then later be used as Docker context for example. | ||
type: string | ||
default: docker | ||
- name: cache-build | ||
description: >- | ||
If enabled tasks uses or populates cache with the output dir contents (and artifacts) so that | ||
a build can be skipped if the `working-dir` contents did not change. | ||
You must set this to `"false"` if the build can be affected by files outside `working-dir`. See ADR caching-build-tasks for more details and workarounds. | ||
type: string | ||
default: "true" | ||
- name: build-extra-inputs | ||
description: >- | ||
List of build source directories (as colon separated string) which in addition working-dir influence the build. | ||
These directories are relative to the repository root. | ||
If the contents in these directories change the cache is invalidated so that the build task will rebuild from scratch. | ||
type: string | ||
default: "" | ||
- name: build-reused-from-location-path | ||
description: >- | ||
The cache location that the build task used. If caching is not enabled this will be an empty string. | ||
type: string | ||
- name: build-script | ||
description: >- | ||
Build script to execute. The | ||
link:https://github.com/opendevstack/ods-pipeline-go/blob/main/build/images/scripts/build.sh[default script] | ||
is located in the container image. If you specify a relative path | ||
instead, it will be resolved from the workspace. See the task definition | ||
for details how the build script is invoked. | ||
type: string | ||
default: "/usr/local/bin/go-build-script" | ||
- name: pre-test-script | ||
description: Script to execute before running tests, relative to the working directory. | ||
type: string | ||
default: "" | ||
- name: private-cert | ||
description: Volume mount name | ||
type: string | ||
- name: debug | ||
description: Whether to turn on debug mode | ||
type: string | ||
default: "false" | ||
- name: workspace | ||
description: Path to workspace | ||
type: string | ||
results: | ||
- description: The cache location that the build task used. If caching is not enabled this will be an empty string. | ||
name: build-reused-from-location | ||
# Image is built from build/images/Dockerfile.go-toolset. | ||
image: '{{.ImageRepository}}/go-toolset:{{.Version}}' | ||
env: | ||
- name: HOME | ||
value: '/tekton/home' | ||
- name: CI | ||
value: "true" | ||
command: [ "go-build-action" ] | ||
args: [ | ||
"-build-extra-inputs=$(params.build-extra-inputs)", | ||
"-build-reused-from-location-path=$(params.build-reused-from-location-path)", | ||
"-build-script=$(params.build-script)", | ||
"-cache-build=$(params.cache-build)", | ||
"-debug=$(params.debug)", | ||
"-enable-cgo=$(params.enable-cgo)", | ||
"-go-os=$(params.go-os)", | ||
"-go-arch=$(params.go-arch)", | ||
"-output-dir=$(params.output-dir)", | ||
"-pre-test-script=$(params.pre-test-script)", | ||
"-working-dir=$(params.working-dir)", | ||
] | ||
volumeMounts: | ||
- mountPath: /etc/ssl/certs/private-cert.pem | ||
name: $(params.private-cert) | ||
readOnly: true | ||
subPath: tls.crt | ||
workingDir: $(params.workspace) |
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
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,90 @@ | ||
// File is generated; DO NOT EDIT. | ||
|
||
= ods-pipeline-go-build | ||
|
||
|
||
|
||
== Parameters | ||
|
||
[cols="1,1,2"] | ||
|=== | ||
| Parameter | Default | Description | ||
|
||
| working-dir | ||
| . | ||
| Working directory. The path must be relative to the root of the repository, | ||
without leading `./` and trailing `/`. | ||
|
||
|
||
|
||
| enable-cgo | ||
| false | ||
| Whether to enable CGO. When not enabled the build will set `CGO_ENABLED=0`. | ||
|
||
|
||
| go-os | ||
| linux | ||
| `GOOS` variable (the execution operating system such as `linux`, `windows`). | ||
|
||
|
||
| go-arch | ||
| amd64 | ||
| `GOARCH` variable (the execution architecture such as `arm`, `amd64`). | ||
|
||
|
||
| output-dir | ||
| docker | ||
| Path to the directory into which the resulting Go binary should be copied, relative to `working-dir`. This directory may then later be used as Docker context for example. | ||
|
||
|
||
| cache-build | ||
| true | ||
| If enabled tasks uses or populates cache with the output dir contents (and artifacts) so that a build can be skipped if the `working-dir` contents did not change. You must set this to `"false"` if the build can be affected by files outside `working-dir`. See ADR caching-build-tasks for more details and workarounds. | ||
|
||
|
||
| build-extra-inputs | ||
| | ||
| List of build source directories (as colon separated string) which in addition working-dir influence the build. These directories are relative to the repository root. If the contents in these directories change the cache is invalidated so that the build task will rebuild from scratch. | ||
|
||
|
||
| build-reused-from-location-path | ||
| | ||
| The cache location that the build task used. If caching is not enabled this will be an empty string. | ||
|
||
|
||
| build-script | ||
| /usr/local/bin/go-build-script | ||
| Build script to execute. The link:https://github.com/opendevstack/ods-pipeline-go/blob/main/build/images/scripts/build.sh[default script] is located in the container image. If you specify a relative path instead, it will be resolved from the workspace. See the task definition for details how the build script is invoked. | ||
|
||
|
||
| pre-test-script | ||
| | ||
| Script to execute before running tests, relative to the working directory. | ||
|
||
|
||
| private-cert | ||
| | ||
| Volume mount name | ||
|
||
|
||
| debug | ||
| false | ||
| Whether to turn on debug mode | ||
|
||
|
||
| workspace | ||
| | ||
| Path to workspace | ||
|
||
|=== | ||
|
||
== Results | ||
|
||
[cols="1,3"] | ||
|=== | ||
| Name | Description | ||
|
||
| build-reused-from-location | ||
| The cache location that the build task used. If caching is not enabled this will be an empty string. | ||
|
||
|=== |
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
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
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
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
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