1
0
mirror of https://github.com/tektoncd/catalog.git synced 2024-11-23 06:08:46 +00:00

Linting yamls with yamllint 🏷

Next update of plumbing will enable `yamllint` check, so this make
sure we have linted yaml before 👼

Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
This commit is contained in:
Vincent Demeester 2019-11-08 17:23:24 +01:00 committed by tekton-robot
parent a2c1c09bfc
commit 5c2ab7d6c3
18 changed files with 100 additions and 67 deletions

35
.yamllint Normal file
View File

@ -0,0 +1,35 @@
ignore: |
/vendor
rules:
braces: enable
brackets: enable
colons: enable
commas: enable
comments:
level: warning
comments-indentation:
level: warning
document-end: disable
document-start: disable
empty-lines: enable
empty-values: enable
hyphens: enable
key-duplicates: enable
key-ordering: disable
line-length: disable
new-line-at-end-of-file: disable
new-lines: enable
octal-values: enable
quoted-strings: disable
trailing-spaces: enable
truthy:
level: warning
# accept both key:
# - item
#
# and key:
# - item
indentation:
indent-sequences: whatever

View File

@ -25,13 +25,13 @@ spec:
steps: steps:
- name: config - name: config
image: quay.io/rcmendes/ansible-tower-cli:latest image: quay.io/rcmendes/ansible-tower-cli:latest
command: command:
- '/bin/sh' - '/bin/sh'
- '-c' - '-c'
args: args:
- |- - |-
echo -e "verify_ssl = $(inputs.params.SSLVERIFY)\nverbose = true\nhost = $(inputs.params.HOST)\nusername = $USER\npassword = $PASS" > ~/.tower_cli.cfg echo -e "verify_ssl = $(inputs.params.SSLVERIFY)\nverbose = true\nhost = $(inputs.params.HOST)\nusername = $USER\npassword = $PASS" > ~/.tower_cli.cfg
chmod 600 ~/.tower_cli.cfg chmod 600 ~/.tower_cli.cfg
echo "Generated tower_cli.cfg file" echo "Generated tower_cli.cfg file"
echo "-----------------------------" echo "-----------------------------"
ls -lah ~/ | grep tower_cli ls -lah ~/ | grep tower_cli
@ -39,12 +39,12 @@ spec:
env: env:
- name: USER - name: USER
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: $(inputs.params.tower-secret) name: $(inputs.params.tower-secret)
key: USER key: USER
- name: PASS - name: PASS
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: $(inputs.params.tower-secret) name: $(inputs.params.tower-secret)
key: PASS key: PASS
- name: tower-cli - name: tower-cli
@ -52,4 +52,3 @@ spec:
command: ["/usr/bin/tower-cli"] command: ["/usr/bin/tower-cli"]
args: args:
- "$(inputs.params.ARGS)" - "$(inputs.params.ARGS)"

View File

@ -17,9 +17,9 @@ spec:
stepTemplate: stepTemplate:
envFrom: envFrom:
- configMapRef: - configMapRef:
name: argocd-env-configmap # used for server address name: argocd-env-configmap # used for server address
- secretRef: - secretRef:
name: argocd-env-secret # used for authentication (username/password or auth token) name: argocd-env-secret # used for authentication (username/password or auth token)
steps: steps:
- name: login - name: login
image: argoproj/argocd:$(inputs.params.argocd-version) image: argoproj/argocd:$(inputs.params.argocd-version)

View File

@ -1,3 +1,4 @@
---
apiVersion: tekton.dev/v1alpha1 apiVersion: tekton.dev/v1alpha1
kind: Task kind: Task
metadata: metadata:

View File

@ -10,8 +10,8 @@ spec:
default: "Dockerfile" default: "Dockerfile"
- name: BUILDKIT_IMAGE - name: BUILDKIT_IMAGE
description: The name of the BuildKit image description: The name of the BuildKit image
# The image needs to be rootful because Tekton creates /builder/home/.docker/config.json owned by root:root with 0600 # The image needs to be rootful because Tekton creates /builder/home/.docker/config.json owned by root:root with 0600
# https://github.com/tektoncd/pipeline/issues/852 # https://github.com/tektoncd/pipeline/issues/852
default: "moby/buildkit:v0.6.2" default: "moby/buildkit:v0.6.2"
resources: resources:
- name: source - name: source

