Skip to content

Commit

Permalink
fix(ci): use the helm chart source to deploy on AKS to always used to…
Browse files Browse the repository at this point in the history
… chart linked to the Java code

 this will provide a way to test the chart in our dev environment
  • Loading branch information
leleueri committed Dec 6, 2024
1 parent 185190c commit 32ee9ef
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ jobs:
echo $AZURE_DOCKER_REGISTRY_PASSWORD | docker login --username $AZURE_DOCKER_REGISTRY_USERNAME --password-stdin graviteeio.azurecr.io
docker buildx build --push --platform=linux/arm64,linux/amd64 -f docker/management-ui/Dockerfile-dev --build-arg GRAVITEEAM_VERSION=${AM_VERSION} -t ${IMAGE_TAG} -t ${IMAGE_TAG_LATEST} /tmp
- persist_to_workspace:
root: /tmp
paths:
Expand All @@ -905,6 +906,7 @@ jobs:
- image: mcr.microsoft.com/azure-cli:2.42.0
resource_class: small
steps:
- checkout
- attach_workspace:
at: /tmp
- run:
Expand Down Expand Up @@ -940,49 +942,48 @@ jobs:
az login --service-principal -u $AZURE_APPLICATION_ID --tenant $AZURE_TENANT -p $AZURE_APPLICATION_SECRET
az aks get-credentials --admin --resource-group Devs-Preprod-Hosted --name gravitee-devs-preprod-aks-cluster
if [ "${CIRCLE_BRANCH}" == "master" ]; then
helm upgrade --repo https://helm.gravitee.io \
helm upgrade \
--install am-master \
-n am-master-dev \
-f ./cloud-am/devs-preprod/values.yaml am \
-f ./cloud-am/devs-preprod/values.yaml ./helm/ \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"
helm upgrade --repo https://helm.gravitee.io \
helm upgrade \
--install am-master-ce \
-n am-master-ce-dev \
-f ./cloud-am/devs-preprod/values-ce.yaml am \
-f ./cloud-am/devs-preprod/values-ce.yaml ./helm/ \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"
helm upgrade --repo https://helm.gravitee.io \
helm upgrade \
--install am-psql \
-n am-master-postgres-dev \
-f ./cloud-am/devs-preprod/values-psql.yaml am \
-f ./cloud-am/devs-preprod/values-psql.yaml ./helm/ \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
--set "gateway.image.tag=${TAG}" \
--set "ui.image.repository=graviteeio.azurecr.io/am-management-ui" \
--set "ui.image.tag=${TAG}"
else
export HELM_VERSION=$(echo ${CIRCLE_BRANCH} | sed 's/x/0/')
# create namespace if not exist (dry-run will generate YAML manifest and apply will create or update the ns using the manifest)
kubectl create namespace am-${CIRCLE_BRANCH//./-}-dev --dry-run=client -o yaml | kubectl apply -f -
# replace verison Pattern into generic maint configuration
sed -i 's#__BRANCH_NAME_SANITIZED__#'${CIRCLE_BRANCH//./-}'#g' ./cloud-am/devs-preprod/values-maint.yaml
helm upgrade --repo https://helm.gravitee.io \
helm upgrade \
--install am-${CIRCLE_BRANCH//./-} \
--version $HELM_VERSION \
-n am-${CIRCLE_BRANCH//./-}-dev \
-f ./cloud-am/devs-preprod/values-maint.yaml am \
-f ./cloud-am/devs-preprod/values-maint.yaml ./helm/ \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
Expand All @@ -993,11 +994,11 @@ jobs:
# same with ce version
kubectl create namespace am-${CIRCLE_BRANCH//./-}-ce-dev --dry-run=client -o yaml | kubectl apply -f -
sed -i 's#__BRANCH_NAME_SANITIZED__#'${CIRCLE_BRANCH//./-}'#g' ./cloud-am/devs-preprod/values-ce-maint.yaml
helm upgrade --repo https://helm.gravitee.io \
helm upgrade \
--install am-${CIRCLE_BRANCH//./-}-ce \
--version $HELM_VERSION \
-n am-${CIRCLE_BRANCH//./-}-ce-dev \
-f ./cloud-am/devs-preprod/values-ce-maint.yaml am \
-f ./cloud-am/devs-preprod/values-ce-maint.yaml ./helm/ \
--set "api.image.repository=graviteeio.azurecr.io/am-management-api" \
--set "api.image.tag=${TAG}" \
--set "gateway.image.repository=graviteeio.azurecr.io/am-gateway" \
Expand Down

0 comments on commit 32ee9ef

Please sign in to comment.