Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devops/fairspc 55 GitHub actions #122

Merged
merged 4 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/package_and_push_helm_chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Package and Push Helm Chart

on:
push:
branches:
- dev
- release
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/[email protected]
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
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 }}