View File

@ -38,7 +38,7 @@ spec:
readOnly: true readOnly: true
mountPath: /certs mountPath: /certs
volumes: volumes:
# buildkit-daemon-certs must contain ca.pem, cert.pem, and key.pem # buildkit-daemon-certs must contain ca.pem, cert.pem, and key.pem
- name: certs - name: certs
secret: secret:
secretName: buildkit-daemon-certs secretName: buildkit-daemon-certs

View File

@ -17,7 +17,7 @@ spec:
annotations: annotations:
container.apparmor.security.beta.kubernetes.io/buildkitd: unconfined container.apparmor.security.beta.kubernetes.io/buildkitd: unconfined
container.seccomp.security.alpha.kubernetes.io/buildkitd: unconfined container.seccomp.security.alpha.kubernetes.io/buildkitd: unconfined
# see buildkit/docs/rootless.md for caveats of rootless mode # see buildkit/docs/rootless.md for caveats of rootless mode
spec: spec:
containers: containers:
- name: buildkitd - name: buildkitd
@ -35,7 +35,7 @@ spec:
- /certs/key.pem - /certs/key.pem
- --oci-worker-no-process-sandbox - --oci-worker-no-process-sandbox
securityContext: securityContext:
# To change UID/GID, you need to rebuild the image # To change UID/GID, you need to rebuild the image
runAsUser: 1000 runAsUser: 1000
runAsGroup: 1000 runAsGroup: 1000
ports: ports:
@ -45,7 +45,7 @@ spec:
readOnly: true readOnly: true
mountPath: /certs mountPath: /certs
volumes: volumes:
# buildkit-daemon-certs must contain ca.pem, cert.pem, and key.pem # buildkit-daemon-certs must contain ca.pem, cert.pem, and key.pem
- name: certs - name: certs
secret: secret:
secretName: buildkit-daemon-certs secretName: buildkit-daemon-certs

View File

@ -10,8 +10,8 @@ spec:
default: "Dockerfile" default: "Dockerfile"
- name: BUILDKIT_CLIENT_IMAGE - name: BUILDKIT_CLIENT_IMAGE
description: The name of the BuildKit client (buildctl) image description: The name of the BuildKit client (buildctl) image
# The image needs to be rootful because Tekton creates /builder/home/.docker/config.json owned by root:root with 0600 # The image needs to be rootful because Tekton creates /builder/home/.docker/config.json owned by root:root with 0600
# https://github.com/tektoncd/pipeline/issues/852 # https://github.com/tektoncd/pipeline/issues/852
default: "moby/buildkit:v0.6.2" default: "moby/buildkit:v0.6.2"
- name: BUILDKIT_DAEMON_ADDRESS - name: BUILDKIT_DAEMON_ADDRESS
description: The address of the BuildKit daemon (buildkitd) service description: The address of the BuildKit daemon (buildkitd) service

View File

@ -58,7 +58,7 @@ spec:
volumeMounts: volumeMounts:
- name: "layers-dir" - name: "layers-dir"
mountPath: /layers mountPath: /layers
- name: restore - name: restore
image: $(inputs.params.BUILDER_IMAGE) image: $(inputs.params.BUILDER_IMAGE)
imagePullPolicy: Always imagePullPolicy: Always

View File

@ -29,6 +29,6 @@ spec:
- $(inputs.params.files) - $(inputs.params.files)
- -p - -p
- $(inputs.params.policy) - $(inputs.params.policy)
- -o - -o
- $(inputs.params.output) - $(inputs.params.output)
- $(inputs.params.args) - $(inputs.params.args)

View File

