我正在使用 tekton 构建由 webhook(推送事件)触发的图像。我的问题是,是否可以定义一个变量来生成图像名称或标签,例如 v1.0/v1.1/v1.2,而不是 ${uid}
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerTemplate
metadata:
creationTimestamp: "2021-03-11T03:22:36Z"
generation: 3
name: trigger-template-common-pipeline-mtn2kw
namespace: pipelines-tutorial
resourceVersion: "228583354"
selfLink: /apis/triggers.tekton.dev/v1alpha1/namespaces/pipelines-tutorial/triggertemplates/trigger-template-common-pipeline-mtn2kw
uid: f08418b7-d253-4656-b27d-b136a48d0ba0
spec:
params:
- name: git-revision
- name: git-repo-url
resourcetemplates:
- apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
annotations: {}
generateName: common-pipeline-
labels:
tekton.dev/pipeline: common-pipeline
namespace: pipelines-tutorial
spec:
params:
- name: git-url
value: $(tt.params.git-url)
- name: image-name
value: image-registry.openshift-image-registry.svc:5000/default/vote-ui:**{{v1.0}}**
pipelineRef:
name: common-pipeline
resources: []
serviceAccountName: build-bot-2
workspaces:
- name: shared-workspace
persistentVolumeClaim:
claimName: source-pvc
apiVersion: triggers.tekton.dev/v1alpha1
kind: TriggerBinding
metadata:
creationTimestamp: "2021-03-18T06:43:07Z"
generation: 1
name: github-push-binding
namespace: pipelines-tutorial
resourceVersion: "117383551"
selfLink: /apis/triggers.tekton.dev/v1alpha1/namespaces/pipelines-tutorial/triggerbindings/github-push-binding
uid: a443dc79-d789-4d19-8460-d0741117cb51
spec:
params:
- name: git-revision
value: $(body.head_commit.id)
- name: git-url
value: $(body.repository.url)