Files
domain-incoming/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-lint.yaml
2024-04-24 13:36:07 +02:00

205 lines
4.6 KiB
YAML

apiVersion: tekton.dev/v1
kind: Pipeline
metadata:
name: auto-ci-lint
spec:
workspaces:
- name: source
params:
- name: on-error
type: string
default: stopAndFail
- name: stages
type: array
- name: dockerfiles
type: array
default: []
- name: shellcheck-args
type: array
default: []
- name: black-args
type: array
default: []
- name: pylint-args
type: array
default: []
- name: git-url
type: string
- name: git-revision
type: string
tasks:
- name: lint-shell
onError: $(params.on-error)
when:
- input: "lint-shell"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(params.shellcheck-args)
taskRef:
name: shellcheck
workspaces:
- name: shared-workspace
workspace: source
- name: lint-shell-custom
onError: $(params.on-error)
when:
- input: "lint-shell-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(params.shellcheck-args)
taskRef:
resolver: git
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
- name: pathInRepo
value: ".tekton/lint-shell.yaml"
workspaces:
- name: shared-workspace
workspace: source
- name: lint-docker
onError: $(params.on-error)
when:
- input: "lint-docker"
operator: in
values: ["$(params.stages[*])"]
taskRef:
name: hadolint
matrix:
params:
- name: dockerfile-path
value: $(tasks.detect-stages.results.file-docker)
workspaces:
- name: source
- name: lint-docker-custom
onError: $(params.on-error)
when:
- input: "lint-docker-custom"
operator: in
values: ["$(params.stages[*])"]
taskRef:
resolver: git
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
- name: pathInRepo
value: ".tekton/lint-docker.yaml"
matrix:
params:
- name: dockerfile-path
value: $(tasks.detect-stages.results.file-docker)
workspaces:
- name: source
- name: lint-yaml
onError: $(params.on-error)
when:
- input: "lint-yaml"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: ["."]
taskRef:
name: yaml-lint
workspaces:
- name: shared-workspace
workspace: source
- name: lint-yaml-custom
onError: $(params.on-error)
when:
- input: "lint-yaml-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: ["."]
taskRef:
resolver: git
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
- name: pathInRepo
value: ".tekton/lint-yaml.yaml"
workspaces:
- name: shared-workspace
workspace: source
- name: lint-black
onError: $(params.on-error)
when:
- input: "lint-black"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(params.black-args)
taskRef:
name: black
workspaces:
- name: shared-workspace
workspace: source
- name: lint-black-custom
onError: $(params.on-error)
when:
- input: "lint-black-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(params.black-args)
taskRef:
resolver: git
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
- name: pathInRepo
value: ".tekton/lint-black.yaml"
workspaces:
- name: shared-workspace
workspace: source
- name: lint-python
onError: $(params.on-error)
when:
- input: "lint-python"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: ["$(tasks.detect-stages.results.file-python[*])"]
taskRef:
name: pylint
workspaces:
- name: shared-workspace
workspace: source
- name: lint-python-custom
onError: $(params.on-error)
when:
- input: "lint-python-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: ["$(tasks.detect-stages.results.file-python[*])"]
taskRef:
resolver: git
params:
- name: url
value: $(params.git-url)
- name: revision
value: $(params.git-revision)
- name: pathInRepo
value: ".tekton/lint-python.yaml"
workspaces:
- name: shared-workspace
workspace: source