You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
1.7 KiB
79 lines
1.7 KiB
2 years ago
|
apiVersion: tekton.dev/v1beta1
|
||
|
kind: Task
|
||
|
metadata:
|
||
|
name: pre-do
|
||
|
labels:
|
||
|
app.kubernetes.io/version: "0.1"
|
||
|
annotations:
|
||
|
tekton.dev/pipelines.minVersion: "0.38.0"
|
||
|
tekton.dev/categories: Shell
|
||
|
tekton.dev/tags: shell
|
||
|
tekton.dev/displayName: "pre do something"
|
||
|
tekton.dev/platforms: "linux/amd64,linux/s390x,linux/ppc64le,linux/arm64"
|
||
|
spec:
|
||
|
description: >-
|
||
|
Pre do something
|
||
|
workspaces:
|
||
|
- name: source
|
||
|
description: Store source code
|
||
|
params:
|
||
|
- name: version
|
||
|
description: Code version
|
||
|
type: string
|
||
|
results:
|
||
|
- name: version
|
||
|
description: The precise commit SHA that was fetched by this Task.
|
||
|
stepTemplate:
|
||
|
workingDir: $(workspaces.source.path)
|
||
|
securityContext:
|
||
|
runAsUser: 0
|
||
|
steps:
|
||
|
- name: download
|
||
|
image: golang:1.18
|
||
|
script: |
|
||
|
#!/usr/bin/env sh
|
||
|
GOPROXY=https://goproxy.cn
|
||
|
go mod download
|
||
|
go mod vendor
|
||
|
- name: static-check
|
||
|
image: golang:1.18
|
||
|
command:
|
||
|
- "go"
|
||
|
args:
|
||
|
- "vet"
|
||
|
- "./..."
|
||
|
- name: generate
|
||
|
image: golang:1.18
|
||
|
command:
|
||
|
- "make"
|
||
|
args:
|
||
|
- "generate"
|
||
|
- name: manifests
|
||
|
image: golang:1.18
|
||
|
command:
|
||
|
- "make"
|
||
|
args:
|
||
|
- "manifests"
|
||
|
- name: test
|
||
|
image: golang:1.18
|
||
|
command:
|
||
|
- "go"
|
||
|
args:
|
||
|
- "test"
|
||
|
- "./..."
|
||
|
- name: build
|
||
|
image: golang:1.18
|
||
|
command:
|
||
|
- "go"
|
||
|
args:
|
||
|
- "build"
|
||
|
- "-o"
|
||
|
- "bin/manager"
|
||
|
- "main.go"
|
||
|
- name: recover-own
|
||
|
image: golang:1.18
|
||
|
script: |
|
||
|
#!/usr/bin/env sh
|
||
|
set -eu
|
||
|
chown 65532:65532 -R $(workspaces.source.path)
|