-
Notifications
You must be signed in to change notification settings - Fork 12
ISSUE-114: Separate OKD build and push phases #126
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,11 @@ jobs: | |
| build-okd-release: | ||
| name: Build OKD release images for ARM | ||
| runs-on: ubuntu-24.04-arm | ||
| # Export the detected OKD version as a job output so the cleanup job can use | ||
| # the same version. This prevents version mismatches if the build fails before | ||
| # version detection completes. | ||
| outputs: | ||
| okd-version-tag: ${{ steps.set-version.outputs.okd-version-tag }} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's double check this because the step is run after the setting.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so in here, i am trying to tell the job to output the okd-version-tag it used to build the release, this is helpful to clean up the images in both the cases of build failure and success. |
||
| steps: | ||
| - name: Check out MicroShift upstream repository | ||
| uses: actions/checkout@v4 | ||
|
|
@@ -42,11 +47,41 @@ jobs: | |
| with: | ||
| check-amd64: "true" | ||
|
|
||
| # Determine which OKD version to use (user-specified OR auto-detected) and | ||
| # capture it as a step output so it can be exported as a job output. | ||
| # This ensures the cleanup job uses the exact same version as the build job, | ||
| # preventing cleanup from targeting wrong staging images. | ||
| - name: Set OKD version for reuse | ||
| id: set-version | ||
| run: | | ||
| VERSION="${{ env.OKD_VERSION_TAG != 'latest' && env.OKD_VERSION_TAG || steps.detect-okd-version.outputs.okd-version-tag }}" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's add a comment explaining why we're doing this
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. user specifies a specific version we use that and if user only specifies latest and does not specify a version we auto detect it |
||
| echo "okd-version-tag=${VERSION}" >> $GITHUB_OUTPUT | ||
| echo "Using OKD version: ${VERSION}" | ||
|
|
||
| - name: Run the OKD release images build action | ||
| uses: ./.github/actions/build-okd | ||
| with: | ||
| ushift-gitref: ${{ env.USHIFT_GITREF }} | ||
| okd-version-tag: ${{ env.OKD_VERSION_TAG != 'latest' && env.OKD_VERSION_TAG || steps.detect-okd-version.outputs.okd-version-tag }} | ||
| okd-version-tag: ${{ steps.set-version.outputs.okd-version-tag }} | ||
| target-arch: arm64 | ||
| target-registry: ${{ env.OKD_TARGET_REGISTRY }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| cleanup-staging: | ||
| name: Cleanup staging registry | ||
| needs: build-okd-release | ||
| if: success() || failure() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Check out MicroShift upstream repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run cleanup of staging OKD images | ||
| uses: ./.github/actions/build-okd | ||
| with: | ||
| ushift-gitref: ${{ env.USHIFT_GITREF }} | ||
| okd-version-tag: ${{ needs.build-okd-release.outputs.okd-version-tag }} | ||
| target-arch: arm64 | ||
| target-registry: ${{ env.OKD_TARGET_REGISTRY }} | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
| cleanup-staging: 'true' | ||
Uh oh!
There was an error while loading. Please reload this page.