Skip to content

Commit da6634e

Browse files
author
Samuel Beaulieu
committed
helm chart deploy run step
1 parent 2f73e44 commit da6634e

File tree

1 file changed

+51
-43
lines changed

1 file changed

+51
-43
lines changed

.github/workflows/release-helm-charts.yml

Lines changed: 51 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,67 @@
22
name: Release Helm charts
33
on:
44
push:
5-
# workflow_dispatch:
6-
# inputs:
7-
# tag:
8-
# description: 'Tag in semver format'
9-
# required: true
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Tag in semver format'
9+
required: true
1010

1111
jobs:
1212
container_prod_all_providers:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2 # Checking out the repo
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # ct list-changed below needs this
1618
- uses: azure/setup-helm@v1
1719
- uses: actions/setup-python@v2
1820
with:
1921
python-version: 3.7
2022
- name: Set up chart-testing
2123
uses: helm/[email protected]
22-
# - name: Run chart-testing (list-changed)
23-
# id: list-changed
24-
# run: |
25-
# changed=$(ct list-changed)
26-
# if [[ -n "$changed" ]]; then
27-
# echo "::set-output name=changed::true"
28-
# fi
24+
- name: Run chart-testing (list-changed)
25+
id: list-changed
26+
run: |
27+
changed=$(ct list-changed --chart-dirs helm-charts --target-branch main)
28+
if [[ -n "$changed" ]]; then
29+
echo "::set-output name=changed::true"
30+
fi
2931
- name: Run chart-testing (lint)
3032
run: ct lint --chart-dirs helm-charts --all --validate-maintainers=false --chart-repos bitnami=https://charts.bitnami.com/bitnami
31-
# - name: Package charts
32-
# run: |
33-
# set -e
34-
# cd docs/
35-
# helm package ../helm-charts/*
36-
# - name: Generate Release Body
37-
# env:
38-
# RELEASE_BODY_FILE: "${{ github.event.inputs.tag }}-prod-all-providers-release-body.md"
39-
# run: |
40-
# echo "## Components" > ${RELEASE_BODY_FILE}
41-
# echo "" >> ${RELEASE_BODY_FILE}
42-
# echo "This release includes the following:" >> ${RELEASE_BODY_FILE}
43-
# echo "" >> ${RELEASE_BODY_FILE}
44-
# echo "### Source image" >> ${RELEASE_BODY_FILE}
45-
# echo "" >> ${RELEASE_BODY_FILE}
46-
# echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE}
47-
# echo "" >> ${RELEASE_BODY_FILE}
48-
# echo "### Gems" >> ${RELEASE_BODY_FILE}
49-
# echo "" >> ${RELEASE_BODY_FILE}
50-
# echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
51-
# echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
52-
# - name: Tag Release
53-
# uses: ncipollo/release-action@v1
54-
# with:
55-
# tag: ${{ github.event.inputs.tag }}-prod-all-providers
56-
# token: ${{ secrets.GITHUB_TOKEN }}
57-
# draft: false
58-
# prerelease: false
59-
# bodyFile: ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md
60-
# generateReleaseNotes: true
33+
- name: Package charts
34+
run: |
35+
set -e
36+
cd docs/
37+
helm package ../helm-charts/*
38+
helm repo index --url https://puppetlabs.github.io/vmpooler-deployment/ .
39+
- uses: EndBug/add-and-commit@v9 # You can change this to use a specific version.
40+
with:
41+
add: docs
42+
message: release helm-chart version ${{ github.event.inputs.tag }}
43+
- name: Generate Release Body
44+
env:
45+
RELEASE_BODY_FILE: "${{ github.event.inputs.tag }}-prod-all-providers-release-body.md"
46+
run: |
47+
echo "#Components" > ${RELEASE_BODY_FILE}
48+
echo "" >> ${RELEASE_BODY_FILE}
49+
echo "This release includes the following:" >> ${RELEASE_BODY_FILE}
50+
echo "" >> ${RELEASE_BODY_FILE}
51+
echo "##Source image" >> ${RELEASE_BODY_FILE}
52+
echo "" >> ${RELEASE_BODY_FILE}
53+
echo "- $(grep ^FROM ./docker/prod-all-providers/Dockerfile |cut -d ' ' -f2) + OS updates" >> ${RELEASE_BODY_FILE}
54+
echo "" >> ${RELEASE_BODY_FILE}
55+
echo "##Gems" >> ${RELEASE_BODY_FILE}
56+
echo "" >> ${RELEASE_BODY_FILE}
57+
echo "$(grep -e 'vmpooler ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
58+
echo "$(grep -e 'vmpooler-provider-.* ([0-9]' docker/prod-all-providers/Gemfile.lock | xargs -L1 echo -)" >> ${RELEASE_BODY_FILE}
59+
echo "${RELEASE_BODY_FILE}"
60+
- name: Tag Release
61+
uses: ncipollo/release-action@v1
62+
with:
63+
tag: ${{ github.event.inputs.tag }}-prod-all-providers
64+
token: ${{ secrets.GITHUB_TOKEN }}
65+
draft: false
66+
prerelease: false
67+
bodyFile: ${{ github.event.inputs.tag }}-prod-all-providers-release-body.md
68+
generateReleaseNotes: true

0 commit comments

Comments
 (0)