@ -29,6 +29,6 @@ spec:
- $(inputs.params.chart) - $(inputs.params.chart)
- -p - -p
- $(inputs.params.policy) - $(inputs.params.policy)
- -o - -o
- $(inputs.params.output) - $(inputs.params.output)
- $(inputs.params.args) - $(inputs.params.args)

View File

@ -11,7 +11,7 @@ spec:
description: flags to use for the test command description: flags to use for the test command
default: --verbose default: --verbose
- name: version - name: version
default: golangci-lint version to use description: golangci-lint version to use
default: "v1.17.1" default: "v1.17.1"
- name: GOOS - name: GOOS
description: "running operating system target" description: "running operating system target"

View File

@ -35,5 +35,5 @@ spec:
- /kaniko/executor - /kaniko/executor
- $(inputs.params.EXTRA_ARGS) - $(inputs.params.EXTRA_ARGS)
- --dockerfile=$(inputs.params.DOCKERFILE) - --dockerfile=$(inputs.params.DOCKERFILE)
- --context=/workspace/source/$(inputs.params.CONTEXT) # The user does not need to care the workspace and the source. - --context=/workspace/source/$(inputs.params.CONTEXT) # The user does not need to care the workspace and the source.
- --destination=$(outputs.resources.image.url) - --destination=$(outputs.resources.image.url)

View File

@ -13,7 +13,7 @@ spec:
steps: steps:
# the first step is required as knctl doesn't support inCluster configuration. # the first step is required as knctl doesn't support inCluster configuration.
- name: kubeconfig - name: kubeconfig
image: gcr.io/cloud-builders/kubectl # it is huge image: gcr.io/cloud-builders/kubectl # it is huge
command: ["/bin/bash"] command: ["/bin/bash"]
args: args:
- -c - -c

View File

@ -25,6 +25,6 @@ spec:
- kubeval - kubeval
- -d - -d
- $(inputs.params.files) - $(inputs.params.files)
- -o - -o
- $(inputs.params.output) - $(inputs.params.output)
- $(inputs.params.args) - $(inputs.params.args)

View File

