diff --git a/share/gitea-tekton-org/auto-ci-detector.py b/share/gitea-tekton-org/auto-ci-detector.py index d225a64..62ece5d 100644 --- a/share/gitea-tekton-org/auto-ci-detector.py +++ b/share/gitea-tekton-org/auto-ci-detector.py @@ -44,7 +44,16 @@ def load_config(root_dir, ci_root_dir): """Load the configuration from the configuration directory.""" ret = { "files": [], - "languages": ["markdown", "docker", "rust", "shell", "python", "yaml", "js", "make"], + "languages": [ + "markdown", + "docker", + "rust", + "shell", + "python", + "yaml", + "js", + "make", + ], "markdown": {"extentions": ["md"], "mdl-args": ["."]}, "docker": {"extentions": ["Dockerfile"]}, "rust": {"extentions": ["rs"]}, @@ -58,16 +67,13 @@ def load_config(root_dir, ci_root_dir): "extentions": ["yaml", "yml"], "detect": True, "ansible": {"enable": False}, - "kube": {"enable": False, "kubelint-args":[""]}, + "kube": {"enable": False, "kubelint-args": [""]}, }, "js": { "extentions": ["ts", "js"], "files": ["package.json", "yarn.lock", "schema.prisma"], }, - "make": { - "files": ["Makefile"], - "checkmake-args": [] - }, + "make": {"files": ["Makefile"], "checkmake-args": []}, } if not os.path.isdir(ci_root_dir): return ret @@ -138,9 +144,9 @@ def append_stage(to, key, val, files): if not key in to: to[key] = [] # Not possible right now - #if "{basename}.yaml".format(basename=val) in files: + # if "{basename}.yaml".format(basename=val) in files: # to[key].append("{stage}-custom".format(stage=val)) - #else: + # else: to[key].append(val) @@ -236,10 +242,14 @@ def get_results(config, files, root_dir): else [] ), "kubelint-args": ( - config["yaml"]["kube"]["kubelint-args"] if "kube" in config["yaml"] and "kubelint-args" in config["yaml"]["kube"] else [] + config["yaml"]["kube"]["kubelint-args"] + if "kube" in config["yaml"] and "kubelint-args" in config["yaml"]["kube"] + else [] ), "mdl-args": ( - config["markdown"]["mdl-args"] if "mdl-args" in config["markdown"] else ["."] + config["markdown"]["mdl-args"] + if "mdl-args" in config["markdown"] + else ["."] ), "black-args": ( config["python"]["black-args"] if "black-args" in config["python"] else [] @@ -283,7 +293,7 @@ def get_results(config, files, root_dir): if "{stage}-custom.yaml" in config["files"]: stages[stage].append("{stage}-custom") # Unsupported by tekton... yet :P - #if len(stages[stage])>0: + # if len(stages[stage])>0: # append_stage(stages, "global", "on-{stage}".format(stage = stage), config["files"]) return stages, args diff --git a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml index 0eda537..df0001c 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-push.yaml @@ -265,7 +265,7 @@ spec: - name: shared-workspace workspace: source - name: publish-docker - runAfter: ["lint-make","lint-shell","lint-docker","lint-yaml","lint-black","lint-python"] + runAfter: ["lint-md","lint-kube","lint-make","lint-shell","lint-docker","lint-yaml","lint-black","lint-python"] when: - input: "publish-docker" operator: in diff --git a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-tag.yaml b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-tag.yaml index 57fa4c2..b7fc301 100644 --- a/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-tag.yaml +++ b/share/gitea-tekton-org/tekton.dev_v1_Pipeline_auto-ci-tag.yaml @@ -249,7 +249,7 @@ spec: - name: shared-workspace workspace: source - name: publish-docker - runAfter: ["lint-shell","lint-docker","lint-yaml","lint-black","lint-python"] + runAfter: ["lint-md","lint-kube","lint-make","lint-shell","lint-docker","lint-yaml","lint-black","lint-python"] when: - input: "publish-docker" operator: in