Skip to content

Commit

Permalink
refactor: Release process (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp authored Feb 25, 2024
1 parent 78b5646 commit d7a1c27
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/merge-main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: semantic release

on:
workflow_run:
workflows: [ Pull Request Closed ]
types: [ completed ]
push:
branches: [main]
paths-ignore:
- '*.md'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
Expand All @@ -21,10 +22,18 @@ jobs:
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: package helm chart
shell: bash
run: |
APP_VERSION=$(yq '.metabase.metabaseImage.tag' charts/nr-metabase/values.yaml)
# remove v from version as it only needs the numbers without v
VERSION=$(echo $APP_VERSION | sed 's/v//')
helm package -u --destination=.cr-release-packages --app-version="$APP_VERSION" --version=$VERSION charts/${{ github.event.repository.name }}
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.6.0
uses: helm/chart-releaser-action@v1.5.0
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
with:
skip_packaging: 'true'


2 changes: 1 addition & 1 deletion .github/workflows/on-pr-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
id: read_yaml
shell: bash
run: |
appVersion=$(yq '.appVersion' charts/nr-metabase/Chart.yaml)
appVersion=$(yq '.metabase.metabaseImage.tag' charts/nr-metabase/values.yaml)
echo "app version is $appVersion"
echo "app_version=$appVersion" >> "$GITHUB_OUTPUT"
if [ "$appVersion" != '' ]; then
Expand Down
2 changes: 1 addition & 1 deletion charts/nr-metabase/templates/metabase/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
- name: {{ include "metabase.fullname" . }}
securityContext:
{{- toYaml .Values.metabase.securityContext | nindent 12 }}
image: "image-registry.openshift-image-registry.svc:5000/{{.Release.Namespace}}/{{ include "metabase.fullname" . }}:{{ .Chart.AppVersion }}"
image: "image-registry.openshift-image-registry.svc:5000/{{.Release.Namespace}}/{{ include "metabase.fullname" . }}:{{ .Values.metabase.metabaseImage.tag }}"
imagePullPolicy: {{ .Values.metabase.image.pullPolicy }}
env:
- name: MB_DB_DBNAME
Expand Down
4 changes: 2 additions & 2 deletions charts/nr-metabase/templates/metabase/is.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
lookupPolicy:
local: false
tags:
- name: "{{ .Chart.AppVersion }}"
- name: "{{ .Values.metabase.metabaseImage.tag }}"
from:
kind: DockerImage
name: "{{ .Values.metabase.image.repository }}:{{ .Chart.AppVersion }}"
name: "{{ .Values.metabase.image.repository }}:{{ .Values.metabase.metabaseImage.tag }}"
referencePolicy:
type: Local
4 changes: 1 addition & 3 deletions charts/nr-metabase/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ global:
helm.sh/policy: "keep"
zone: 'prod' # it is required, could be pr-123, dev, test, prod
domain: "apps.silver.devops.gov.bc.ca" # it is required, apps.silver.devops.gov.bc.ca for silver cluster

metabase:
enabled: true
replicaCount: 1
Expand All @@ -21,8 +21,6 @@ metabase:
image:
repository: ghcr.io/bcgov/nr-metabase/metabase
pullPolicy: Always
# this is for renovate give updated image alert.
tag: 0.48.6
# the below is for renovate to keep pushing PRs, so that it keeps getting updated.
metabaseImage:
repository: metabase/metabase
Expand Down

0 comments on commit d7a1c27

Please sign in to comment.