Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support secrets for building the cached image #36

Merged
merged 3 commits into from
Jul 6, 2021
Merged

Support secrets for building the cached image #36

merged 3 commits into from
Jul 6, 2021

Conversation

koterpillar
Copy link
Contributor

No description provided.

Copy link
Member

@72636c 72636c left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great 👏

plugins:
- seek-oss/docker-ecr-cache#v1.9.0:
secrets:
- SECRET
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like us to land on a configuration approach that supports both env= and also src=. I think the latter will become the preferred option for npm auth when paired with https://github.com/seek-oss/private-npm-buildkite-plugin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you imagine src= secrets will be passed between plugins? I've decided not to implement SECRET=value for simplicity and because it might be visible in the pipeline. Separate PR?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I may be misunderstanding, but in the case of private-npm-buildkite-plugin you should be able to control the file output path from that plugin and pipe that through as the input path src= here.

We don't have to land src= support in this PR, but I want to avoid ending up with strange options like secrets for env and secrets-src for src. What do you think about passing the flag values through verbatim:

secrets:
  - id=1,env=SECRET
  - id=2,src=path/to/secret.txt

Alternatively we could try to retain the cleverness that your PR has currently, but I'm not sure it's worth the extra parsing complexity:

secrets:
  - env: SECRET
  - src: path/to/secret.txt

secrets:
  id1:
    env: SECRET
  id2:
    src: path/to/secret.txt  

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

= cannot occur in environment variable names, so this is forward compatible:

secrets:
  - FOO
  - id=bar,env=BAR
  - id=baz,src=path/to/baz.txt

README.md Show resolved Hide resolved
@72636c 72636c merged commit 55157af into master Jul 6, 2021
@koterpillar koterpillar deleted the secrets branch July 6, 2021 04:18
72636c added a commit that referenced this pull request Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants