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

How to set environment variable before pushing to two repos? #54

Open
knjk04 opened this issue Apr 5, 2024 · 2 comments
Open

How to set environment variable before pushing to two repos? #54

knjk04 opened this issue Apr 5, 2024 · 2 comments

Comments

@knjk04
Copy link

knjk04 commented Apr 5, 2024

Hi,

I am trying to push to two different AWS ECR repos in different AWS regions. Here is my config:

[
      "@codedependant/semantic-release-docker",
      {
        "dockerTags": [
          "{{version}}"
        ],
        "dockerImage": "repo1",
        "dockerRegistry": "account.dkr.ecr.region-1.amazonaws.com"
      }
    ],
    [
      "@codedependant/semantic-release-docker",
      {
        "dockerTags": [
          "{{version}}"
        ],
        "dockerImage": "repo2",
        "dockerRegistry": "account.dkr.ecr.region-2.amazonaws.com"
      }
    ]

I authenticate with the AWS ECR before running semantic-release (npx semantic-release --extends ./.releaserc.json --debug).

I would like to set an environment variable (change the AWS_REGION) before running the second push. Is there a way to specify this before running the push in code here? I want to avoid having two separate semantic-release jobs in my CI file to prevent bumping the version twice.

Thanks in advance!

@knjk04
Copy link
Author

knjk04 commented Apr 5, 2024

Spoke too soon. I guess I could just slot in semantic-release/exec in between the two plugins to export my variable.

Is there a way around this using this plugin? If not, that's fine :)

@esatterwhite
Copy link
Owner

There isn't a way to do that with this plugin specifically, no. But the exec plugin seems like a fine way

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

No branches or pull requests

2 participants