0

I am working on tekton pipeline. I would like to retrieved specific fields from source code like image version and image repo configured in helm manifests and pass it to tekton task.

Chart.yaml appVersion: 1.1.37

values.yaml in the source code image: images/gsample

tekton-task.yaml
params:
    - name: IMAGE_REPO
      description: The image registry
    - name: IMAGE_TAG
      description: The image registry

Any ideas on how to retrieved the values of image repo from values.yaml and image tag from chart.yaml and pass it to tekton pipeline?

Jonas
  • 121,568
  • 97
  • 310
  • 388
Ash Poblete
  • 21
  • 1
  • 2

1 Answers1

0

Short answer: you can't grab values out of the repository itself.

Setting up a Tekton Trigger - and GitHub/GitLab/... webhooks in general: you have to work from the payload that would be sent, which usually includes: a branch, a commit ref, your repository clone URL (ssh and/or http), author of the last commit, ...

A good starting point, using GitHub, would be to go through their "Webhooks and Events Payloads" doc. See what could be relevant to your use case:

https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads

Now, in theory, ... you could try setting up a first trigger, receiving notifications from GitHub, starting a Task that would clone your repository, then another task to grab relevant values out of your values.yaml file or whatever else, ... and eventually notify another trigger, with an arbitrary payload.

SYN
  • 4,476
  • 1
  • 20
  • 22