Skip to content

Commit

Permalink
Fix updatecli scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Bonafiglia <[email protected]>
  • Loading branch information
rbrtbnfgl committed May 21, 2024
1 parent 9359a61 commit 89690ae
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions updatecli/scripts/update-calico.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eu
if [ -n "$CALICO_VERSION" ]; then
current_calico_version=$(yq '.version' packages/rke2-calico/templates/crd-template/Chart.yaml)
if [ "$current_calico_version" != "$CALICO_VERSION" ]; then
Expand Down
1 change: 1 addition & 0 deletions updatecli/scripts/update-canal.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eu
if [ -n "$FLANNEL_VERSION" ]; then
current_flannel_version=$(yq '.flannel.image.tag' packages/rke2-canal/charts/values.yaml)
if [ "$current_flannel_version" != "$FLANNEL_VERSION" ]; then
Expand Down
5 changes: 2 additions & 3 deletions updatecli/scripts/update-cilium.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/bash
set -eu
if [ -n "$CILIUM_VERSION" ]; then
current_cilium_version=$(sed -nr 's/^\ version: ('[0-9]+.[0-9]+.[0-9]+')/\1/p' packages/rke2-cilium/generated-changes/patch/Chart.yaml.patch)
if [ "v$current_cilium_version" != "$CILIUM_VERSION" ]; then
echo "Updating Cilium chart to $CILIUM_VERSION"
cilium_major=$(echo "$CILIUM_VERSION" | grep -Eo '[0-9]+.[0-9]+')
cilium_num_version=$(echo "$CILIUM_VERSION" | grep -Eo '[0-9]+.[0-9]+.[0-9]+')
mkdir workdir
sed -i "s/ appVersion: .*/ appVersion: $cilium_num_version/g" packages/rke2-cilium/generated-changes/patch/Chart.yaml.patch
sed -i "s/-icon: .*/-icon: https:\/\/cdn.jsdelivr.net\/gh\/cilium\/cilium@v$cilium_major\/Documentation\/images\/logo-solo.svg/g" packages/rke2-cilium/generated-changes/patch/Chart.yaml.patch
sed -i "s/ version: .*/ version: $cilium_num_version/g" packages/rke2-cilium/generated-changes/patch/Chart.yaml.patch
yq -i ".url = \"https://helm.cilium.io/cilium-$cilium_num_version.tgz\" |
.packageVersion = 00" packages/rke2-cilium/package.yaml
Expand Down Expand Up @@ -63,7 +62,7 @@ if [ -n "$CILIUM_VERSION" ]; then
rm -fr workdir
GOCACHE='/home/runner/.cache/go-build' GOPATH='/home/runner/go' PACKAGE='rke2-cilium' make prepare
find packages/rke2-cilium/charts -name '*.orig' -delete
GOCACHE='/home/runner/.cache/go-0build' GOPATH='/home/runner/go' PACKAGE='rke2-cilium' make patch
GOCACHE='/home/runner/.cache/go-build' GOPATH='/home/runner/go' PACKAGE='rke2-cilium' make patch
make clean
fi
fi
1 change: 1 addition & 0 deletions updatecli/scripts/update-flannel.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -eu
if [ -n "$FLANNEL_VERSION" ]; then
app_version=$(echo "$FLANNEL_VERSION" | grep -Eo 'v[0-9]+.[0-9]+.[0-9]+')
current_flannel_version=$(sed -nr 's/^\+ tag: ('v[0-9]+.[0-9]+.[0-9]+')/\1/p' packages/rke2-flannel/generated-changes/patch/values.yaml.patch | head -1)
Expand Down
2 changes: 2 additions & 0 deletions updatecli/updatecli.d/updatecalico.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sources:
release: true
draft: false
prerelease: false
latest: true
versionfilter:
kind: latest

Expand All @@ -27,6 +28,7 @@ targets:
environments:
- name: CALICO_VERSION
value: '{{ source "calico" }}'
- name: PATH


scms:
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/updatecanal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ targets:
environments:
- name: CALICO_VERSION
value: '{{ source "calico" }}'
- name: PATH


scms:
Expand Down
2 changes: 2 additions & 0 deletions updatecli/updatecli.d/updatecilium.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ sources:
release: true
draft: false
prerelease: false
latest: true
versionfilter:
kind: latest

Expand All @@ -27,6 +28,7 @@ targets:
environments:
- name: CILIUM_VERSION
value: '{{ source "cilium" }}'
- name: PATH


scms:
Expand Down
1 change: 1 addition & 0 deletions updatecli/updatecli.d/updateflannel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ targets:
environments:
- name: FLANNEL_VERSION
value: '{{ source "flannel" }}'
- name: PATH


scms:
Expand Down

0 comments on commit 89690ae

Please sign in to comment.