Skip to content

Commit

Permalink
Merge pull request #97 from SovereignCloudStack/syself/write-builder-…
Browse files Browse the repository at this point in the history
…image-version

🌱 allow renovate to propagate builder image version
  • Loading branch information
kranurag7 authored Mar 4, 2024
2 parents b56c93d + 3c26ded commit e89904f
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 e89904f

Please sign in to comment.