Skip to content

Commit

Permalink
Align the tag names properly for 1.5 (#11)
Browse files Browse the repository at this point in the history
* Align the tag names properly for 1.5

* Check if a base index image exists for the tag
  • Loading branch information
leifmadsen authored Oct 13, 2023
1 parent 5c34be0 commit b3ff29e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ jobs:
QUAY_INFRAWATCH_OPERATORS_PASSWORD: ${{ secrets.QUAY_INFRAWATCH_OPERATORS_PASSWORD }}
QUAY_INFRAWATCH_USERNAME: ${{ secrets.QUAY_INFRAWATCH_USERNAME }}
QUAY_INFRAWATCH_PASSWORD: ${{ secrets.QUAY_INFRAWATCH_PASSWORD }}
IMAGE_TAG: "latest" # copy workload artifacts FROM this tag
INSPECTION_TAG: "nightly" # copy workload artifacts TO this tag
BUNDLE_TAG: "nightly-head" # create bundles with this tag
INDEX_IMAGE_TAG: "nightly" # create index image with this tag

periodic_release_1_5:
name: Periodic Release for STF 1.5
Expand Down Expand Up @@ -118,6 +122,7 @@ jobs:
QUAY_INFRAWATCH_OPERATORS_PASSWORD: ${{ secrets.QUAY_INFRAWATCH_OPERATORS_PASSWORD }}
QUAY_INFRAWATCH_USERNAME: ${{ secrets.QUAY_INFRAWATCH_USERNAME }}
QUAY_INFRAWATCH_PASSWORD: ${{ secrets.QUAY_INFRAWATCH_PASSWORD }}
BUNDLE_TAG: "stable-1.5"
INSPECTION_TAG: "stable-1.5"
INDEX_IMAGE_TAG: "nightly-1.5"
IMAGE_TAG: "stable-1.5" # copy workload artifacts FROM this tag
INSPECTION_TAG: "nightly-1.5" # copy workload artifacts TO this tag
BUNDLE_TAG: "nightly-1.5" # create bundles with this tag
INDEX_IMAGE_TAG: "nightly-1.5" # create index image with this tag
9 changes: 8 additions & 1 deletion releaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,12 @@ STO_BUNDLE_IMAGE_HASH=$(docker push "${STO_BUNDLE_IMAGE_PATH}:${BUNDLE_TAG}" | s
popd || exit

echo "-- Build and push index image"
opm index add --build-tool docker --bundles "${SGO_BUNDLE_IMAGE_PATH}@${SGO_BUNDLE_IMAGE_HASH},${STO_BUNDLE_IMAGE_PATH}@${STO_BUNDLE_IMAGE_HASH}" --from-index "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" --tag "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" || exit
# check if a tag already exists
skopeo inspect --format "{{.Digest}}" "docker://${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" > /dev/null 2>&1
status=$?
if [ $status -eq 0 ]; then
opm index add --build-tool docker --bundles "${SGO_BUNDLE_IMAGE_PATH}@${SGO_BUNDLE_IMAGE_HASH},${STO_BUNDLE_IMAGE_PATH}@${STO_BUNDLE_IMAGE_HASH}" --from-index "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" --tag "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" || exit
else
opm index add --build-tool docker --bundles "${SGO_BUNDLE_IMAGE_PATH}@${SGO_BUNDLE_IMAGE_HASH},${STO_BUNDLE_IMAGE_PATH}@${STO_BUNDLE_IMAGE_HASH}" --tag "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" || exit
fi
docker push "${INDEX_IMAGE_PATH}:${INDEX_IMAGE_TAG}" || exit

0 comments on commit b3ff29e

Please sign in to comment.