diff --git a/.github/workflows/release-develop.yaml b/.github/workflows/release-develop.yaml new file mode 100644 index 000000000..3ebf363d3 --- /dev/null +++ b/.github/workflows/release-develop.yaml @@ -0,0 +1,91 @@ +name: Update Helm charts - develop + +on: + push: + branches: + - develop + + paths: + - 'charts/testkube-cloud-api/templates/**' + - 'charts/testkube-cloud-api/values.yaml' + - 'charts/testkube-cloud-ui/templates/**' + - 'charts/testkube-cloud-ui/values.yaml' + - 'charts/testkube-enterprise/templates/**' + - 'charts/testkube-enterprise/values.yaml' + +jobs: + release-helm-charts: + name: Release Helm charts + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install Helm + uses: azure/setup-helm@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + + + - name: Update Helm chart with changes files + run: | + echo "Testkube Helm charts diff" + changed_files=$(git --no-pager diff HEAD~1 charts) + + if [[ "$changed_files" == *"testkube-cloud-api/"* ]]; then + echo "Changes detected in files within the 'testkube-cloud-api' directory. Updating the chart minor version." + ./scripts/update.sh -c testkube-cloud-api --strategy minor + new_chart_version=$(./scripts/update.sh -c testkube-cloud-api --print-chart-version) + echo "New testkube-cloud-api chart version is $new_chart_version" >> $GITHUB_STEP_SUMMARY + else + echo "No changes detected in the specified directories." + fi + + if [[ "$changed_files" == *"testkube-cloud-ui/"* ]]; then + echo "Changes detected in files within the 'testkube-cloud-ui' directory. Updating the chart minor version." + ./scripts/update.sh -c testkube-cloud-ui --strategy minor + new_chart_version=$(./scripts/update.sh -c testkube-cloud-ui --print-chart-version) + echo "New testkube-cloud-ui chart version is $new_chart_version" >> $GITHUB_STEP_SUMMARY + else + echo "No changes detected in the specified directories." + fi + + - name: Update Testkube Enterprise Helm chart + run: | + + echo "Syncing subchart versions in testkube-enterprise Helm chart" + ./scripts/sync.sh + + echo "Bumping testkube-enterprise Helm-chart version" + ./scripts/update.sh -c testkube-enterprise --strategy minor + + #get Enterprise version + enterprise_chart_version=$(./scripts/update.sh -c testkube-enterprise --print-chart-version) + echo "New testkube-enterprise chart version is $enterprise_chart_version" >> $GITHUB_STEP_SUMMARY + + - name: Lint Helm charts for safety + run: | + helm lint charts/testkube-cloud-ui + helm lint charts/testkube-cloud-api + helm lint charts/testkube-enterprise + + - name: Install Helm Docs + uses: envoy/install-helm-docs@v1.0.0 + with: + version: 1.11.0 + + - name: Update Helm Docs + run: | + set -ex + helm-docs + + - name: Commit & push changes + run: | + git config --global user.name "testkube-cloud-ci-bot" + git config --global user.email "testkube-cloud-ci-bot@users.noreply.github.com" + git status + git add **/*Chart.yaml **/*README.md + git commit -m "Updating helm-chart versions and README files" + git push \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9d7775819..b0acc9573 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,8 @@ # Chart dependencies charts/testkube-cloud-api/charts/*.tgz charts/testkube-cloud-ui/charts/*.tgz +charts/testkube-enterprise/charts/*.tgz # OSX .DS_Store -**/.DS_Store \ No newline at end of file +**/.DS_Store diff --git a/charts/testkube-cloud-ui/README.md b/charts/testkube-cloud-ui/README.md index 1ec5e3bd1..d85f9c6b6 100644 --- a/charts/testkube-cloud-ui/README.md +++ b/charts/testkube-cloud-ui/README.md @@ -76,4 +76,4 @@ A Helm chart for Testkube Cloud UI | ui.segment.writeKey | string | `""` | Segment.io write key (overriden by `secretRef` if set) | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) \ No newline at end of file diff --git a/charts/testkube-enterprise/README.md b/charts/testkube-enterprise/README.md index a961779a6..40d82ae84 100644 --- a/charts/testkube-enterprise/README.md +++ b/charts/testkube-enterprise/README.md @@ -152,4 +152,4 @@ A Helm chart for Testkube Enterprise | testkube-cloud-ui.ingress.tlsSecretName | string | `"testkube-enterprise-ui-tls"` | Name of the TLS secret which contains the certificate files | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) +Autogenerated from chart metadata using [helm-docs v1.11.0](https://github.com/norwoodj/helm-docs/releases/v1.11.0) \ No newline at end of file diff --git a/charts/testkube-enterprise/charts/common-2.2.5.tgz b/charts/testkube-enterprise/charts/common-2.2.5.tgz deleted file mode 100644 index 638422cdb..000000000 Binary files a/charts/testkube-enterprise/charts/common-2.2.5.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/charts/dex-0.14.1.tgz b/charts/testkube-enterprise/charts/dex-0.14.1.tgz deleted file mode 100644 index 066d2f1d8..000000000 Binary files a/charts/testkube-enterprise/charts/dex-0.14.1.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/charts/mongodb-13.10.2.tgz b/charts/testkube-enterprise/charts/mongodb-13.10.2.tgz deleted file mode 100644 index 8d047aa99..000000000 Binary files a/charts/testkube-enterprise/charts/mongodb-13.10.2.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/charts/nats-0.14.2.tgz b/charts/testkube-enterprise/charts/nats-0.14.2.tgz deleted file mode 100644 index b451448e8..000000000 Binary files a/charts/testkube-enterprise/charts/nats-0.14.2.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/charts/testkube-cloud-api-1.15.54.tgz b/charts/testkube-enterprise/charts/testkube-cloud-api-1.15.54.tgz deleted file mode 100644 index 2636bdac3..000000000 Binary files a/charts/testkube-enterprise/charts/testkube-cloud-api-1.15.54.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/charts/testkube-cloud-ui-1.15.53.tgz b/charts/testkube-enterprise/charts/testkube-cloud-ui-1.15.53.tgz deleted file mode 100644 index c736ebbf8..000000000 Binary files a/charts/testkube-enterprise/charts/testkube-cloud-ui-1.15.53.tgz and /dev/null differ diff --git a/charts/testkube-enterprise/values.yaml b/charts/testkube-enterprise/values.yaml index 606f63d10..5db5eb466 100644 --- a/charts/testkube-enterprise/values.yaml +++ b/charts/testkube-enterprise/values.yaml @@ -172,6 +172,7 @@ testkube-cloud-api: prometheus: enabled: true ingress: + enabled: true testkube-cloud-ui: fullnameOverride: testkube-enterprise-ui image: diff --git a/scripts/update.sh b/scripts/update.sh index b3c810ec7..85c9e4a71 100755 --- a/scripts/update.sh +++ b/scripts/update.sh @@ -7,9 +7,9 @@ # -v|--helm-version to specify the versions, and -c|--chart # # to provide the name of the chart. # # # -# Note: If -v|--helm-version is not provided, the latest Git tag is used # -# as the Helm version. If --strategy is specified, the Helm version is # -# bumped based on the specified strategy. # +# Note: If -v|--helm-version is not provided, we take the latest version # +# in Chart.yaml file and bump it. If --strategy is specified, the Helm version # +# is bumped based on the specified strategy. # ################################################################################ ## VARIABLES @@ -216,9 +216,12 @@ fi show "Updating chart $chart_path" + +chart_yaml_path="${chart_path}/Chart.yaml" + # use latest git tag if helm_version is not specified if [[ -z "$helm_version" ]]; then - helm_version=$(git describe --abbrev=0 --tags) + helm_version=$(grep -E '^version:' "$chart_yaml_path" | awk '{print $2}') if [[ -z "$helm_version" ]]; then err "Helm version not specified or available. Use the -v|--helm-version flag or ensure there are Git tags." usage @@ -236,8 +239,6 @@ fi show "Current Helm chart version: $helm_version" -chart_yaml_path="${chart_path}/Chart.yaml" - if [[ "$print_chart_version" == true ]]; then print_chart_version exit 0