Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Pure helm #1

Merged
merged 19 commits into from
Jul 7, 2023
50 changes: 50 additions & 0 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Check PR

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
branches:
- main

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '11'
java-package: jdk

- id: bump
uses: zwaldowski/match-label-action@v1
with:
allowed: major,minor,patch

- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.bump.outputs.match }}
github_token: ${{ secrets.GITHUB_TOKEN }}

comment:
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@v2
- name: Checkout
uses: actions/checkout@v1

- name: Comment PR
if: env.WORKFLOW_CONCLUSION == 'failure'
uses: thollander/[email protected]
with:
message: "Please apply one of the following labels to the PR: 'patch', 'minor', 'major'."
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
97 changes: 97 additions & 0 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Pre-Release

on:
push:
branches:
- main

jobs:

generate-version:
runs-on: ubuntu-latest

outputs:
version: ${{ steps.out.outputs.version }}

steps:
- uses: actions/checkout@v2

- uses: actions/setup-java@v1
with:
java-version: '17'
java-package: jdk

- id: pr
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.pr.outputs.labels }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION})"

deploy:

needs: [ "generate-version" ]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Fetch history
run: git fetch --prune --unshallow

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"

# See https://github.com/helm/chart-releaser-action/issues/6
- name: Install Helm
run: |
curl -fsSLo get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh

# prepare yaml parser
- uses: actions/setup-go@v4
- name: Install yq
run: |
go install github.com/mikefarah/yq/v4@latest
yq --version

- name: Generate Chart.yaml
run: |
./generate.sh ${{ needs.generate-version.outputs.version }}


- name: Install releaser
run: |
wget https://github.com/helm/chart-releaser/releases/download/v1.6.0/chart-releaser_1.6.0_linux_amd64.tar.gz
tar -xvzf chart-releaser_1.6.0_linux_amd64.tar.gz
./cr package charts/data-space-connector
./cr upload --owner ${GITHUB_REPOSITORY_OWNER} --git-repo data-space-connector --packages-with-index --token ${{ secrets.GITHUB_TOKEN }} --push --skip-existing
./cr index --owner ${GITHUB_REPOSITORY_OWNER} --git-repo data-space-connector --packages-with-index --index-path . --token ${{ secrets.GITHUB_TOKEN }} --push

git-release:
needs: ["generate-version","deploy"]
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v2

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ needs.generate-version.outputs.version }}
prerelease: false
title: ${{ needs.generate-version.outputs.version }}
files: |
LICENSE
2 changes: 1 addition & 1 deletion applications/credentials-config-service/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: ccs
name: credentials-config-service
description: Chart holder for argo-cd

type: application
Expand Down
2 changes: 1 addition & 1 deletion applications/mongodb/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: mongo-db
name: mongodb
description: Chart holder for argo-cd

type: application
Expand Down
2 changes: 1 addition & 1 deletion applications/trusted-issuers-list/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: packetdelivery-til
name: trusted-issuers-list
description: Chart holder for argo-cd

type: application
Expand Down
2 changes: 1 addition & 1 deletion applications/verifier/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: vcverifier
name: verifier
description: Chart holder for argo-cd

type: application
Expand Down
2 changes: 1 addition & 1 deletion applications/walt-id/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: vcwaltid
name: walt-id
description: Chart holder for argo-cd

type: application
Expand Down
8 changes: 5 additions & 3 deletions data-space-connector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
apiVersion: v2
name: fiware-platform
description: Helm chart to deploy the FIWARE Data pace Connector
name: data-space-connector
description: Helm chart to deploy the FIWARE Data Space Connector
type: application
version: 1.0.0
maintainers:
- name: Dennis Wendland
email: [email protected]

- name: Stefan Wiedemann
email: [email protected]
dependencies: []
2 changes: 2 additions & 0 deletions data-space-connector/templates/argo-application.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.argoApplications }}
{{- if .Values.applications }}
{{- $secrets := .Values.secretsEnabled }}
{{- $release := .Values.release }}
Expand Down Expand Up @@ -109,3 +110,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
4 changes: 3 additions & 1 deletion data-space-connector/values.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# should argo-cd applications be created?
argoApplications: true
source: https://github.com/FIWARE-Ops/data-space-connector
release: demo
destination_namespace: &destination dsc-demo
Expand Down Expand Up @@ -35,7 +37,7 @@ applications:

- name: orion
enabled: true
source_path: applications/orion
source_path: applications/orion-ld
source_ref: *branch
destination: *destination
helm_values:
Expand Down
32 changes: 32 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# move to a charts folder
mkdir charts
cp -r data-space-connector charts/

dscChartFolder=charts/data-space-connector
cp -R applications/. $dscChartFolder/charts/



for f in $(find $dscChartFolder/charts -name 'Chart.yaml'); do
name=$(yq eval .name $f);
version=$(yq eval .version $f);
yq eval -i '.dependencies += {"name":"'$name'","version":"'$version'", "repository":"file://./charts/'$name'"}' $dscChartFolder/Chart.yaml
done
echo \ >> $dscChartFolder/values.yaml
echo \ >> $dscChartFolder/values.yaml
echo '#Sub-Chart configuration configuration' >> $dscChartFolder/values.yaml
for dir in $dscChartFolder/charts/*/; do
chartsFile=${dir}Chart.yaml
valuesFile=${dir}values.yaml
name=$(yq e '.name' $chartsFile)

echo \ >> $dscChartFolder/values.yaml
echo $name: >> $dscChartFolder/values.yaml
cat $valuesFile | sed 's/^/ /' >> $dscChartFolder/values.yaml

helm dependency build ${dir}
done
# fix values in the chart yaml
version="${1:=0.0.0}"
yq e -i '.version = "'$version'"' $dscChartFolder/Chart.yaml