Passing variables to Tasks


#1

Hi there,

Referring to

it seems the only way to pass variables to a task by file is by using environment variables. Is this true?

However, what if the resource in my task file is a docker-image which requires a password. This password is in VAULT however I cannot pass the password to the task file as an environment variable as that’s not usable…

image_resource:
  type: docker-image
  source:
    repository: myrepo/debian
    username: user
    password: ((password))

So how can I use task files and at the same time pass vault credentials down to the task file (not the shell)

Kind regards,


#2

Concourse supports Vault. Refer to https://concourse-ci.org/creds.html#vault. Once you have configured Vault when you start concourse web, Concourse will try to look for ((password)) from Vault.

A sample project at https://github.com/pivotal-cf/pcf-pipelines/blob/master/docs/vault-integration.md


#3

Thanks. However the question is about when the task is in a separate file. For example I got the task file in a separate git repo like ‘common-tasks’. Then I want to pass variables to that file. From vault or anywhere else…

Regards,