From baecfbc55403c170c3280203b9a4be521bd708c5 Mon Sep 17 00:00:00 2001 From: Hamza Qadri Date: Tue, 2 Sep 2025 13:51:59 -0400 Subject: [PATCH 1/2] Restructure directories --- .github/workflows/helm-ci.yaml | 4 ++-- .gitignore | 3 ++- Chart.lock => charts/iag4/Chart.lock | 0 Chart.yaml => charts/iag4/Chart.yaml | 0 {templates => charts/iag4/templates}/NOTES.txt | 0 {templates => charts/iag4/templates}/_helpers.tpl | 0 {templates => charts/iag4/templates}/certificate.yaml | 0 {templates => charts/iag4/templates}/configmap.yaml | 0 {templates => charts/iag4/templates}/configmap_ssh.yaml | 0 {templates => charts/iag4/templates}/ingress.yaml | 0 {templates => charts/iag4/templates}/issuer.yaml | 0 {templates => charts/iag4/templates}/service.yaml | 0 {templates => charts/iag4/templates}/statefulset.yaml | 0 {templates => charts/iag4/templates}/storage-class.yaml | 0 {tests => charts/iag4/tests}/certificate_test.yaml | 0 {tests => charts/iag4/tests}/configmap_ssh_test.yaml | 0 {tests => charts/iag4/tests}/configmap_test.yaml | 0 {tests => charts/iag4/tests}/ingress_test.yaml | 0 {tests => charts/iag4/tests}/issuer_test.yaml | 0 {tests => charts/iag4/tests}/service_test.yaml | 0 {tests => charts/iag4/tests}/statefulset_test.yaml | 0 {tests => charts/iag4/tests}/storage-class_test.yaml | 0 {tests => charts/iag4/tests}/test-values.yaml | 0 values.yaml => charts/iag4/values.yaml | 0 24 files changed, 4 insertions(+), 3 deletions(-) rename Chart.lock => charts/iag4/Chart.lock (100%) rename Chart.yaml => charts/iag4/Chart.yaml (100%) rename {templates => charts/iag4/templates}/NOTES.txt (100%) rename {templates => charts/iag4/templates}/_helpers.tpl (100%) rename {templates => charts/iag4/templates}/certificate.yaml (100%) rename {templates => charts/iag4/templates}/configmap.yaml (100%) rename {templates => charts/iag4/templates}/configmap_ssh.yaml (100%) rename {templates => charts/iag4/templates}/ingress.yaml (100%) rename {templates => charts/iag4/templates}/issuer.yaml (100%) rename {templates => charts/iag4/templates}/service.yaml (100%) rename {templates => charts/iag4/templates}/statefulset.yaml (100%) rename {templates => charts/iag4/templates}/storage-class.yaml (100%) rename {tests => charts/iag4/tests}/certificate_test.yaml (100%) rename {tests => charts/iag4/tests}/configmap_ssh_test.yaml (100%) rename {tests => charts/iag4/tests}/configmap_test.yaml (100%) rename {tests => charts/iag4/tests}/ingress_test.yaml (100%) rename {tests => charts/iag4/tests}/issuer_test.yaml (100%) rename {tests => charts/iag4/tests}/service_test.yaml (100%) rename {tests => charts/iag4/tests}/statefulset_test.yaml (100%) rename {tests => charts/iag4/tests}/storage-class_test.yaml (100%) rename {tests => charts/iag4/tests}/test-values.yaml (100%) rename values.yaml => charts/iag4/values.yaml (100%) diff --git a/.github/workflows/helm-ci.yaml b/.github/workflows/helm-ci.yaml index 48a2d7f..fd4d107 100644 --- a/.github/workflows/helm-ci.yaml +++ b/.github/workflows/helm-ci.yaml @@ -25,7 +25,7 @@ jobs: run: helm plugin install https://github.com/helm-unittest/helm-unittest - name: Lint Helm chart - run: helm lint . + run: helm lint charts/iag4 - name: Run Helm unit tests - run: helm unittest . --strict + run: helm unittest --strict charts/iag4 diff --git a/.gitignore b/.gitignore index 9e78743..12795a0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,6 @@ values-*.local.yaml secrets/ *.secret.yaml lab-setup/ -charts/ +charts/*/charts/*.tgz +.cr-release-packages/ *.tgz diff --git a/Chart.lock b/charts/iag4/Chart.lock similarity index 100% rename from Chart.lock rename to charts/iag4/Chart.lock diff --git a/Chart.yaml b/charts/iag4/Chart.yaml similarity index 100% rename from Chart.yaml rename to charts/iag4/Chart.yaml diff --git a/templates/NOTES.txt b/charts/iag4/templates/NOTES.txt similarity index 100% rename from templates/NOTES.txt rename to charts/iag4/templates/NOTES.txt diff --git a/templates/_helpers.tpl b/charts/iag4/templates/_helpers.tpl similarity index 100% rename from templates/_helpers.tpl rename to charts/iag4/templates/_helpers.tpl diff --git a/templates/certificate.yaml b/charts/iag4/templates/certificate.yaml similarity index 100% rename from templates/certificate.yaml rename to charts/iag4/templates/certificate.yaml diff --git a/templates/configmap.yaml b/charts/iag4/templates/configmap.yaml similarity index 100% rename from templates/configmap.yaml rename to charts/iag4/templates/configmap.yaml diff --git a/templates/configmap_ssh.yaml b/charts/iag4/templates/configmap_ssh.yaml similarity index 100% rename from templates/configmap_ssh.yaml rename to charts/iag4/templates/configmap_ssh.yaml diff --git a/templates/ingress.yaml b/charts/iag4/templates/ingress.yaml similarity index 100% rename from templates/ingress.yaml rename to charts/iag4/templates/ingress.yaml diff --git a/templates/issuer.yaml b/charts/iag4/templates/issuer.yaml similarity index 100% rename from templates/issuer.yaml rename to charts/iag4/templates/issuer.yaml diff --git a/templates/service.yaml b/charts/iag4/templates/service.yaml similarity index 100% rename from templates/service.yaml rename to charts/iag4/templates/service.yaml diff --git a/templates/statefulset.yaml b/charts/iag4/templates/statefulset.yaml similarity index 100% rename from templates/statefulset.yaml rename to charts/iag4/templates/statefulset.yaml diff --git a/templates/storage-class.yaml b/charts/iag4/templates/storage-class.yaml similarity index 100% rename from templates/storage-class.yaml rename to charts/iag4/templates/storage-class.yaml diff --git a/tests/certificate_test.yaml b/charts/iag4/tests/certificate_test.yaml similarity index 100% rename from tests/certificate_test.yaml rename to charts/iag4/tests/certificate_test.yaml diff --git a/tests/configmap_ssh_test.yaml b/charts/iag4/tests/configmap_ssh_test.yaml similarity index 100% rename from tests/configmap_ssh_test.yaml rename to charts/iag4/tests/configmap_ssh_test.yaml diff --git a/tests/configmap_test.yaml b/charts/iag4/tests/configmap_test.yaml similarity index 100% rename from tests/configmap_test.yaml rename to charts/iag4/tests/configmap_test.yaml diff --git a/tests/ingress_test.yaml b/charts/iag4/tests/ingress_test.yaml similarity index 100% rename from tests/ingress_test.yaml rename to charts/iag4/tests/ingress_test.yaml diff --git a/tests/issuer_test.yaml b/charts/iag4/tests/issuer_test.yaml similarity index 100% rename from tests/issuer_test.yaml rename to charts/iag4/tests/issuer_test.yaml diff --git a/tests/service_test.yaml b/charts/iag4/tests/service_test.yaml similarity index 100% rename from tests/service_test.yaml rename to charts/iag4/tests/service_test.yaml diff --git a/tests/statefulset_test.yaml b/charts/iag4/tests/statefulset_test.yaml similarity index 100% rename from tests/statefulset_test.yaml rename to charts/iag4/tests/statefulset_test.yaml diff --git a/tests/storage-class_test.yaml b/charts/iag4/tests/storage-class_test.yaml similarity index 100% rename from tests/storage-class_test.yaml rename to charts/iag4/tests/storage-class_test.yaml diff --git a/tests/test-values.yaml b/charts/iag4/tests/test-values.yaml similarity index 100% rename from tests/test-values.yaml rename to charts/iag4/tests/test-values.yaml diff --git a/values.yaml b/charts/iag4/values.yaml similarity index 100% rename from values.yaml rename to charts/iag4/values.yaml From 66ffeba3fb97c78a5c1ad2f576e941bb84ea005f Mon Sep 17 00:00:00 2001 From: Hamza Qadri Date: Tue, 2 Sep 2025 13:55:43 -0400 Subject: [PATCH 2/2] Add chart releaser, release workflow --- .cr.yaml | 10 ++++ .github/workflows/release.yaml | 84 ++++++++++++++++++++++++++++++++++ charts/iag4/Chart.yaml | 6 ++- 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 .cr.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.cr.yaml b/.cr.yaml new file mode 100644 index 0000000..a2240d8 --- /dev/null +++ b/.cr.yaml @@ -0,0 +1,10 @@ +owner: Itential +git-repo: iag4-helm +charts-dir: charts +target-branch: main +pages-branch: gh-pages +package-path: .cr-release-packages +index-path: index.yaml +skip-existing: true +generate-release-notes: true +make-release-latest: true diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..31765e1 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,84 @@ +name: Release Charts + +on: + push: + branches: + - main + paths: + - 'charts/**' + +permissions: + contents: write + pages: write + id-token: write + +jobs: + # Create the release + release: + permissions: + contents: write + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "$GITHUB_ACTOR" + git config user.email "$GITHUB_ACTOR@users.noreply.github.com" + + - name: Install Helm + uses: azure/setup-helm@v4 + with: + version: v3.13.0 + + - name: Add dependency chart repos + run: | + helm repo add jetstack https://charts.jetstack.io + helm repo add external-dns https://kubernetes-sigs.github.io/external-dns/ + helm repo update + + - name: Update chart dependencies + run: | + for chart in charts/*/; do + if [ -f "$chart/Chart.yaml" ]; then + echo "Updating dependencies for $chart" + helm dependency update "$chart" + fi + done + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.7.0 + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + with: + config: .cr.yaml + + # Update the Github pages + pages: + needs: release + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/main' + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Checkout gh-pages + uses: actions/checkout@v4 + with: + ref: gh-pages + fetch-depth: 0 + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: . + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/charts/iag4/Chart.yaml b/charts/iag4/Chart.yaml index 929ae54..4190fcd 100644 --- a/charts/iag4/Chart.yaml +++ b/charts/iag4/Chart.yaml @@ -10,7 +10,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.1 +version: 1.0.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -18,6 +18,10 @@ version: 1.0.1 # It is recommended to use it with quotes. appVersion: "4.3.4" +home: https://github.com/itential/iag4-helm +sources: + - https://github.com/itential/iag4-helm + dependencies: - name: cert-manager version: "1.12.3"