I’m trying to sort out a way to deploy to multiple regions using a dynamic list of regions that can be shared across multiple projects that are using semaphore.
I’ve tried using a job matrix with the
values coming from a secret:
data: env_vars: - name: MATRIX_REGIONS value: region1, region2, region3
secrets: - name: regions jobs: - name: Deploy to regions matrix: - env_var: REGION values: [ $MATRIX_REGIONS ] commands: - deploy $REGION
This doesn’t work since the environment variable is just a string so
$REGION is coming through as “region1, region2, region3”.
Is there another approach I can take to implement this? We could hard code the regions into the
values for each of our promotions, but we have a good number of projects that need the same logic and the regions change regularly.