Skip to content
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

Auto update image tags upon release #174

Merged
merged 2 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/scripts/upgrade-chart-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

CHART_VERSION=${CHART_VERSION?"Define CHART_VERSION env"}

yq -i ".appVersion = \"${CHART_VERSION}\"" charts/warden/Chart.yaml
yq -i ".version = \"${CHART_VERSION}\"" charts/warden/Chart.yaml
6 changes: 6 additions & 0 deletions .github/scripts/upgrade-sec-scanners-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

IMG_VERSION=${IMG_VERSION?"Define IMG_VERSION env"}

yq -i ".protecode[] |= sub(\":main\", \":${IMG_VERSION}\")" sec-scanners-config.yaml
yq -i "del(.rc-tag)" sec-scanners-config.yaml
39 changes: 38 additions & 1 deletion .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,46 @@ jobs:
- name: Verify github actions
run: ./.github/scripts/verify-actions-status.sh ${{ github.ref_name }}

upgrade-images:
name: Upgrade main images
needs: verify-head-status
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Bump sec-scanners-config.yaml
run: ./.github/scripts/upgrade-sec-scanners-config.sh
env:
IMG_VERSION: ${{ github.event.inputs.name }}

- name: Bump values.yaml
run: |
make replace-chart-images
env:
IMG_DIRECTORY: "prod"
IMG_VERSION: ${{ github.event.inputs.name }}

- name: Bump chart version
run: ./.github/scripts/upgrade-chart-version.sh
env:
CHART_VERSION: ${{ github.event.inputs.name }}

- name: Commit&Push
run: |
git config --local user.email "[email protected]"
git config --local user.name "otter-releaser"

git add .
git commit --allow-empty -m "upgrade dependencies"
git push origin ${{ github.ref_name }}

create-draft:
name: Create draft release
needs: verify-head-status
needs: upgrade-images
runs-on: ubuntu-latest

steps:
Expand Down
Loading