-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Bump Chart Dependencies | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat/CON-24236-auto-update-support | ||
workflow_call: | ||
inputs: | ||
chart-name: | ||
description: 'The name of the chart' | ||
default: 'ocean-kubernetes-controller' | ||
type: string | ||
|
||
jobs: | ||
bump-local-dependencies: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: spotinst/charts | ||
- uses: gabe565/[email protected] | ||
- uses: azure/[email protected] | ||
with: | ||
version: v3.12.1 | ||
|
||
- name: Check Dependencies Versions | ||
id: check-dependencies | ||
run: | | ||
for chart in `yq '.dependencies[].name' ./charts/ocean-kubernetes-controller/Chart.yaml`; do | ||
if [ ! -f ./charts/${chart}/Chart.yaml ]; then | ||
continue | ||
fi | ||
dep_version=$(yq '.dependencies[] | select(.name == "'${chart}'") | .version' ./charts/ocean-kubernetes-controller/Chart.yaml) | ||
chart_version=$(yq '.version' ./charts/${chart}/Chart.yaml) | ||
if [ "${dep_version}" == "${chart_version}" ]; then | ||
echo "Dependency \"${chart}\" has version \"${dep_version}\" and is up to date" | ||
continue | ||
fi | ||
echo "Dependency \"${chart}\" has version \"${dep_version}\" but should be \"${chart_version}\", bumping to \"${chart_version}\"" | ||
yq -i '(.dependencies[] | select(.name == "'${chart}'") | .version) = "'${chart_version}'"' ./charts/ocean-kubernetes-controller/Chart.yaml | ||
done | ||
- name: Check Diff | ||
id: check-diff | ||
run: | | ||
git diff --exit-code && (echo "Nothing to do" && echo "should_update=false" >> $GITHUB_OUTPUT && exit 0) || echo "Changes detected" | ||
echo "should_update=true" >> $GITHUB_OUTPUT | ||
- name: Update Dependencies | ||
if: steps.check-diff.outputs.should_update == 'true' | ||
run: | | ||
helm dependency update ./charts/ocean-kubernetes-controller | ||
- name: Update helm docs | ||
if: steps.check-diff.outputs.should_update == 'true' | ||
run: | | ||
helm-docs --chart-to-generate charts/ocean-kubernetes-controller | ||
- name: Generate version bump commit | ||
if: steps.check-diff.outputs.should_update == 'true' | ||
run: | | ||
git config user.name ${{ github.actor }} | ||
git config user.email '${{ github.actor }}@users.noreply.github.com' | ||
git add . | ||
git commit -a -m "bump ocean-kubernetes-controller dependencies" | ||
- name: Create Pull Request | ||
if: steps.check-diff.outputs.should_update == 'true' | ||
id: cpr | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.CR_TOKEN }} | ||
title: '[bump] ocean-kubernetes-controller dependencies' | ||
branch: bump/ocean-kubernetes-controller dependencies | ||
delete-branch: true | ||
labels: bump_dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+4.51 KB
charts/ocean-kubernetes-controller/charts/ocean-metric-exporter-1.0.10.tgz
Binary file not shown.
Binary file added
BIN
+3.2 KB
charts/ocean-kubernetes-controller/charts/ocean-network-client-1.0.17.tgz
Binary file not shown.