From a8689792dc250e4e60093d757f8bc7792226f749 Mon Sep 17 00:00:00 2001 From: Goutham Pratapa Date: Mon, 30 Jan 2023 11:49:22 +0530 Subject: [PATCH] ci: make upgrades easy to deploy-previews (#20198) Make upgrades easy for deploy previews. --- .../on-demand-build-docker-image-deploy-preview.yml | 4 ++-- scripts/deploy_preview.sh | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/on-demand-build-docker-image-deploy-preview.yml b/.github/workflows/on-demand-build-docker-image-deploy-preview.yml index 464c454c42..7cc8c8a1cf 100644 --- a/.github/workflows/on-demand-build-docker-image-deploy-preview.yml +++ b/.github/workflows/on-demand-build-docker-image-deploy-preview.yml @@ -95,9 +95,9 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} repository: ${{ secrets.DOCKER_HUB_ORGANIZATION }}/appsmith-dp - tags: ${{ github.event.client_payload.pull_request.number }}-ce + tags: ce-${{ github.event.client_payload.pull_request.number }} outputs: - imageHash: ${{ github.event.client_payload.pull_request.number }}-ce + imageHash: ce-${{ github.event.client_payload.pull_request.number }} build-deploy-preview: needs: [push-image] diff --git a/scripts/deploy_preview.sh b/scripts/deploy_preview.sh index 18e254fe70..1582320a79 100755 --- a/scripts/deploy_preview.sh +++ b/scripts/deploy_preview.sh @@ -28,9 +28,10 @@ export AWS_ACCESS_KEY_ID=$(echo $sts_output | jq -r '.Credentials''.AccessKeyId' export AWS_SECRET_ACCESS_KEY=$(echo $sts_output | jq -r '.Credentials''.SecretAccessKey');\ export AWS_SESSION_TOKEN=$(echo $sts_output | jq -r '.Credentials''.SessionToken'); -export NAMESPACE="$PULL_REQUEST_NUMBER"ce -export SECRET="$PULL_REQUEST_NUMBER"ce -export DOMAINNAME="$PULL_REQUEST_NUMBER"-ce.dp.appsmith.com +export NAMESPACE=ce"$PULL_REQUEST_NUMBER" +export CHARTNAME=ce"$PULL_REQUEST_NUMBER" +export SECRET=ce"$PULL_REQUEST_NUMBER" +export DOMAINNAME=ce-"$PULL_REQUEST_NUMBER".dp.appsmith.com export HELMCHART="appsmith" export HELMCHART_URL="http://helm.appsmith.com" export HELMCHART_VERSION="2.0.0" @@ -57,7 +58,7 @@ echo "Add appsmith-ce to helm repo" AWS_REGION=ap-south-1 helm repo add $HELMCHART $HELMCHART_URL echo "Deploy appsmith helm chart" -helm install appsmith/appsmith --generate-name -n $NAMESPACE \ +helm upgrade -i $CHARTNAME --generate-name -n $NAMESPACE \ --create-namespace --set image.repository=$DOCKER_HUB_ORGANIZATION/appsmith-dp --set image.tag=$IMAGE_HASH \ --set image.pullSecrets=$SECRET --set redis.enabled=false --set mongodb.enabled=false --set ingress.enabled=true \ --set "ingress.annotations.service\.beta\.kubernetes\.io/aws-load-balancer-ssl-cert=$AWS_RELEASE_CERT" \