0

Currently my Chart.yml file looks like this:

apiVersion: v2
name: test-api
version: 0.0.0
description: This is the job for testing 
sources:
- <gitlab project link>
maintainers:
- name: <Team Name>
  email: <Team email>

I would like to pass the variable from gitlab-ci.yml file for name of the Chart so in my gitlab-ci.yml file, I have defined the variable name for Chart name something like this:

   variables:
 CHART_NAME: 'test-api'

Next, I would like to pass the variable CHART_NAME from gitlab-ci.yml into Chart.yml file, so now the Chart.yml file looks like this:

apiVersion: v2
name: ${CHART_NAME}
version: 0.0.0
description: This is the job for testing 
sources:
- <gitlab project link>
maintainers:
- name: <Team Name>
  email: <Team email>

but my pipeline failed while trying to publish the helm since my Chart.yml file is not able to read the value of variable CHART_NAME.

Can someone help If it is possible to pass the variable into Chart.yml file from gitlab-ci.yml?

Rab
  • 159
  • 1
  • 11
  • GitLab ill set `CHART_NAME` as an environment variable, and you can follow [this StackOverflow answer](https://stackoverflow.com/a/49930497/10617695) to use it in Helm – Ragland Asir Dec 23 '22 at 09:50
  • @RaglandAsir I wanted to pass variable CHART_NAME into Chart.yml file. Do I have to tweak my job.yml file and make changes in ev section so that i can use it within Chart.yml file? – Rab Dec 23 '22 at 17:35

0 Answers0