Skip to content

Commit

Permalink
Merge pull request #1635 from DSD-DBS/helm-version
Browse files Browse the repository at this point in the history
build: Derive helm version from Git tags
  • Loading branch information
MoritzWeber0 authored Jul 16, 2024
2 parents b542607 + 8b57da6 commit 725d123
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ helm-deploy:
@kubectl create namespace $(SESSION_NAMESPACE) 2> /dev/null || true
@[[ ! $$(helm dependency list ./helm | grep missing) ]] || helm dependency update ./helm;
@echo "Start helm upgrade..."
HELM_PACKAGE_DIR=$$(mktemp -d)
helm package --app-version=$$(git rev-parse --abbrev-ref HEAD) --version=$$(git describe --tags) -d "$$HELM_PACKAGE_DIR" helm
@helm upgrade --install \
--kube-context k3d-$(CLUSTER_NAME) \
--create-namespace \
Expand All @@ -98,7 +100,8 @@ helm-deploy:
--set cluster.ingressClassName=traefik \
--set cluster.ingressNamespace=kube-system \
--set backend.k8sSessionNamespace="$(SESSION_NAMESPACE)" \
$(RELEASE) ./helm
$(RELEASE) $$HELM_PACKAGE_DIR/collab-manager-*.tgz
rm -rf "$$HELM_PACKAGE_DIR"
$(MAKE) provision-guacamole wait

open:
Expand Down
11 changes: 9 additions & 2 deletions ci-templates/gitlab/k8s-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,20 @@ variables:
# prettier-ignore
- DOCKER_TAG=$(echo $REVISION | sed 's/[^a-zA-Z0-9.]/-/g')-$CI_COMMIT_REF_SLUG
- helm repo add grafana-helm-remote ${GRAFANA_HELM_CHART}
- helm dependency update ./helm
- HELM_PACKAGE_DIR=$(mktemp -d)
- >
helm package \
--app-version="$DOCKER_TAG" \
--version="$(git describe --tags)" \
-d "$HELM_PACKAGE_DIR" \
helm
- >
helm upgrade ${RELEASE} \
--dependency-update \
--namespace ${NAMESPACE} \
--set docker.tag=${DOCKER_TAG} \
-f ../${TARGET}/general.values.yaml \
-f ../plain.values.yaml helm
-f ../plain.values.yaml "$HELM_PACKAGE_DIR"/collab-manager-*.tgz
- kubectl rollout restart deployment ${RELEASE}-backend
- kubectl rollout restart deployment ${RELEASE}-frontend
- kubectl rollout restart deployment ${RELEASE}-docs
Expand Down
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name: collab-manager
description: Capella Collaboration Manager
home: https://github.com/DSD-DBS/capella-collab-manager
type: application
version: 0.0.0 # The version is not used. The version is managed via Git tags.
appVersion: "1.0.0"
version: 0.0.0 # The version is automatically updated by the release process.
appVersion: 0.0.0 # The appVersion is automatically updated by the release process.
dependencies:
- name: loki
alias: loki
Expand Down

0 comments on commit 725d123

Please sign in to comment.