user4537858
user4537858

Reputation: 51

Merging keys in concourse YAML files

How can I merge keys in concourse? My var file has key value pairs like

cf-api-app: api-
cf-dispatcher-app: dispatcher-
cf-space: test

In my pipeline I want to pass param to my task which should look something like

PCF_API_APP_NAME: ((cf-api-app))-((cf-space))
PCF_DISPATCHER_APP_NAME: ((cf-dispatcher-app))-((cf-space))

So my task can get a param based on environment, and it would look something like

PCF_API_APP_NAME: api-test
PCF_DISPATCHER_APP_NAME: dispatcher-test

But I guess somehow, it does not take the combination as expected and is unable to evaluate it.

I even tried using anchor in my config.yml so that I can merge keys in the config file instead of pipeline but still it does not work.

aliases: &environ test

cf-api-app: api-*environ (fails)
cf-dispatcher-app: dispatcher-*environ (fails)
cf-space: *environ (works)

Upvotes: 0

Views: 544

Answers (1)

dreftymac
dreftymac

Reputation: 32440

Problem

The following alias mapping fails in concourse.

  aliases: &environ test

  cf-api-app: api-*environ (fails)
  cf-dispatcher-app: dispatcher-*environ (fails)

Solution

  • This is contingent on the concourse version.
  • This is supported in concourse version 3.2+

Pitfalls

  • This kind of alias mapping is a part of concourse and is not a part of the native YAML specification.

Upvotes: 0

Related Questions