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 for multiple regions in one plugin call? #110

Open
simonblake-mp opened this issue Nov 29, 2024 · 0 comments
Open

Support for multiple regions in one plugin call? #110

simonblake-mp opened this issue Nov 29, 2024 · 0 comments

Comments

@simonblake-mp
Copy link

Heya

We push the same images to ECR repos in different regions, so we end up with buildkite config looking something like:

ecr_login_apse2: &ecr_login_apse2
  - ecr#$ECR_PLUGIN_VERSION:
      login: true
      region: ap-southeast-2
ecr_login_euw1: &ecr_login_euw1      
  - ecr#$ECR_PLUGIN_VERSION:
      login: true
      region: eu-west-1
ecr_login_usw1: &ecr_login_usw1      
  - ecr#$ECR_PLUGIN_VERSION:
      login: true
      region: us-west-1
ecr_login_usw2: &ecr_login_usw2      
  - ecr#$ECR_PLUGIN_VERSION:
      login: true
      region: us-west-2

steps:
  - label: ":docker: Build app image"
    plugins:
      - docker-compose#$DOCKER_COMPOSE_PLUGIN_VERSION:
          config: docker-compose.yml
          build: "${MAIN_SERVICE}"
          push:
            - "${MAIN_SERVICE}:${REPO_PREFIX}.ap-southeast-2.${REPO_SUFFIX}:${BUILD_TAG}"
            - "${MAIN_SERVICE}:${REPO_PREFIX}.eu-west-1.${REPO_SUFFIX}:${BUILD_TAG}"
            - "${MAIN_SERVICE}:${REPO_PREFIX}.us-east-1.${REPO_SUFFIX}:${BUILD_TAG}"
            - "${MAIN_SERVICE}:${REPO_PREFIX}.us-west-1.${REPO_SUFFIX}:${BUILD_TAG}"
            - "${MAIN_SERVICE}:${REPO_PREFIX}.us-west-2.${REPO_SUFFIX}:${BUILD_TAG}"
      - <<: *ecr_login_apse2
      - <<: *ecr_login_euw1
      - <<: *ecr_login_usw1
      - <<: *ecr_login_usw2     

It would be super nice if the region argument accepted a list - that would allow us to DRY up the config.

And yes, I'm aware of ECR replication - sadly that has no particular performance guarantees, so when you've got steps further down the pipeline that depend on the image being available in a specific region, doing the push in the pipeline can be the easiest way to ensure it will be available when needed. I can't imagine we're the only folks doing this 🙏

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

1 participant