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

Commit

Permalink
Merge fb7f97f into 933df6c
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Wiedemann authored Jul 6, 2023
2 parents 933df6c + fb7f97f commit ae67790
Show file tree
Hide file tree
Showing 13 changed files with 196 additions and 9 deletions.
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 }}
99 changes: 99 additions & 0 deletions .github/workflows/pre-release-helm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Pre-Release

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

jobs:
generate-version:
runs-on: ubuntu-latest

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

steps:
- uses: actions/checkout@v2

- 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 }}

- name: Get PR Number
id: pr_number
run: echo "::set-output name=nr::$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')"

- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION}-PRE-${{ steps.pr_number.outputs.nr }})"

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: true
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
File renamed without changes.
File renamed without changes.
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

0 comments on commit ae67790

Please sign in to comment.