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

build: specify overlays for each org #13

Merged
merged 3 commits into from
Sep 27, 2023

Conversation

mortennordseth
Copy link
Contributor

We need to specify which overlays we push to, to ensure that the system will pick up new versions.
Ref: https://github.com/AtB-AS/gcp-infra/pull/415#pullrequestreview-1643544450

Copy link
Collaborator

@mikaelbr mikaelbr left a comment

Choose a reason for hiding this comment

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

Could use of matrixes be more scalable for multiple orgs here? 🤔

Example:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - push_overlay: "atb-staging-c420"
             release_overlay: "atb-prod-2e7e"
          - push_overlay: "nfk-staging-dac7"
             release_overlay: "nfk-prod-ce66"
          # - ... osv for fram
  steps:
    uses: atb-as/workflows/.github/workflows/cluster-docker-build-tag-push.yaml@v2
    with:
      image: gcr.io/atb-mobility-platform/planner-web
      push_overlay: {{ matrix.push_overlay }}
      release_overlay: {{ matrix.release_overlay }}
      overlays_base: manifests/amp/overlays
    secrets:
      github_pat: ${{ secrets.GH_PAT }}

@mortennordseth
Copy link
Contributor Author

Indeed! I didn't think of using multiple variables for each element in the matrix

@mikaelbr
Copy link
Collaborator

magic

@mikaelbr
Copy link
Collaborator

Might be something wrong with my example 🤔 😅 https://github.com/AtB-AS/planner-web/actions/runs/6310892180

@mortennordseth
Copy link
Contributor Author

Yup! Seems like we can't use common workflows in a step 😅 Looking into it!

@mortennordseth
Copy link
Contributor Author

I think this should do the trick and that the job build will run three times with the correct overlay values 👍 From the documentation on GHA matrix:

A job will run for each possible combination of the variables.

Copy link
Collaborator

@mikaelbr mikaelbr left a comment

Choose a reason for hiding this comment

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

Didn't find out how to trigger it manually using gh workflow 😅 More research required, but it looks sound

@mortennordseth mortennordseth merged commit 17323c6 into main Sep 27, 2023
2 checks passed
@mortennordseth mortennordseth deleted the morten/gha-specify-overlays branch September 27, 2023 05:00
mortennordseth added a commit that referenced this pull request Sep 27, 2023
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.

2 participants