Skip to content

Commit

Permalink
allow renovate to propagate builder image version
Browse files Browse the repository at this point in the history
As of now, renovate only populates the updated
version in github workflows but don't write
to .builder-image-version.txt which is the main
part.
This commit fixes the same.

Signed-off-by: kranurag7 <anurag.kumar@syself.com>
  • Loading branch information
kranurag7 authored and kranurag7 committed Mar 4, 2024
1 parent b56c93d commit 3c26ded
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/schedule-update-bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
RENOVATE_HOST_RULES: '[{"hostType": "docker", "matchHost": "ghcr.io", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
RENOVATE_ALLOWED_POST_UPGRADE_COMMANDS: '[".*"]'
BUILDER_IMAGE: 'ghcr.io/sovereigncloudstack/cso'
RENOVATE_POST_UPGRADE_TASKS: '{ commands: ["BUILD_IMAGE_TOKEN=${{ secrets.GITHUB_TOKEN }} BUILD_IMAGE_USER=${{ github.actor }} CI=true ./hack/upgrade-builder-image.sh"], fileFilters: ["Makefile", ".github/**/*.yml", ".github/**/*.yaml"], executionMode: "branch"}'
RENOVATE_POST_UPGRADE_TASKS: '{ commands: ["BUILD_IMAGE_TOKEN=${{ secrets.GITHUB_TOKEN }} BUILD_IMAGE_USER=${{ github.actor }} CI=true ./hack/upgrade-builder-image.sh"], fileFilters: ["Makefile", ".builder-image-version.txt", ".github/**/*.yml", ".github/**/*.yaml"], executionMode: "branch"}'
with:
configurationFile: ${{ env.RENOVATE_CONFIG_FILE }}
token: "x-access-token:${{ steps.generate-token.outputs.token }}"
Expand Down
3 changes: 3 additions & 0 deletions hack/upgrade-builder-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ fi
export VERSION=$(git fetch --quiet origin main && git show origin/main:.builder-image-version.txt)
export NEW_VERSION=$(semver_upgrade patch ${VERSION})

echo "$NEW_VERSION" > .builder-image-version.txt
echo "Wrote new version $NEW_VERSION to .builder-image-version.txt"

if docker manifest inspect ghcr.io/sovereigncloudstack/cso-builder:${VERSION} > /dev/null ; echo $?; then

sed -i -e "/^BUILDER_IMAGE_VERSION /s/:=.*$/:= ${NEW_VERSION}/" Makefile
Expand Down

0 comments on commit 3c26ded

Please sign in to comment.