From 2f73e44b7ce092ff76c4110e69ad880efd17754e Mon Sep 17 00:00:00 2001 From: Gene Liverman Date: Mon, 13 Dec 2021 15:04:26 -0500 Subject: [PATCH 1/2] Add CI for charts --- .github/workflows/release-helm-charts.yml | 60 +++++++++++++++++++++++ README.md | 1 + helm-charts/vmpooler/values.yaml | 5 +- 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release-helm-charts.yml diff --git a/.github/workflows/release-helm-charts.yml b/.github/workflows/release-helm-charts.yml new file mode 100644 index 0000000..699f9d8 --- /dev/null +++ b/.github/workflows/release-helm-charts.yml @@ -0,0 +1,60 @@ +--- +name: Release Helm charts +on: + push: + # workflow_dispatch: + # inputs: + # tag: + # description: 'Tag in semver format' + # required: true + +jobs: + container_prod_all_providers: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 # Checking out the repo + - uses: azure/setup-helm@v1 + - uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Set up chart-testing + uses: helm/chart-testing-action@v2.1.0 + # - name: Run chart-testing (list-changed) + # id: list-changed + # run: | + # changed=$(ct list-changed) + # if [[ -n "$changed" ]]; then + # echo "::set-output name=changed::true" + # fi + - name: Run chart-testing (lint) + run: ct lint --chart-dirs helm-charts --all --validate-maintainers=false --chart-repos bitnami=https://charts.bitnami.com/bitnami + # - name: Package charts + # run: | + # set -e + # cd docs/ + # helm package ../helm-charts/* + # - name: Generate Release Body + # env: + # RELEASE_BODY_FILE: "${{ github.event.inputs.tag }}-prod-all-providers-release-body.md" + # run: | + # echo "## Components" > ${RELEASE_BODY_FILE} + # echo "" >> ${RELEASE_BODY_FILE} + # echo "This release includes the following:" >> ${RELEASE_BODY_FILE} + # echo "" >> ${RELEASE_BODY_FILE} + # echo "### Source image" >> ${RELEASE_BODY_FILE} + # echo "" >> ${RELEASE_BODY_FILE} + # echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE} + # echo "" >> ${RELEASE_BODY_FILE} + # echo "### Gems" >> ${RELEASE_BODY_FILE} + # echo "" >> ${RELEASE_BODY_FILE} + # echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} + # echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} + # - name: Tag Release + # uses: ncipollo/release-action@v1 + # with: + # tag: ${{ github.event.inputs.tag }}-prod-all-providers + # token: ${{ secrets.GITHUB_TOKEN }} + # draft: false + # prerelease: false + # bodyFile: ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md + # generateReleaseNotes: true \ No newline at end of file diff --git a/README.md b/README.md index 102380f..80878cb 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ cd docs/ helm package ../helm-charts/* helm repo index --url https://puppetlabs.github.io/vmpooler-deployment/ . git add . +cd .. git commit -a ``` diff --git a/helm-charts/vmpooler/values.yaml b/helm-charts/vmpooler/values.yaml index b417632..80f7746 100644 --- a/helm-charts/vmpooler/values.yaml +++ b/helm-charts/vmpooler/values.yaml @@ -161,7 +161,8 @@ pools: snapshot_mainMem_iowait: '5' network: 'vmpooler1' - name: 'centos-6-x86_64-pixa4' - alias: [ 'centos-6-x86_64' ] + alias: + - 'centos-6-x86_64' template: 'templates/cluster2/centos-6.8-x86_64-0.0.2-8gb' folder: test-instance/cluster2/centos-6-x86_64' datastore: 'vmpooler_cluster2' @@ -172,4 +173,4 @@ pools: provider: 'vsphere-ci67' snapshot_mainMem_ioBlockPages: '2048' snapshot_mainMem_iowait: '5' - network: 'vmpooler2' \ No newline at end of file + network: 'vmpooler2' From da6634ee644b85f1f65f126640397a36a209fee0 Mon Sep 17 00:00:00 2001 From: Samuel Beaulieu Date: Tue, 26 Apr 2022 15:29:44 -0500 Subject: [PATCH 2/2] helm chart deploy run step --- .github/workflows/release-helm-charts.yml | 94 ++++++++++++----------- 1 file changed, 51 insertions(+), 43 deletions(-) diff --git a/.github/workflows/release-helm-charts.yml b/.github/workflows/release-helm-charts.yml index 699f9d8..02adca1 100644 --- a/.github/workflows/release-helm-charts.yml +++ b/.github/workflows/release-helm-charts.yml @@ -2,59 +2,67 @@ name: Release Helm charts on: push: - # workflow_dispatch: - # inputs: - # tag: - # description: 'Tag in semver format' - # required: true + workflow_dispatch: + inputs: + tag: + description: 'Tag in semver format' + required: true jobs: container_prod_all_providers: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 # Checking out the repo + - uses: actions/checkout@v2 + with: + fetch-depth: 0 # ct list-changed below needs this - uses: azure/setup-helm@v1 - uses: actions/setup-python@v2 with: python-version: 3.7 - name: Set up chart-testing uses: helm/chart-testing-action@v2.1.0 - # - name: Run chart-testing (list-changed) - # id: list-changed - # run: | - # changed=$(ct list-changed) - # if [[ -n "$changed" ]]; then - # echo "::set-output name=changed::true" - # fi + - name: Run chart-testing (list-changed) + id: list-changed + run: | + changed=$(ct list-changed --chart-dirs helm-charts --target-branch main) + if [[ -n "$changed" ]]; then + echo "::set-output name=changed::true" + fi - name: Run chart-testing (lint) run: ct lint --chart-dirs helm-charts --all --validate-maintainers=false --chart-repos bitnami=https://charts.bitnami.com/bitnami - # - name: Package charts - # run: | - # set -e - # cd docs/ - # helm package ../helm-charts/* - # - name: Generate Release Body - # env: - # RELEASE_BODY_FILE: "${{ github.event.inputs.tag }}-prod-all-providers-release-body.md" - # run: | - # echo "## Components" > ${RELEASE_BODY_FILE} - # echo "" >> ${RELEASE_BODY_FILE} - # echo "This release includes the following:" >> ${RELEASE_BODY_FILE} - # echo "" >> ${RELEASE_BODY_FILE} - # echo "### Source image" >> ${RELEASE_BODY_FILE} - # echo "" >> ${RELEASE_BODY_FILE} - # echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE} - # echo "" >> ${RELEASE_BODY_FILE} - # echo "### Gems" >> ${RELEASE_BODY_FILE} - # echo "" >> ${RELEASE_BODY_FILE} - # echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} - # echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} - # - name: Tag Release - # uses: ncipollo/release-action@v1 - # with: - # tag: ${{ github.event.inputs.tag }}-prod-all-providers - # token: ${{ secrets.GITHUB_TOKEN }} - # draft: false - # prerelease: false - # bodyFile: ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md - # generateReleaseNotes: true \ No newline at end of file + - name: Package charts + run: | + set -e + cd docs/ + helm package ../helm-charts/* + helm repo index --url https://puppetlabs.github.io/vmpooler-deployment/ . + - uses: EndBug/add-and-commit@v9 # You can change this to use a specific version. + with: + add: docs + message: release helm-chart version ${{ github.event.inputs.tag }} + - name: Generate Release Body + env: + RELEASE_BODY_FILE: "${{ github.event.inputs.tag }}-prod-all-providers-release-body.md" + run: | + echo "#Components" > ${RELEASE_BODY_FILE} + echo "" >> ${RELEASE_BODY_FILE} + echo "This release includes the following:" >> ${RELEASE_BODY_FILE} + echo "" >> ${RELEASE_BODY_FILE} + echo "##Source image" >> ${RELEASE_BODY_FILE} + echo "" >> ${RELEASE_BODY_FILE} + echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE} + echo "" >> ${RELEASE_BODY_FILE} + echo "##Gems" >> ${RELEASE_BODY_FILE} + echo "" >> ${RELEASE_BODY_FILE} + echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} + echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE} + echo "${RELEASE_BODY_FILE}" + - name: Tag Release + uses: ncipollo/release-action@v1 + with: + tag: ${{ github.event.inputs.tag }}-prod-all-providers + token: ${{ secrets.GITHUB_TOKEN }} + draft: false + prerelease: false + bodyFile: ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md + generateReleaseNotes: true \ No newline at end of file