Skip to content

Commit 3e20b83

Browse files
authored
Merge pull request #21 from puppetlabs/chart-ci
(DIO-2812) Add CI for charts
2 parents ed0df9d + da6634e commit 3e20b83

File tree

3 files changed

+72
-2
lines changed

3 files changed

+72
-2
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Release Helm charts
3+
on:
4+
push:
5+
workflow_dispatch:
6+
inputs:
7+
tag:
8+
description: 'Tag in semver format'
9+
required: true
10+
11+
jobs:
12+
container_prod_all_providers:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
fetch-depth: 0 # ct list-changed below needs this
18+
- uses: azure/setup-helm@v1
19+
- uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.7
22+
- name: Set up chart-testing
23+
uses: helm/[email protected]
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
31+
- name: Run chart-testing (lint)
32+
run: ct lint --chart-dirs helm-charts --all --validate-maintainers=false --chart-repos bitnami=https://charts.bitnami.com/bitnami
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

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ cd docs/
2626
helm package ../helm-charts/*
2727
helm repo index --url https://puppetlabs.github.io/vmpooler-deployment/ .
2828
git add .
29+
cd ..
2930
git commit -a
3031
```
3132

helm-charts/vmpooler/values.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ pools:
164164
snapshot_mainMem_iowait: '5'
165165
network: 'vmpooler1'
166166
- name: 'centos-6-x86_64-pixa4'
167-
alias: [ 'centos-6-x86_64' ]
167+
alias:
168+
- 'centos-6-x86_64'
168169
template: 'templates/cluster2/centos-6.8-x86_64-0.0.2-8gb'
169170
folder: test-instance/cluster2/centos-6-x86_64'
170171
datastore: 'vmpooler_cluster2'
@@ -175,4 +176,4 @@ pools:
175176
provider: 'vsphere-ci67'
176177
snapshot_mainMem_ioBlockPages: '2048'
177178
snapshot_mainMem_iowait: '5'
178-
network: 'vmpooler2'
179+
network: 'vmpooler2'

0 commit comments

Comments
 (0)