khuedoan-homelab/.ci/pull-request.yaml

70 lines
1.6 KiB
YAML
Raw Normal View History

apiVersion: tekton.dev/v1beta1
kind: Pipeline
metadata:
name: pull-request
spec:
workspaces:
- name: shared-data
tasks:
2023-01-26 10:50:20 +07:00
- name: clone
taskRef:
resolver: hub
params:
- name: kind
value: task
- name: name
value: git-clone
- name: version
value: "0.7"
workspaces:
- name: output
workspace: shared-data
params:
- name: url
value: $(params.git_url)
- name: revision
value: $(params.git_revision)
2023-01-26 15:27:35 +07:00
- name: tools
runAfter:
- clone
taskRef:
resolver: hub
params:
- name: kind
value: task
- name: name
value: kaniko
- name: version
value: "0.6"
params:
- name: DOCKERFILE
value: ./Dockerfile.tools
- name: IMAGE
value: &toolsImage registry.khuedoan.com/homelab-tools:$(params.git_revision)
- name: EXTRA_ARGS
value:
- --cache=true
workspaces:
- name: source
workspace: shared-data
2023-01-26 10:50:20 +07:00
- name: test
2023-01-26 15:27:35 +07:00
runAfter:
- clone
- tools
workspaces:
- name: source
workspace: shared-data
taskSpec:
workspaces:
- name: source
stepTemplate:
2023-01-26 15:27:35 +07:00
image: *toolsImage
workingDir: $(workspaces.source.path)
steps:
2023-01-26 10:50:20 +07:00
- name: pre-commit
command:
- nix-shell
- --command
args:
- "pre-commit run --color=always"