@ -44,52 +44,51 @@ spec:
type: image type: image
steps: steps:
- name: add-ow-env-to-dockerfile - name: add-ow-env-to-dockerfile
image: ubuntu image: ubuntu
command: command:
- bash - bash
args: args:
- -c - -c
- | - |
if [ -z $(inputs.params.OW_PROJECT_URL) ]; then if [ -z $(inputs.params.OW_PROJECT_URL) ]; then
OW_ACTION_CODE="$(inputs.params.OW_ACTION_CODE)" OW_ACTION_CODE="$(inputs.params.OW_ACTION_CODE)"
else
TEMPDIR="knative-"$((1 + RANDOM % 100))
TEMPFILE=`basename "$(inputs.params.OW_PROJECT_URL)"`
mkdir $TEMPDIR
cd $TEMPDIR
wget -O $TEMPFILE "$(inputs.params.OW_PROJECT_URL)"
if [ "$(inputs.params.OW_ACTION_BINARY)" = true ]; then
OW_ACTION_CODE=`base64 $TEMPFILE | tr -d '[:space:]'`
else else
TEMPDIR="knative-"$((1 + RANDOM % 100)) OW_ACTION_CODE=`cat $TEMPFILE`
TEMPFILE=`basename "$(inputs.params.OW_PROJECT_URL)"`
mkdir $TEMPDIR
cd $TEMPDIR
wget -O $TEMPFILE "$(inputs.params.OW_PROJECT_URL)"
if [ "$(inputs.params.OW_ACTION_BINARY)" = true ]; then
OW_ACTION_CODE=`base64 $TEMPFILE | tr -d '[:space:]'`
else
OW_ACTION_CODE=`cat $TEMPFILE`
fi
cd ..
fi fi
cat <<EOF >> $(inputs.params.DOCKERFILE) cd ..
ENV __OW_RUNTIME_DEBUG "$(inputs.params.OW_RUNTIME_DEBUG)" fi
ENV __OW_RUNTIME_PLATFORM "$(inputs.params.OW_RUNTIME_PLATFORM)" cat <<EOF >> $(inputs.params.DOCKERFILE)
ENV __OW_ACTION_NAME "$(inputs.params.OW_ACTION_NAME)" ENV __OW_RUNTIME_DEBUG "$(inputs.params.OW_RUNTIME_DEBUG)"
ENV __OW_ACTION_CODE "$(OW_ACTION_CODE)" ENV __OW_RUNTIME_PLATFORM "$(inputs.params.OW_RUNTIME_PLATFORM)"
ENV __OW_ACTION_MAIN "$(inputs.params.OW_ACTION_MAIN)" ENV __OW_ACTION_NAME "$(inputs.params.OW_ACTION_NAME)"
ENV __OW_ACTION_BINARY "$(inputs.params.OW_ACTION_BINARY)" ENV __OW_ACTION_CODE "$(OW_ACTION_CODE)"
ENV __OW_HTTP_METHODS "$(inputs.params.OW_HTTP_METHODS)" ENV __OW_ACTION_MAIN "$(inputs.params.OW_ACTION_MAIN)"
ENV __OW_ACTION_RAW "$(inputs.params.OW_ACTION_RAW)" ENV __OW_ACTION_BINARY "$(inputs.params.OW_ACTION_BINARY)"
ENV __OW_PROJECT_URL "$(inputs.params.OW_PROJECT_URL)" ENV __OW_HTTP_METHODS "$(inputs.params.OW_HTTP_METHODS)"
EOF ENV __OW_ACTION_RAW "$(inputs.params.OW_ACTION_RAW)"
ENV __OW_PROJECT_URL "$(inputs.params.OW_PROJECT_URL)"
EOF
- name: update-dockerfile-for-tekton - name: update-dockerfile-for-tekton
image: ubuntu image: ubuntu
command: command:
- sed - sed
args: args:
- -i - -i
- -e - -e
- 's/COPY ./COPY .\/runtime-git/g' - 's/COPY ./COPY .\/runtime-git/g'
- $(inputs.params.DOCKERFILE) - $(inputs.params.DOCKERFILE)
- name: build-openwhisk-nodejs-runtime - name: build-openwhisk-nodejs-runtime
image: "gcr.io/kaniko-project/executor:latest" image: "gcr.io/kaniko-project/executor:latest"
command: command:
- /kaniko/executor - /kaniko/executor
args: args:
- --dockerfile=$(inputs.params.DOCKERFILE) - --dockerfile=$(inputs.params.DOCKERFILE)
- --destination=$(outputs.resources.runtime-image.url) - --destination=$(outputs.resources.runtime-image.url)

View File

@ -2,7 +2,6 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: openwhisk-runtime-builder name: openwhisk-runtime-builder
secrets: secrets:
- name: dockerhub-user-pass - name: dockerhub-user-pass

View File

@ -5,8 +5,8 @@ metadata:
spec: spec:
inputs: inputs:
resources: resources:
- name: source - name: source
type: git type: git
params: params:
- name: BUILDER_IMAGE - name: BUILDER_IMAGE
description: The location of the s2i builder image. description: The location of the s2i builder image.
@ -28,8 +28,8 @@ spec:
workingdir: /workspace/source workingdir: /workspace/source
command: ['s2i', 'build', '$(inputs.params.PATH_CONTEXT)', '$(inputs.params.BUILDER_IMAGE)', '--as-dockerfile', '/gen-source/Dockerfile.gen'] command: ['s2i', 'build', '$(inputs.params.PATH_CONTEXT)', '$(inputs.params.BUILDER_IMAGE)', '--as-dockerfile', '/gen-source/Dockerfile.gen']
volumeMounts: volumeMounts:
- name: gen-source - name: gen-source
mountPath: /gen-source mountPath: /gen-source
- name: build - name: build
image: quay.io/buildah/stable image: quay.io/buildah/stable
workingdir: /gen-source workingdir: /gen-source