This commit is contained in:
2024-04-24 14:29:06 +02:00
parent 3f9e6144a5
commit 64e638535a
3 changed files with 5 additions and 248 deletions

View File

@@ -133,10 +133,11 @@ def append_stage(to, key, val, files):
"""Append a value in {to}[{key}], create the array if not existing. if the key-file is found in the files add a custom suffix"""
if not key in to:
to[key] = []
if "{basename}.yaml".format(basename=val) in files:
to[key].append("{stage}-custom".format(stage=val))
else:
to[key].append(val)
# Not possible right now
#if "{basename}.yaml".format(basename=val) in files:
# to[key].append("{stage}-custom".format(stage=val))
#else:
to[key].append(val)
def set_js_stages(stages, config, files, root_dir):

View File

@@ -158,27 +158,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-shell-custom
onError: continue
when:
- input: "lint-shell-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.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: continue
when:
@@ -193,27 +172,6 @@ spec:
value: $(tasks.detect-stages.results.file-docker)
workspaces:
- name: source
- name: lint-docker-custom
onError: continue
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: continue
when:
@@ -228,27 +186,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-yaml-custom
onError: continue
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: continue
when:
@@ -263,27 +200,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-black-custom
onError: continue
when:
- input: "lint-black-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.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: continue
when:
@@ -298,44 +214,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-python-custom
onError: continue
when:
- input: "lint-python"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.pylint-args)
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
- name: lint-custom
onError: continue
when:
- input: "lint-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-custom.yaml"
workspaces:
- name: source
- name: publish-docker
runAfter: ["lint-shell","lint-shell-custom","lint-docker","lint-docker-custom","lint-yaml","lint-yaml-custom","lint-black","lint-black-custom","lint-python","lint-python-custom","lint-custom"]
when:

View File

@@ -142,27 +142,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-shell-custom
onError: stopAndFail
when:
- input: "lint-shell-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.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: stopAndFail
when:
@@ -177,27 +156,6 @@ spec:
value: $(tasks.detect-stages.results.file-docker)
workspaces:
- name: source
- name: lint-docker-custom
onError: stopAndFail
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: stopAndFail
when:
@@ -212,27 +170,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-yaml-custom
onError: stopAndFail
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: stopAndFail
when:
@@ -247,27 +184,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-black-custom
onError: stopAndFail
when:
- input: "lint-black-custom"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.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: stopAndFail
when:
@@ -282,44 +198,6 @@ spec:
workspaces:
- name: shared-workspace
workspace: source
- name: lint-python-custom
onError: stopAndFail
when:
- input: "lint-python"
operator: in
values: ["$(params.stages[*])"]
params:
- name: args
value: $(tasks.detect-stages.results.pylint-args)
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
- name: lint-custom
onError: stopAndFail
when:
- input: "lint-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-custom.yaml"
workspaces:
- name: source
- name: publish-docker
runAfter: ["lint-shell","lint-shell-custom","lint-docker","lint-docker-custom","lint-yaml","lint-yaml-custom","lint-black","lint-black-custom","lint-python","lint-python-custom","lint-custom"]
when: