pHiL
pHiL

Reputation: 1889

where is concourse.ci metadata variable substition happening?

In concourse pipeline definitions you can use metadata variables like $BUILD_NAME et.al.

While working on a custom resource, I was wondering where the variable substitution is happening: in the yml or in the resource scripts?

To me it seems as if the variables are not substituted in the yml before passing to scripts and scripts have to take care of that ?

Upvotes: 1

Views: 651

Answers (1)

materialdesigner
materialdesigner

Reputation: 1522

You are correct, metadata variable substitution is done in the resource scripts.

A container, particularly a resource get or put container is two things: a root filesystem and a running process (of the script /opt/resource/get or /opt/resource/put). The metadata variables are environment variables that are set on that running process. The metadata variable strings (e.g. $BUILD_NAME) are just passed as is through the templating process to the resource. It's the responsibility of the resource to look for those strings and substitute them with the appropriate environment variables.

Upvotes: 2

Related Questions