Commit b12bbbbb authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

fix conditional fetching of rabbitmq credentials

parent a352f037
...@@ -144,27 +144,6 @@ build-client: ...@@ -144,27 +144,6 @@ build-client:
API_URL: "https://jass-${CI_COMMIT_REF_SLUG}.dev.pasteur.cloud/api" API_URL: "https://jass-${CI_COMMIT_REF_SLUG}.dev.pasteur.cloud/api"
test-ci:
needs: []
image: harbor.pasteur.fr/kube-system/helm-kubectl:3.4.0
environment:
name: "k8sdev-01/jass-dev/${CI_COMMIT_REF_SLUG}"
url: "https://jass-${CI_COMMIT_REF_SLUG}.dev.pasteur.cloud"
script:
- kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmqXXX || NO_SECRET=$?
- >
if [ $NO_SECRET ]; then
RABBITMQ_PASSWORD=''
RABBITMQ_ERLANG_COOKIE=''
else
RABBITMQ_PASSWORD=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 -d)
RABBITMQ_ERLANG_COOKIE=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-erlang-cookie}" | base64 -d)
fi
- echo $RABBITMQ_PASSWORD
- echo $RABBITMQ_ERLANG_COOKIE
- echo done
.deploy: .deploy:
stage: deploy stage: deploy
needs: needs:
...@@ -178,8 +157,15 @@ test-ci: ...@@ -178,8 +157,15 @@ test-ci:
- kubectl apply -n $NAMESPACE -f chart/pvc-shared-data.yaml - kubectl apply -n $NAMESPACE -f chart/pvc-shared-data.yaml
- helm dependency update chart - helm dependency update chart
# shows some error on first deployment # shows some error on first deployment
- RABBITMQ_PASSWORD=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-password}" || echo "" | base64 -d) - kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq || NO_SECRET=$?
- RABBITMQ_ERLANG_COOKIE=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-erlang-cookie}" || echo "" | base64 -d) - >
if [ $NO_SECRET ]; then
RABBITMQ_PASSWORD=''
RABBITMQ_ERLANG_COOKIE=''
else
RABBITMQ_PASSWORD=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-password}" | base64 -d)
RABBITMQ_ERLANG_COOKIE=$(kubectl get secret --namespace "jass-dev" ${CI_COMMIT_REF_SLUG}-rabbitmq -o jsonpath="{.data.rabbitmq-erlang-cookie}" | base64 -d)
fi
- > - >
helm upgrade --install --namespace=${NAMESPACE} helm upgrade --install --namespace=${NAMESPACE}
--set CI_REGISTRY_IMAGE=${CI_REGISTRY_IMAGE} --set CI_REGISTRY_IMAGE=${CI_REGISTRY_IMAGE}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment