Skip to content

Commit

Permalink
Merge pull request #122 from thehyve/devops/FAIRSPC-55_github_actions
Browse files Browse the repository at this point in the history
Devops/fairspc 55 GitHub actions
  • Loading branch information
tgreenwood authored Apr 8, 2024
2 parents 75ca420 + 793c746 commit 1632b9e
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 138 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/package_and_push_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Package and Push Helm Chart

on:
push:
workflow_dispatch:
inputs:
version:
description: "Version of the Helm chart to push"
required: false

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Prepare version
run: |
VERSION=$(cat ./VERSION)
BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
echo "Building images from the branch: $BRANCH"
if [ $BRANCH != "release" ]; then
VERSION=$VERSION-SNAPSHOT
fi
# override version of custom input is provided
if [[ -n "${{ github.event.inputs.version }}" ]]; then
VERSION=${{ github.event.inputs.version }}
fi
echo "Helm charts version to be deployed: $VERSION"
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Setup Helm
uses: azure/setup-helm@v4.1.0
with:
version: ${{ vars.HELM_VERSION }}

- name: Login with Helm
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ${{ vars.HELM_REGISTRY }} --username ${{ github.repository_owner }} --password-stdin
- name: Add/update Helm dependencies
run: |
helm repo add codecentric https://codecentric.github.io/helm-charts
helm dependency update "charts/fairspace-keycloak"
- name: Lint Helm chart
run: |
helm lint "charts/fairspace-keycloak"
- name: Package Helm chart
run: |
helm package "charts/fairspace-keycloak" --version ${{ env.VERSION }}
- name: Push Helm chart to repository
if: github.ref == 'refs/heads/release' || github.ref == 'refs/heads/dev'
run: |
helm push "fairspace-keycloak-${{ env.VERSION }}.tgz" "oci://${{ vars.HELM_REGISTRY }}"
84 changes: 0 additions & 84 deletions .travis.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .travis/add_pod_annotations.sh

This file was deleted.

Binary file removed .travis/ci-service-account.json.enc
Binary file not shown.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ This repository contains the helm chart to install and setup Keycloak.

See [charts/fairspace-keycloak](charts/fairspace-keycloak/README.md) for more information.

# Deployment scripts
Deployment scripts can be found in the [fairspace-build-scripts](https://github.com/fairspace/fairspace-build-scripts) repository. They are
run by travis-ci, as setup in the `.travis.yml` file.
# Helm chart
Helm charts are packaged and published to the GitHub package registry (Packages) with GitHub Actions workflow, can be found in `.github/workflows/package_and_push_helm_chart.yaml `

```yaml

# License

Expand Down
9 changes: 0 additions & 9 deletions charts/.travis/build.sh

This file was deleted.

16 changes: 0 additions & 16 deletions charts/.travis/install.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ metadata:
name: keycloak-postgresql
type: Opaque
data:
password: {{ .Values.fairspaceKeycloak.postgresql.postgresPassword | default (printf "%s-private" (include "fairspaceKeycloak.name" .)) | b64enc | quote }}
postgres-password: {{ .Values.fairspaceKeycloak.postgresql.postgresPassword | default (printf "%s-postgres-private" (include "fairspaceKeycloak.name" .)) | b64enc | quote }}
password: {{ (.Values.fairspaceKeycloak.postgresql).postgresPassword | default (printf "%s-private" (include "fairspaceKeycloak.name" .)) | b64enc | quote }}
postgres-password: {{ (.Values.fairspaceKeycloak.postgresql).postgresPassword | default (printf "%s-postgres-private" (include "fairspaceKeycloak.name" .)) | b64enc | quote }}

0 comments on commit 1632b9e

Please sign in to comment.