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 28f454be14..926fdea7e8 100644 --- a/.github/workflows/on-demand-build-docker-image-deploy-preview.yml +++ b/.github/workflows/on-demand-build-docker-image-deploy-preview.yml @@ -6,7 +6,7 @@ on: types: [ build-deploy-preview-command ] jobs: - notify: + notify-job-details: runs-on: ubuntu-latest steps: # This step creates a comment on the PR with a link to this workflow run. @@ -18,7 +18,6 @@ jobs: Deploying Your Preview: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>. Workflow: `${{ github.workflow }}`. PR: ${{ github.event.client_payload.pull_request.number }}. - URL: https://${{ github.event.client_payload.pull_request.number }}-ce.appsmith.com server-build: name: server-build @@ -95,10 +94,10 @@ jobs: with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - repository: ${{ secrets.DOCKER_HUB_ORGANIZATION }}/appsmith-ce - tags: ${{ steps.git_hash.outputs.git_hash }} + repository: ${{ secrets.DOCKER_HUB_ORGANIZATION }}/appsmith-dp + tags: ${{ github.event.client_payload.pull_request.number }}-ce outputs: - imageHash: ${{ steps.git_hash.outputs.git_hash }} + imageHash: ${{ github.event.client_payload.pull_request.number }}-ce build-deploy-preview: needs: [push-image] @@ -139,3 +138,14 @@ jobs: run: | echo "environment variables set to deploy the image" $IMAGE_HASH /bin/bash ./scripts/deploy_preview.sh + + notify-url: + runs-on: ubuntu-latest + steps: + # This step creates a comment on the PR with a link to this workflow run. + - name: Add a comment on the PR with link to workflow run + uses: peter-evans/create-or-update-comment@v2 + with: + issue-number: ${{ github.event.client_payload.pull_request.number }} + body: | + Deploy-Preview-URL: https://${{ github.event.client_payload.pull_request.number }}-ce.dp.appsmith.com diff --git a/scripts/deploy_preview.sh b/scripts/deploy_preview.sh index 31f9c4525e..18e254fe70 100755 --- a/scripts/deploy_preview.sh +++ b/scripts/deploy_preview.sh @@ -23,14 +23,14 @@ echo "Region: $region" echo "Cluster name: $cluster_name" echo "Pull Request Number: $PULL_REQUEST_NUMBER" -sts_output=$(aws sts assume-role --role-arn env.AWS_ROLE_ARN --role-session-name ekscisession +sts_output=$(aws sts assume-role --role-arn env.AWS_ROLE_ARN --role-session-name ekscisession) 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.appsmith.com +export DOMAINNAME="$PULL_REQUEST_NUMBER"-ce.dp.appsmith.com export HELMCHART="appsmith" export HELMCHART_URL="http://helm.appsmith.com" export HELMCHART_VERSION="2.0.0" @@ -58,7 +58,7 @@ AWS_REGION=ap-south-1 helm repo add $HELMCHART $HELMCHART_URL echo "Deploy appsmith helm chart" helm install appsmith/appsmith --generate-name -n $NAMESPACE \ - --create-namespace --set image.repository=$DOCKER_HUB_ORGANIZATION/appsmith-ce --set image.tag=$IMAGE_HASH \ + --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" \ --set "ingress.hosts[0].host=$DOMAINNAME, ingress.hosts[0].paths[0].path=/, ingress.hosts[0].paths[0].pathType=Prefix" \