Skip to content

Commit 361f395

Browse files
committed
💚(circle) test helm with ralph build image
In the `test-helm` job, we were building Ralph current image but were installing the helm chart without specifying an image tag. When not specified, Helm installs the `appVersion` of the image, fetching it from DockerHub repository and not testing the current build of the image. Changing it so that the job tests the current build of the image for non-tagged workflows, but also tests that the `appVersion` has correctly been filled in for `-helm` tagged workflows.
1 parent 1025643 commit 361f395

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

.circleci/config.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,12 @@ jobs:
367367
kubectl create namespace ci-ralph
368368
kubectl config set-context --current --namespace=ci-ralph
369369
- run:
370-
name: Build production image and publish it to the k8s cluster docker registry
370+
name: Build production image and load it in the k8s cluster docker registry
371371
command: |
372-
export RALPH_IMAGE_BUILD_TARGET=production
373-
export RALPH_IMAGE_TAG=${CIRCLE_SHA1}
374-
make build
375-
minikube image load ralph:${RALPH_IMAGE_TAG}
372+
RALPH_IMAGE_BUILD_TARGET=production \
373+
RALPH_IMAGE_TAG=${CIRCLE_SHA1} \
374+
make build
375+
minikube image load ralph:${CIRCLE_SHA1}
376376
- run:
377377
name: Deploy Elasticsearch cluster
378378
command: |
@@ -405,6 +405,14 @@ jobs:
405405
sed -i -e "s|<PASSWORD>|${ELASTIC_PASSWORD}|g" manifests/ralph-env-secret.yaml
406406
kubectl apply -f manifests/ralph-env-secret.yaml
407407
kubectl apply -f manifests/ralph-env-cm.yaml
408+
if [[ -z "${CIRCLE_TAG+x}" ]] || ! [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-helm$ ]]; then
409+
# Not a tagged workflow, or tagged but not for a Helm release:
410+
# change the repository and app version for the currently built version
411+
sed -i "s|repository:.*$|repository: docker.io/library/ralph|" development.yaml
412+
sed -i "s|tag:.*$|tag: \"${CIRCLE_SHA1}\"|" development.yaml
413+
fi
414+
415+
# Install Ralph
408416
helm install -f development.yaml lrs ralph/
409417
410418
# Test the deployment/switch

0 commit comments

Comments
 (0)