1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-22 06:02:51 +00:00
catalog/task/check-make/0.1
vinamra28 d65ed39437 Use git-clone 0.7 instead of latest in Tasks' test
With git-clone version 0.8, Task now runs as non-root and with this change I
guess it's not working well with our GKE clusters and tests started
failing in nightly runs.

For now changing the version of git-clone to use 0.7 so that for now CI
is unblocked 😅

Signed-off-by: vinamra28 <jvinamra776@gmail.com>
2022-09-27 15:05:12 +02:00
..
tests Use git-clone 0.7 instead of latest in Tasks' test 2022-09-27 15:05:12 +02:00
check-make.yaml Add linux/amd64 platform annotation to the rest of the tasks 2021-10-29 17:08:38 +01:00
README.md [TEP-0110] Update Tekton Catalog installation instructions 2022-08-16 16:25:52 +01:00

Makefile Linter

The following task is used to provide static analysis on YAML files mounted using checkmake (Makefile linter).

Installing the Task

kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/check-make/0.1/raw

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 a ConfigMap mounted containing some files.

Platforms

The Task can be run on linux/amd64 platform.

Usage

  1. Create the git-clone task
kubectl apply -f https://api.hub.tekton.dev/v1/resource/tekton/task/git-clone/0.1/raw
  1. Create the PVC

  2. Apply the required tasks

  3. Create the Pipeline and PipelineRun for Makefile 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: check-make-run #lint Makefile
      taskRef:
        name: check-make
      runAfter:
        - fetch-repository
      workspaces:
        - name: shared-workspace
          workspace: shared-workspace
      params:
        - name: args
          value: ["Makefile"]

---
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.