87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
# Tekton TriggerTemplate for Bakery-IA CI/CD
|
|
# This template defines how PipelineRuns are created when triggers fire
|
|
#
|
|
# Registry URL Configuration:
|
|
# The registry URL is configured via the 'registry' parameter.
|
|
# Default value should match pipeline-config ConfigMap's REGISTRY_URL.
|
|
# To change the registry, update BOTH:
|
|
# 1. This template's default value
|
|
# 2. The pipeline-config ConfigMap
|
|
|
|
apiVersion: triggers.tekton.dev/v1beta1
|
|
kind: TriggerTemplate
|
|
metadata:
|
|
name: bakery-ia-trigger-template
|
|
namespace: tekton-pipelines
|
|
labels:
|
|
app.kubernetes.io/name: bakery-ia-cicd
|
|
app.kubernetes.io/component: triggers
|
|
spec:
|
|
params:
|
|
- name: git-repo-url
|
|
description: The git repository URL
|
|
- name: git-revision
|
|
description: The git revision/commit hash
|
|
- name: git-branch
|
|
description: The git branch name
|
|
default: "main"
|
|
- name: git-repo-name
|
|
description: The git repository name
|
|
default: "bakery-ia"
|
|
- name: git-repo-full-name
|
|
description: The full repository name (org/repo)
|
|
default: "bakery/bakery-ia"
|
|
# Registry URL - keep in sync with pipeline-config ConfigMap
|
|
- name: registry-url
|
|
description: Container registry URL
|
|
default: "gitea.bakery-ia.local:5000"
|
|
resourcetemplates:
|
|
- apiVersion: tekton.dev/v1beta1
|
|
kind: PipelineRun
|
|
metadata:
|
|
generateName: bakery-ia-ci-run-
|
|
labels:
|
|
app.kubernetes.io/name: bakery-ia-cicd
|
|
tekton.dev/pipeline: bakery-ia-ci
|
|
triggers.tekton.dev/trigger: bakery-ia-gitea-trigger
|
|
annotations:
|
|
# Track the source commit
|
|
bakery-ia.io/git-revision: $(tt.params.git-revision)
|
|
bakery-ia.io/git-branch: $(tt.params.git-branch)
|
|
spec:
|
|
pipelineRef:
|
|
name: bakery-ia-ci
|
|
serviceAccountName: tekton-pipeline-sa
|
|
workspaces:
|
|
- name: shared-workspace
|
|
volumeClaimTemplate:
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 5Gi
|
|
- name: docker-credentials
|
|
secret:
|
|
secretName: gitea-registry-credentials
|
|
- name: git-credentials
|
|
secret:
|
|
secretName: gitea-git-credentials
|
|
params:
|
|
- name: git-url
|
|
value: $(tt.params.git-repo-url)
|
|
- name: git-revision
|
|
value: $(tt.params.git-revision)
|
|
- name: git-branch
|
|
value: $(tt.params.git-branch)
|
|
# Use template parameter for registry URL
|
|
- name: registry
|
|
value: $(tt.params.registry-url)
|
|
- name: skip-tests
|
|
value: "false"
|
|
- name: dry-run
|
|
value: "false"
|
|
# Timeout for the entire pipeline run
|
|
timeouts:
|
|
pipeline: "1h0m0s"
|
|
tasks: "45m0s"
|