Bake(Manifest) - Helm Chart URL parametrization

Hi,

I would like to parametrize the Helm chart URL with a version parameter so that we do not have to modify the pipeline each time we have a new version of a chart.

Is there a way how to do that?

I am trying to parametrize the artifact URL but the problem is that Expected Artifact URL is part of the Configuration stage which does not evaluate the expressions (as per documentation).

An example of my Approach:

My S3 Expected Artifact URL is s3://mybckt/busybox-${trigger["parameters"]["chart_version"]}.tgz

And I have defined a required Parameter: chart_version.

When I execute such pipeline, I get an error:

Unmatched expected artifact ExpectedArtifact(matchArtifact=Artifact(type=s3/object, 
name=s3://mybckt/busybox-${trigger[\"parameters\"][\"chart_version\"]}.tgz

Thank you,
Ales

I was able to resolve this problem.

Here are some notes.

  1. The Spinnaker documentation is incorrect - it states that parameterized expressions cannot be used in the Configuration section (Configuration section Expressions limitation) but it is possible. See below.

  2. In order for the parametrization to work, in Expected Artifacts a “Use Default Artifact” must be enabled and the URL in the Default Artifact must be parametrized as well. As Shown below:

If the URL in the Default Artifact is not parametrized, Spinnaker will use the Default Artifact always - no matter if you provide the input parameter or not, which is very non-intuitive behavior.

3 Likes

Thanks man! I was trying to do the same thing, you saved me! :smile: