mirror of
https://github.com/khuedoan/homelab.git
synced 2024-12-22 21:04:54 +07:00
refactor(tekton): use common workflows that create pipelines
This commit is contained in:
parent
6bd0577c64
commit
a7016de626
@ -1,7 +0,0 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
namespace: tekton-pipelines
|
||||
|
||||
resources:
|
||||
- secrets.yaml
|
||||
- pipeline.yaml
|
@ -1,3 +1,4 @@
|
||||
# TODO include this in pipelines
|
||||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
|
@ -7,11 +7,13 @@ resources:
|
||||
# Triggers
|
||||
- https://storage.googleapis.com/tekton-releases/triggers/latest/release.yaml
|
||||
- https://storage.googleapis.com/tekton-releases/triggers/latest/interceptors.yaml
|
||||
# Workflow
|
||||
- https://storage.googleapis.com/tekton-releases-nightly/workflows/latest/release.yaml
|
||||
# Dashboard
|
||||
- https://storage.googleapis.com/tekton-releases/dashboard/latest/tekton-dashboard-release.yaml
|
||||
- ingress.yaml
|
||||
# Service account
|
||||
- serviceaccount.yaml
|
||||
- clusterrolebinding.yaml
|
||||
# Workflow
|
||||
- https://storage.googleapis.com/tekton-releases-nightly/workflows/latest/release.yaml
|
||||
# Pre-defined workflows
|
||||
- workflows/master.yaml
|
||||
|
51
platform/tekton-pipelines/workflows/master.yaml
Normal file
51
platform/tekton-pipelines/workflows/master.yaml
Normal file
@ -0,0 +1,51 @@
|
||||
apiVersion: workflows.tekton.dev/v1alpha1
|
||||
kind: Workflow
|
||||
metadata:
|
||||
name: blog-master
|
||||
namespace: tekton-workflows
|
||||
spec:
|
||||
triggers:
|
||||
- event:
|
||||
type: push
|
||||
secret:
|
||||
secretName: webhook-secret
|
||||
secretKey: token
|
||||
filters:
|
||||
# TODO Gitea doesn't have refs/head/ prefix, use gitRef after this is fixed
|
||||
# https://github.com/tektoncd/experimental/blob/3644c43377239bb639ec4191acc04fcf3aafb3f2/workflows/pkg/filters/filters.go#L44-L46
|
||||
gitRef:
|
||||
regex: '^master$'
|
||||
# custom:
|
||||
# - cel: "body.ref.matches('^master$')"
|
||||
bindings:
|
||||
- name: git_url
|
||||
value: $(body.repository.clone_url)
|
||||
- name: git_revision
|
||||
value: $(body.after)
|
||||
params:
|
||||
- name: git_url
|
||||
# TODO don't need default, but invalid mem address if remove this
|
||||
default: https://git.khuedoan.com/foo/bar
|
||||
- name: git_revision
|
||||
default: master
|
||||
pipelineRef:
|
||||
resolver: git
|
||||
params:
|
||||
# TODO ???
|
||||
# supposed to be param. or body., looks like it's not working in v1alpha1 yet
|
||||
- name: url
|
||||
value: $(tt.params.git_url)
|
||||
- name: revision
|
||||
value: $(tt.params.git_revision)
|
||||
- name: pathInRepo
|
||||
value: .ci/master.yaml
|
||||
workspaces:
|
||||
- name: shared-data
|
||||
volumeClaimTemplate:
|
||||
spec:
|
||||
storageClassName: longhorn
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 128Mi
|
Loading…
Reference in New Issue
Block a user