mirror of
https://github.com/tektoncd/catalog.git
synced 2024-12-01 06:43:19 +00:00
f4708d478e
At this moment all tasks which can be executed on linux/s390x or linux/ppc64le are tested and labelled accordingly. The rest of the tasks can be labelled as `linux/amd64`, which is default platform and where tasks are already tested via default PR testing cycle. Signed-off-by: Yulia Gaponenko <yulia.gaponenko1@de.ibm.com> |
||
---|---|---|
.. | ||
tests | ||
README.md | ||
ruby-lint.yaml |
Ruby Linter
The following task is used to provide static analysis on YAML files mounted using rubocop
(Ruby linter).
Installing the Task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/ruby-lint/0.1/ruby-lint.yaml
Parameters
- args: The extra params along with the file path needs to be provided as the part of
args
. (Default:["--help"]
)
Workspaces
- shared-workspace : The workspace containing files on which we want to apply linter check. It can be a shared workspace with the
git-clone
task or aConfigMap
mounted containing some files.
Platforms
The Task can be run on linux/amd64
platform.
Usage
- Create the
git-clone
task
kubectl apply -f https://raw.githubusercontent.com/tektoncd/catalog/main/task/git-clone/0.1/git-clone.yaml
-
Create the PVC
-
Apply the required tasks
-
Create the Pipeline and PipelineRun for
Ruby
linter
apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: linter-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/vinamra28/tekton-linter-test
- name: revision
value: "linter-test"
- name: subdirectory
value: ""
- name: deleteExisting
value: "true"
- name: ruby-lint-run #lint ruby script
taskRef:
name: ruby-lint
runAfter:
- fetch-repository
workspaces:
- name: shared-workspace
workspace: shared-workspace
params:
- name: args
value: ["-P", "-E", "."]
---
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: linter-pipeline-run
spec:
pipelineRef:
name: linter-pipeline
workspaces:
- name: shared-workspace
persistentvolumeclaim:
claimName: linter-pvc
NOTE: Pipeline will go into failed
state if the linter check fails.