I’ve been trying to figure out a way to get my pipeline working for quite sometime, but no luck.
Basically I am using docker-compose to build the environment but due to be importing some private npm packages on my project, I need to pass the environment variable as an argument, but I can’t find a way to get it working.
Here is an example of the code and plugins I am trying to use.
- name: ":docker: :yarn: Build CI Container"
seek-oss/aws-sm exposes the secret for me as an environment variable, but on docker-compose I need to use as an argument the NPM_TOKEN environment variable.
Hopefully someone can help me.
@gus-asm Welcome to the community!
@cwmaier-grapl’s suggestion is correct, you’ll need to ensure that the values exposed in the
seek-oss/aws-sm plugin are available to your containers using the
env key in the example they provided there.
Thanks @jeremy and @cwmaier-grapl , I’ve tried initially using the env, but env are only used on run mode, not on build mode :(
` `env` or `environment` (optional, run only)
A list of either KEY or KEY=VALUE that are passed through as environment variables to the container.`
Is this another case of needing a double-dollar to stop the environment variable from being interpolated? Try:
…I’ve also ended up taking a whacky approach in Dockerfiles in the past, passing ARGs to ENVs. It pickles my noodle every time I have to think about it, but with enough time I can convince myself it makes sense. It goes something like:
Don’t know if this will help, but give it a go - it could be useful one day anyway!