Skip to content

Commit

Permalink
Add CI logic for finding the latest ui download url
Browse files Browse the repository at this point in the history
  • Loading branch information
gerrod3 committed Oct 21, 2024
1 parent 17ceeea commit d14d3a9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/actions/build_image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ inputs:
image_cache_key:
description: 'The key value used to store the base images in the cache'
required: true
latest_ui:
description: 'Use the latest pulp-ui when building the image'
default: 'false'
required: false
outputs:
app_version:
value: ${{ steps.image_version_branch.outputs.app_version }}
Expand All @@ -30,6 +34,10 @@ runs:
with:
python-version: 3.11

- name: Install python deps
run: pip install httpie jq
shell: bash

- name: Restore podman images from cache
uses: actions/cache/restore@v3
with:
Expand All @@ -41,6 +49,14 @@ runs:
podman load -i base-images.tar.gz
shell: bash

- name: Find latest ui version
if: inputs.latest_ui != 'false'
run: |
URL=$(http "https://api.github.com/repos/pulp/pulp-ui/releases" | jq -r '.assets[0].browser_download_url')
echo "Found UI url ${URL}"
echo "BUILD_UI_ARG=--build-arg PULP_UI_URL=${URL}" >> $GITHUB_ENV
shell: bash

- name: Build images
run: |
podman version
Expand All @@ -53,7 +69,7 @@ runs:
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile.core --tag pulp/${{ inputs.image_name }}:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} .
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile.webserver --tag pulp/${base_image}-web:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} .
else
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile --tag pulp/${{ inputs.image_name }}:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} .
podman build --platform linux/${ARCH} --format docker --pull=false --file images/${{ inputs.image_name }}/${{ inputs.image_variant }}/Containerfile --tag pulp/${{ inputs.image_name }}:ci-${ARCH} --build-arg FROM_TAG=ci-${ARCH} ${{ env.BUILD_UI_ARG }} .
fi
done
podman images -a
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ jobs:
image_name: ${{ matrix.image_name }}
image_variant: "stable"
image_cache_key: ${{ needs.base-images.outputs.base_cache_key }}
latest_ui: ${{ github.base_ref == 'latest' }}

- name: Test App Image
uses: "./.github/actions/test_image"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ jobs:
image_name: ${{ matrix.image_name }}
image_variant: ${{ matrix.image_variant }}
image_cache_key: ${{ needs.base-images.outputs.base_cache_key }}
latest_ui: ${{ github.ref_name == 'latest' }}

- name: Test App Image
if: matrix.image_variant != 'nightly'
Expand Down

0 comments on commit d14d3a9

Please sign in to comment.