Skip to content

Commit

Permalink
fix appVersion to v1.5.0 and sync charts to openyurtio/charts (#2104)
Browse files Browse the repository at this point in the history
  • Loading branch information
rambohe-ch authored Jul 25, 2024
1 parent 07266e0 commit e24a7e1
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 40 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/sync-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ jobs:
- name: Get the version
id: get_version
run: |
echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
echo ::set-output name=TAG::${GITHUB_REF#refs/tags/}
echo "CHART_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Sync to openyurt-helm Repo
- name: Sync to openyurtio/charts Repo
env:
SSH_DEPLOY_KEY: ${{ secrets.SYNC_CHARTS_SECRET }}
VERSION: ${{ steps.get_version.outputs.VERSION }}
TAG: ${{ steps.get_version.outputs.TAG }}
VERSION: ${{ steps.get_version.outputs.CHART_VERSION }}
COMMIT_ID: ${{ github.sha }}
run: |
bash ./hack/lib/sync-charts.sh
2 changes: 1 addition & 1 deletion charts/yurt-coordinator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 1.5.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.5.0"
appVersion: "v1.5.0"
2 changes: 1 addition & 1 deletion charts/yurt-iot-dock/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 1.5.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.5.0"
appVersion: "v1.5.0"
2 changes: 1 addition & 1 deletion charts/yurt-manager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 1.5.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.5.0"
appVersion: "v1.5.0"
2 changes: 1 addition & 1 deletion charts/yurt-manager/templates/yurt-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ spec:
{{- end }}
command:
- /usr/local/bin/yurt-manager
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: IfNotPresent
name: yurt-manager
ports:
Expand Down
2 changes: 1 addition & 1 deletion charts/yurt-manager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ nameOverride: ""
image:
registry: openyurt
repository: yurt-manager
tag: v1.4.0
tag: ""
pullSecrets: []
# pullSecrets:
# - name: myRegistryKeySecretName
Expand Down
2 changes: 1 addition & 1 deletion charts/yurthub/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ version: 1.5.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.5.0"
appVersion: "v1.5.0"
2 changes: 1 addition & 1 deletion charts/yurthub/templates/yurthub-cloud-yurtstaticset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
type: Directory
containers:
- name: yurt-hub
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: hub-dir
Expand Down
2 changes: 1 addition & 1 deletion charts/yurthub/templates/yurthub-yurtstaticset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
type: Directory
containers:
- name: yurt-hub
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}
image: {{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}
imagePullPolicy: IfNotPresent
volumeMounts:
- name: hub-dir
Expand Down
2 changes: 1 addition & 1 deletion charts/yurthub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ organizations: ""
image:
registry: openyurt
repository: yurthub
tag: v1.4.0
tag: ""
52 changes: 26 additions & 26 deletions hack/lib/sync-charts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -l
# Copyright 2020 The OpenYurt Authors.
# Copyright 2024 The OpenYurt Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -26,59 +26,59 @@ echo "git clone"
cd ..
git config --global user.email "[email protected]"
git config --global user.name "openyurt-bot"
git clone --single-branch --depth 1 [email protected]:openyurtio/openyurt-helm.git openyurt-helm
git clone --single-branch --depth 1 [email protected]:openyurtio/charts.git charts

echo "clear openyurt-helm charts/yurt-coordinator"
echo "clear charts/yurt-coordinator in openyurtio/charts"

if [ -d "openyurt-helm/charts/yurt-coordinator" ]
if [ -d "charts/charts/yurt-coordinator" ]
then
echo "charts yurt-coordinator exists, remove it"
rm -r openyurt-helm/charts/yurt-coordinator/*
rm -r charts/charts/yurt-coordinator/*
else
mkdir -p openyurt-helm/charts/yurt-coordinator
mkdir -p charts/charts/yurt-coordinator
fi

echo "clear openyurt-helm charts/yurt-manager"
echo "clear charts/yurt-manager in openyurtio/charts"

if [ -d "openyurt-helm/charts/yurt-manager" ]
if [ -d "charts/charts/yurt-manager" ]
then
echo "charts yurt-manager exists, remove it"
rm -r openyurt-helm/charts/yurt-manager/*
rm -r charts/charts/yurt-manager/*
else
mkdir -p openyurt-helm/charts/yurt-manager
mkdir -p charts/charts/yurt-manager
fi

echo "clear openyurt-helm charts/yurthub"
echo "clear charts/yurthub in openyurtio/charts"

if [ -d "openyurt-helm/charts/yurthub" ]
if [ -d "charts/charts/yurthub" ]
then
echo "charts yurthub exists, remove it"
rm -r openyurt-helm/charts/yurthub/*
rm -r charts/charts/yurthub/*
else
mkdir -p openyurt-helm/charts/yurthub
mkdir -p charts/charts/yurthub
fi

echo "clear openyurt-helm charts/yurt-iot-dock"
echo "clear charts/yurt-iot-dock in openyurtio/charts"

if [ -d "openyurt-helm/charts/yurt-iot-dock" ]
if [ -d "charts/charts/yurt-iot-dock" ]
then
echo "charts yurt-iot-dock exists, remove it"
rm -r openyurt-helm/charts/yurt-iot-dock/*
rm -r charts/charts/yurt-iot-dock/*
else
mkdir -p openyurt-helm/charts/yurt-iot-dock
mkdir -p charts/charts/yurt-iot-dock
fi

echo "copy folder openyurt/charts to openyurt-helm/charts"
echo "copy folder openyurt/charts to openyurtio/charts/charts"

cp -R openyurt/charts/yurt-coordinator/* openyurt-helm/charts/yurt-coordinator/
cp -R openyurt/charts/yurt-manager/* openyurt-helm/charts/yurt-manager/
cp -R openyurt/charts/yurthub/* openyurt-helm/charts/yurthub/
cp -R openyurt/charts/yurt-iot-dock/* openyurt-helm/charts/yurt-iot-dock/
cp -R openyurt/charts/yurt-coordinator/* charts/charts/yurt-coordinator/
cp -R openyurt/charts/yurt-manager/* charts/charts/yurt-manager/
cp -R openyurt/charts/yurthub/* charts/charts/yurthub/
cp -R openyurt/charts/yurt-iot-dock/* charts/charts/yurt-iot-dock/

echo "push to openyurt-helm"
echo "version: $VERSION, commit: $COMMIT_ID, tag: $TAG"
echo "push to openyurtio/charts"
echo "version: $VERSION, commit: $COMMIT_ID"

cd openyurt-helm
cd charts

if [ -z "$(git status --porcelain)" ]; then
echo "nothing need to push, finished!"
Expand Down

0 comments on commit e24a7e1

Please sign in to comment.