Skip to content

Commit

Permalink
feat: add helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosthe19916 committed Nov 13, 2024
1 parent 9077b67 commit bcd45df
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 6 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/helm-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Helm Chart Build

on:
workflow_dispatch:
push:
branches:
- "main"
- "release-*"

concurrency:
group: helm-${{ github.ref }}
cancel-in-progress: true

jobs:
prepare:
runs-on: ubuntu-latest
steps:
- name: Extract tag
id: extract_tag
run: |
tag=$(if [[ ${{github.ref_name}} == v* ]];then echo "${{github.ref_name}}"; else echo "latest"; fi)
echo "tag=$tag" >> $GITHUB_OUTPUT
outputs:
tag: ${{ steps.extract_tag.outputs.tag }}

helm-build:
runs-on: ubuntu-latest
needs:
- prepare
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
cache: "maven"
- name: Create Helm
run: |
## Set -Dquarkus.container-image.tag as empty to remove the "v" prefix from the container image of Deployment
mvn package -DskipTests -Dquarkus.container-image.tag=
# YQ
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq
APP_IMAGE_TAG=$TAG yq e -i '.appVersion=strenv(APP_IMAGE_TAG)' target/helm/Chart.yaml
env:
TAG: ${{ needs.prepare.outputs.tag }}
- name: Git add Helm
id: git-add-helm
continue-on-error: true
run: |
cp -R target/helm/ ./
if [ -z $(git status --porcelain) ]; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo git status
git add helm/*
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit and Push
uses: trustification/release-tools/.github/actions/commit@main
if: steps.git-add-helm.outputs.has_changes == 'true'
with:
commit_message: "🔅 Helm chart update"
branch: ${{github.ref_name}}
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# Quick Start - Helm Chart

If you want to give a quick try of the operator without the whole glory of OLM you can deploy our Operator using Helm.

- Start minikube:

```shell
minikube start --addons=ingress,dashboard
```

- Install the Helm Chart:

```shell
helm install myhelm helm/
```

- Create an instance of Trustify:

```shell
cat << EOF | kubectl apply -f -
apiVersion: "org.trustify/v1alpha1"
kind: "Trustify"
metadata:
name: myapp
spec: { }
EOF
```

# Local development

## Minikube
Expand Down
9 changes: 3 additions & 6 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ quarkus:
helm:
enabled: true
# https://quarkus.io/guides/deploying-to-kubernetes#environment-variables-from-keyvalue-pairs
openshift:
env:
vars:
related-image-trustify-server: ${related.image.server}
related-image-db: ${related.image.db}
related-image-importer: ${related.image.importer}
kubernetes:
idempotent: "true"
prometheus:
generate-service-monitor: "false"
env:
vars:
related-image-trustify-server: ${related.image.server}
Expand Down

0 comments on commit bcd45df

Please sign in to comment.