Our great sponsors
-
reviewdog
🐶 Automated code review tool integrated with any code analysis tools regardless of programming language
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
# parameters - op: add path: /spec/params/- value: name: report-file default: reportfile description: Report file with errors - op: add path: /spec/params/- value: name: format default: golint description: Format of error input from the task - op: add path: /spec/params/- value: name: reporter default: local description: Reporter type for reviewdog https://github.com/reviewdog/reviewdog#reporters - op: add path: /spec/params/- value: name: diff default: git diff FETCH_HEAD description: Diff command https://github.com/reviewdog/reviewdog#reporters # workspaces - op: add path: /spec/workspaces/- value: name: token description: | Workspace which contains a token file for Github Pull Request comments. Must have a token file with the Github API access token # steps - op: add path: /spec/steps/- value: name: reviewdog-report image: golangci/golangci-lint:v1.31-alpine # both have the same workspace name workingDir: $(workspaces.source.path) script: | #!/bin/sh set -ue wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s -- -b $(go env GOPATH)/bin export REVIEWDOG_GITHUB_API_TOKEN=$(cat $(workspaces.token.path)/token) cat $(params.reportfile) | reviewdog -f=$(params.format) -diff="$(params.diff)"
Creating Tekton tasks is real fun! Its similiarities to pod containers, and how it works makes developing and testing super easy. Still, sometimes it is necessary to reuse a steps in multiple tasks, like when using reviewdog.
In this post we will learn how to do this very easily using kustomize, and the repo danielfbm/tekton-tasks-kustomize has ready to use example.
The most obvious way would be copying and pasting the steps, but for more complex scenarios, where there are n tasks, this becomes error prone. Using a template engine like helm could help, but learning another templating engine, plus having to change the contents of said tasks also becomes a burden. Instead, kustomize has a set of tools to make this job easier, while enjoying reutilizing tasks from the tektoncd/catalog.
The most obvious way would be copying and pasting the steps, but for more complex scenarios, where there are n tasks, this becomes error prone. Using a template engine like helm could help, but learning another templating engine, plus having to change the contents of said tasks also becomes a burden. Instead, kustomize has a set of tools to make this job easier, while enjoying reutilizing tasks from the tektoncd/catalog.