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 export-name property to set case-sensitive variable names #23

Closed
wants to merge 1 commit into from
Closed

Support export-name property to set case-sensitive variable names #23

wants to merge 1 commit into from

Conversation

dominics
Copy link

@dominics dominics commented Apr 15, 2021

This provides a simple fix for #20 - that the plugin can't set lower-case or mixed-case environment variables using the env configuration (it can with JSON).

Specifically, this PR adds an optional way to specify an export name directly as a value, rather than a property key (because those have their case munged to UPPER_CASE when placed in BUILDKITE_PLUGIN_*).

This new supported config type looks like this:

steps:
  - commands: 'echo \$someSecret'
    plugins:
      - seek-oss/aws-sm#v2.4.0:
          env:
            foo:
              export-name: someSecret
              secret-id: my-secret-id
            bar:
              export-name: TF_VAR_some_other_secret
              secret-id: another-secret-id

Closes #20.

@dominics dominics marked this pull request as ready for review April 15, 2021 05:05
@dominics
Copy link
Author

I went with export-name because that's what the local variable was called, but I'm open to changing it

@72636c
Copy link
Member

72636c commented Apr 19, 2021

Hey, sorry this took a while to get to! Would it be possible to circumvent the ignored foos and bars like so:

steps:
  - commands: 'echo \$someSecret'
    plugins:
      - seek-oss/aws-sm#v2.4.0:
          env:
            - export-name: someSecret
              secret-id: my-secret-id
            - export-name: TF_VAR_some_other_secret
              secret-id: another-secret-id

@dominics
Copy link
Author

Probably would be, but I've moved on from the employer where I was using this plugin, sorry. I might have time one day to revisit, but no firm plans right now

@gitlon
Copy link

gitlon commented May 3, 2022

Closed this PR but will revisit when have time to test and have a known use-case for mixed-case variables.

@gitlon gitlon closed this May 3, 2022
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.

Case change for variable names
3 participants