From 699f00531a7e17d45dcab9e5ffe2d0803eac0bc0 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 18:43:13 +0530 Subject: [PATCH 1/7] chore: Fix datasource creation throwing 400 --- app/client/src/api/DatasourcesApi.ts | 61 ++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index ec31c498b65a..c3bbaf0798a7 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -50,6 +50,9 @@ class DatasourcesApi extends API { datasourceConfiguration: { ...storage.datasourceConfiguration, isValid: undefined, + authentication: this.cleanupAuthenticationObject( + storage.datasourceConfiguration.authentication, + ), connection: storage.datasourceConfiguration.connection && { ...storage.datasourceConfiguration.connection, ssl: { @@ -67,6 +70,64 @@ class DatasourcesApi extends API { return API.post(DatasourcesApi.url, datasourceConfig); } + static cleanupAuthenticationObject(authentication: any): any { + if (!authentication) { + return undefined; + } + const common: any = { + authenticationType: authentication.authenticationType, + }; + + switch (authentication.authenticationType) { + case "dbAuth": + common.authType = authentication.authType; + common.username = authentication.username; + common.password = authentication.password; + common.databaseName = authentication.databaseName; + break; + case "oAuth2": + common.grantType = authentication.grantType; + common.isTokenHeader = authentication.isTokenHeader; + common.isAuthorizationHeader = authentication.isAuthorizationHeader; + common.clientId = authentication.clientId; + common.clientSecret = authentication.clientSecret; + common.authorizationUrl = authentication.authorizationUrl; + common.expiresIn = authentication.expiresIn; + common.accessTokenUrl = authentication.accessTokenUrl; + common.scopeString = authentication.scopeString; + common.scope = authentication.scope; + common.sendScopeWithRefreshToken = + authentication.sendScopeWithRefreshToken; + common.refreshTokenClientCredentialsLocation = + authentication.refreshTokenClientCredentialsLocation; + common.headerPrefix = authentication.headerPrefix; + common.customTokenParameters = authentication.customTokenParameters; + common.audience = authentication.audience; + common.resource = authentication.resource; + common.useSelfSignedCert = authentication.useSelfSignedCert; + break; + case "basic": + common.username = authentication.username; + common.password = authentication.password; + break; + case "apiKey": + common.addTo = authentication.addTo; + common.label = authentication.label; + common.headerPrefix = authentication.headerPrefix; + common.value = authentication.value; + break; + case "bearerToken": + common.bearerToken = authentication.bearerToken; + break; + case "snowflakeKeyPairAuth": + common.username = authentication.username; + common.privateKey = authentication.privateKey; + common.passphrase = authentication.passphrase; + } + + return common; + } + // Api to test current environment datasource static async testDatasource( datasourceConfig: Partial, From 95ec86ac0088e8490ce4ddb86648c2f9cb4c6520 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 18:49:16 +0530 Subject: [PATCH 2/7] refactor --- app/client/src/api/DatasourcesApi.ts | 71 ++++++++++++++-------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index c3bbaf0798a7..9ed878d51c2e 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -50,7 +50,7 @@ class DatasourcesApi extends API { datasourceConfiguration: { ...storage.datasourceConfiguration, isValid: undefined, - authentication: this.cleanupAuthenticationObject( + authentication: this.cleanAuthenticationObject( storage.datasourceConfiguration.authentication, ), connection: storage.datasourceConfiguration.connection && { @@ -70,62 +70,63 @@ class DatasourcesApi extends API { return API.post(DatasourcesApi.url, datasourceConfig); } - static cleanupAuthenticationObject(authentication: any): any { + static cleanAuthenticationObject(authentication: any): any { if (!authentication) { return undefined; } - const common: any = { + + const auth: any = { authenticationType: authentication.authenticationType, }; switch (authentication.authenticationType) { case "dbAuth": - common.authType = authentication.authType; - common.username = authentication.username; - common.password = authentication.password; - common.databaseName = authentication.databaseName; + auth.authType = authentication.authType; + auth.username = authentication.username; + auth.password = authentication.password; + auth.databaseName = authentication.databaseName; break; case "oAuth2": - common.grantType = authentication.grantType; - common.isTokenHeader = authentication.isTokenHeader; - common.isAuthorizationHeader = authentication.isAuthorizationHeader; - common.clientId = authentication.clientId; - common.clientSecret = authentication.clientSecret; - common.authorizationUrl = authentication.authorizationUrl; - common.expiresIn = authentication.expiresIn; - common.accessTokenUrl = authentication.accessTokenUrl; - common.scopeString = authentication.scopeString; - common.scope = authentication.scope; - common.sendScopeWithRefreshToken = + auth.grantType = authentication.grantType; + auth.isTokenHeader = authentication.isTokenHeader; + auth.isAuthorizationHeader = authentication.isAuthorizationHeader; + auth.clientId = authentication.clientId; + auth.clientSecret = authentication.clientSecret; + auth.authorizationUrl = authentication.authorizationUrl; + auth.expiresIn = authentication.expiresIn; + auth.accessTokenUrl = authentication.accessTokenUrl; + auth.scopeString = authentication.scopeString; + auth.scope = authentication.scope; + auth.sendScopeWithRefreshToken = authentication.sendScopeWithRefreshToken; - common.refreshTokenClientCredentialsLocation = + auth.refreshTokenClientCredentialsLocation = authentication.refreshTokenClientCredentialsLocation; - common.headerPrefix = authentication.headerPrefix; - common.customTokenParameters = authentication.customTokenParameters; - common.audience = authentication.audience; - common.resource = authentication.resource; - common.useSelfSignedCert = authentication.useSelfSignedCert; + auth.headerPrefix = authentication.headerPrefix; + auth.customTokenParameters = authentication.customTokenParameters; + auth.audience = authentication.audience; + auth.resource = authentication.resource; + auth.useSelfSignedCert = authentication.useSelfSignedCert; break; case "basic": - common.username = authentication.username; - common.password = authentication.password; + auth.username = authentication.username; + auth.password = authentication.password; break; case "apiKey": - common.addTo = authentication.addTo; - common.label = authentication.label; - common.headerPrefix = authentication.headerPrefix; - common.value = authentication.value; + auth.addTo = authentication.addTo; + auth.label = authentication.label; + auth.headerPrefix = authentication.headerPrefix; + auth.value = authentication.value; break; case "bearerToken": - common.bearerToken = authentication.bearerToken; + auth.bearerToken = authentication.bearerToken; break; case "snowflakeKeyPairAuth": - common.username = authentication.username; - common.privateKey = authentication.privateKey; - common.passphrase = authentication.passphrase; + auth.username = authentication.username; + auth.privateKey = authentication.privateKey; + auth.passphrase = authentication.passphrase; } - return common; + return auth; } // Api to test current environment datasource From 4239ee62caeb5d401c16bbc4e962ff4fa1d4ae91 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 18:50:29 +0530 Subject: [PATCH 3/7] again --- app/client/src/api/DatasourcesApi.ts | 66 ++++++++++++++-------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index 9ed878d51c2e..440b63f79a78 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -75,58 +75,58 @@ class DatasourcesApi extends API { return undefined; } - const auth: any = { + const clean: any = { authenticationType: authentication.authenticationType, }; switch (authentication.authenticationType) { case "dbAuth": - auth.authType = authentication.authType; - auth.username = authentication.username; - auth.password = authentication.password; - auth.databaseName = authentication.databaseName; + clean.authType = authentication.authType; + clean.username = authentication.username; + clean.password = authentication.password; + clean.databaseName = authentication.databaseName; break; case "oAuth2": - auth.grantType = authentication.grantType; - auth.isTokenHeader = authentication.isTokenHeader; - auth.isAuthorizationHeader = authentication.isAuthorizationHeader; - auth.clientId = authentication.clientId; - auth.clientSecret = authentication.clientSecret; - auth.authorizationUrl = authentication.authorizationUrl; - auth.expiresIn = authentication.expiresIn; - auth.accessTokenUrl = authentication.accessTokenUrl; - auth.scopeString = authentication.scopeString; - auth.scope = authentication.scope; - auth.sendScopeWithRefreshToken = + clean.grantType = authentication.grantType; + clean.isTokenHeader = authentication.isTokenHeader; + clean.isAuthorizationHeader = authentication.isAuthorizationHeader; + clean.clientId = authentication.clientId; + clean.clientSecret = authentication.clientSecret; + clean.authorizationUrl = authentication.authorizationUrl; + clean.expiresIn = authentication.expiresIn; + clean.accessTokenUrl = authentication.accessTokenUrl; + clean.scopeString = authentication.scopeString; + clean.scope = authentication.scope; + clean.sendScopeWithRefreshToken = authentication.sendScopeWithRefreshToken; - auth.refreshTokenClientCredentialsLocation = + clean.refreshTokenClientCredentialsLocation = authentication.refreshTokenClientCredentialsLocation; - auth.headerPrefix = authentication.headerPrefix; - auth.customTokenParameters = authentication.customTokenParameters; - auth.audience = authentication.audience; - auth.resource = authentication.resource; - auth.useSelfSignedCert = authentication.useSelfSignedCert; + clean.headerPrefix = authentication.headerPrefix; + clean.customTokenParameters = authentication.customTokenParameters; + clean.audience = authentication.audience; + clean.resource = authentication.resource; + clean.useSelfSignedCert = authentication.useSelfSignedCert; break; case "basic": - auth.username = authentication.username; - auth.password = authentication.password; + clean.username = authentication.username; + clean.password = authentication.password; break; case "apiKey": - auth.addTo = authentication.addTo; - auth.label = authentication.label; - auth.headerPrefix = authentication.headerPrefix; - auth.value = authentication.value; + clean.addTo = authentication.addTo; + clean.label = authentication.label; + clean.headerPrefix = authentication.headerPrefix; + clean.value = authentication.value; break; case "bearerToken": - auth.bearerToken = authentication.bearerToken; + clean.bearerToken = authentication.bearerToken; break; case "snowflakeKeyPairAuth": - auth.username = authentication.username; - auth.privateKey = authentication.privateKey; - auth.passphrase = authentication.passphrase; + clean.username = authentication.username; + clean.privateKey = authentication.privateKey; + clean.passphrase = authentication.passphrase; } - return auth; + return clean; } // Api to test current environment datasource From 85495fbcf6ec641162c7c30ea8f758dcaee380e3 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 20:27:16 +0530 Subject: [PATCH 4/7] Fix database datasource creation --- app/client/src/api/DatasourcesApi.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index 440b63f79a78..fe82fc49d520 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -76,10 +76,10 @@ class DatasourcesApi extends API { } const clean: any = { - authenticationType: authentication.authenticationType, + authenticationType: authentication.authenticationType ?? "dbAuth", }; - switch (authentication.authenticationType) { + switch (clean.authenticationType) { case "dbAuth": clean.authType = authentication.authType; clean.username = authentication.username; From b3cd377dad7fb038c309767e6d2720435f241ed9 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 21:40:53 +0530 Subject: [PATCH 5/7] chore: Fix some quoting in deploy_preview.sh --- scripts/deploy_preview.sh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/deploy_preview.sh b/scripts/deploy_preview.sh index f121fd6b3452..a0b05831e262 100755 --- a/scripts/deploy_preview.sh +++ b/scripts/deploy_preview.sh @@ -1,6 +1,8 @@ #!/bin/bash # Params are in environment variables as PARAM_{SLUG}, e.g. PARAM_USER_ID +edition=ce + # Configure the AWS & kubectl environment mkdir ~/.aws; touch ~/.aws/config @@ -25,17 +27,17 @@ echo "Cluster name: $cluster_name" echo "Pull Request Number: $PULL_REQUEST_NUMBER" echo "DP_EFS_ID: $DP_EFS_ID" -sts_output=$(aws sts assume-role --role-arn $AWS_ROLE_ARN --role-session-name ekscisession) +sts_output="$(aws sts assume-role --role-arn "$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 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=ce"$PULL_REQUEST_NUMBER" -export CHARTNAME=ce"$PULL_REQUEST_NUMBER" -export SECRET=ce"$PULL_REQUEST_NUMBER" -export DBNAME=ce"$PULL_REQUEST_NUMBER" -export DOMAINNAME=ce-"$PULL_REQUEST_NUMBER".dp.appsmith.com +export NAMESPACE="$edition$PULL_REQUEST_NUMBER" +export CHARTNAME="$edition$PULL_REQUEST_NUMBER" +export SECRET="$edition$PULL_REQUEST_NUMBER" +export DBNAME="$edition$PULL_REQUEST_NUMBER" +export DOMAINNAME="$edition-$PULL_REQUEST_NUMBER".dp.appsmith.com export HELMCHART="appsmith" export HELMCHART_URL="http://helm-ee.appsmith.com" export HELMCHART_VERSION="3.1.1" @@ -60,14 +62,14 @@ then kubectl delete pv $NAMESPACE-appsmith --grace-period=0 --force || true # Below lines are a placeholder to use access points more effectively # echo "deleting Accessing points" -# ACCESS_POINT_ID=$(aws efs describe-access-points --file-system-id "$DP_EFS_ID" | jq -r '.AccessPoints[] | select(.Name=="'"ce$PULL_REQUEST_NUMBER"'") | .AccessPointId') +# ACCESS_POINT_ID=$(aws efs describe-access-points --file-system-id "$DP_EFS_ID" | jq -r '.AccessPoints[] | select(.Name=="'"$edition$PULL_REQUEST_NUMBER"'") | .AccessPointId') # echo "Deleting Accessing Point $ACCESS_POINT_ID" # aws efs delete-access-point --access-point-id $ACCESS_POINT_ID fi #echo "Create Access Point and Access Point ID" ### Use DP-EFS and create ACCESS_POINT -#ACCESS_POINT=$(aws efs create-access-point --file-system-id $DP_EFS_ID --tags Key=Name,Value=ce$PULL_REQUEST_NUMBER) +#ACCESS_POINT=$(aws efs create-access-point --file-system-id $DP_EFS_ID --tags Key=Name,Value=$edition$PULL_REQUEST_NUMBER) #ACCESS_POINT_ID=$(echo $ACCESS_POINT | jq -r '.AccessPointId'); echo "Use kubernetes secret to Pull Image" @@ -95,7 +97,7 @@ helm upgrade -i $CHARTNAME appsmith-ee/$HELMCHART -n $NAMESPACE --create-namespa --set "ingress.hosts[0].host=$DOMAINNAME, ingress.hosts[0].paths[0].path=/, ingress.hosts[0].paths[0].pathType=Prefix" \ --set autoupdate.enabled=false --set persistence.efs.enabled=true --set ingress.className="nginx" \ --set persistence.efs.driver=efs.csi.aws.com --set persistence.storageClass=efs-dp-appsmith \ - --set persistence.efs.volumeHandle=$DP_EFS_ID:/ce/ce$PULL_REQUEST_NUMBER \ + --set persistence.efs.volumeHandle=$DP_EFS_ID:/$edition/$edition$PULL_REQUEST_NUMBER \ --set resources.requests.cpu="1m" \ --set resources.requests.memory="2048Mi" \ --set applicationConfig.APPSMITH_SENTRY_DSN="https://abf15a075d1347969df44c746cca7eaa@o296332.ingest.sentry.io/1546547" \ From 4a0f960f70ada463f69967603ec5d466f67b8916 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 21:42:03 +0530 Subject: [PATCH 6/7] Discard changes to app/client/src/api/DatasourcesApi.ts --- app/client/src/api/DatasourcesApi.ts | 62 ---------------------------- 1 file changed, 62 deletions(-) diff --git a/app/client/src/api/DatasourcesApi.ts b/app/client/src/api/DatasourcesApi.ts index fe82fc49d520..ec31c498b65a 100644 --- a/app/client/src/api/DatasourcesApi.ts +++ b/app/client/src/api/DatasourcesApi.ts @@ -50,9 +50,6 @@ class DatasourcesApi extends API { datasourceConfiguration: { ...storage.datasourceConfiguration, isValid: undefined, - authentication: this.cleanAuthenticationObject( - storage.datasourceConfiguration.authentication, - ), connection: storage.datasourceConfiguration.connection && { ...storage.datasourceConfiguration.connection, ssl: { @@ -70,65 +67,6 @@ class DatasourcesApi extends API { return API.post(DatasourcesApi.url, datasourceConfig); } - static cleanAuthenticationObject(authentication: any): any { - if (!authentication) { - return undefined; - } - - const clean: any = { - authenticationType: authentication.authenticationType ?? "dbAuth", - }; - - switch (clean.authenticationType) { - case "dbAuth": - clean.authType = authentication.authType; - clean.username = authentication.username; - clean.password = authentication.password; - clean.databaseName = authentication.databaseName; - break; - case "oAuth2": - clean.grantType = authentication.grantType; - clean.isTokenHeader = authentication.isTokenHeader; - clean.isAuthorizationHeader = authentication.isAuthorizationHeader; - clean.clientId = authentication.clientId; - clean.clientSecret = authentication.clientSecret; - clean.authorizationUrl = authentication.authorizationUrl; - clean.expiresIn = authentication.expiresIn; - clean.accessTokenUrl = authentication.accessTokenUrl; - clean.scopeString = authentication.scopeString; - clean.scope = authentication.scope; - clean.sendScopeWithRefreshToken = - authentication.sendScopeWithRefreshToken; - clean.refreshTokenClientCredentialsLocation = - authentication.refreshTokenClientCredentialsLocation; - clean.headerPrefix = authentication.headerPrefix; - clean.customTokenParameters = authentication.customTokenParameters; - clean.audience = authentication.audience; - clean.resource = authentication.resource; - clean.useSelfSignedCert = authentication.useSelfSignedCert; - break; - case "basic": - clean.username = authentication.username; - clean.password = authentication.password; - break; - case "apiKey": - clean.addTo = authentication.addTo; - clean.label = authentication.label; - clean.headerPrefix = authentication.headerPrefix; - clean.value = authentication.value; - break; - case "bearerToken": - clean.bearerToken = authentication.bearerToken; - break; - case "snowflakeKeyPairAuth": - clean.username = authentication.username; - clean.privateKey = authentication.privateKey; - clean.passphrase = authentication.passphrase; - } - - return clean; - } - // Api to test current environment datasource static async testDatasource( datasourceConfig: Partial, From f2381c9e21f3a2ab89a0de63375bbe58dc1fe726 Mon Sep 17 00:00:00 2001 From: Shrikant Sharat Kandula Date: Fri, 28 Jun 2024 22:10:11 +0530 Subject: [PATCH 7/7] More variables quoted --- scripts/deploy_preview.sh | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/scripts/deploy_preview.sh b/scripts/deploy_preview.sh index a0b05831e262..d16b7377e2f7 100755 --- a/scripts/deploy_preview.sh +++ b/scripts/deploy_preview.sh @@ -7,8 +7,8 @@ edition=ce mkdir ~/.aws; touch ~/.aws/config -aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID -aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY +aws configure set aws_access_key_id "$AWS_ACCESS_KEY_ID" +aws configure set aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" export region=ap-south-1 export cluster_name=uat-cluster @@ -37,13 +37,13 @@ export NAMESPACE="$edition$PULL_REQUEST_NUMBER" export CHARTNAME="$edition$PULL_REQUEST_NUMBER" export SECRET="$edition$PULL_REQUEST_NUMBER" export DBNAME="$edition$PULL_REQUEST_NUMBER" -export DOMAINNAME="$edition-$PULL_REQUEST_NUMBER".dp.appsmith.com +export DOMAINNAME="$edition-$PULL_REQUEST_NUMBER.dp.appsmith.com" export HELMCHART="appsmith" export HELMCHART_URL="http://helm-ee.appsmith.com" export HELMCHART_VERSION="3.1.1" -aws eks update-kubeconfig --region $region --name $cluster_name --profile eksci +aws eks update-kubeconfig --region "$region" --name "$cluster_name" --profile eksci echo "Set the default namespace" kubectl config set-context --current --namespace=default @@ -54,12 +54,12 @@ kubectl get pods if [[ -n "${RECREATE-}" ]] then mongosh "mongodb+srv://$DB_USERNAME:$DB_PASSWORD@$DB_URL/$DBNAME?retryWrites=true&minPoolSize=1&maxPoolSize=10&maxIdleTimeMS=900000&authSource=admin" --eval 'db.dropDatabase()' - pod_name=$(kubectl get pods -n $NAMESPACE -o json | jq '.items[0].metadata.name' | tr -d '"') - kubectl exec $pod_name -n $NAMESPACE -- bash -c "rm -rf /appsmith-stacks/*" - kubectl delete ns $NAMESPACE || true + pod_name="$(kubectl get pods -n "$NAMESPACE" -o json | jq '.items[0].metadata.name' | tr -d '"')" + kubectl exec "$pod_name" -n "$NAMESPACE" -- bash -c "rm -rf /appsmith-stacks/*" + kubectl delete ns "$NAMESPACE" || true # Placeholder to use access points more effectively - kubectl patch pv $NAMESPACE-appsmith -p '{"metadata":{"finalizers":null}}' || true - kubectl delete pv $NAMESPACE-appsmith --grace-period=0 --force || true + kubectl patch pv "$NAMESPACE-appsmith" -p '{"metadata":{"finalizers":null}}' || true + kubectl delete pv "$NAMESPACE-appsmith" --grace-period=0 --force || true # Below lines are a placeholder to use access points more effectively # echo "deleting Accessing points" # ACCESS_POINT_ID=$(aws efs describe-access-points --file-system-id "$DP_EFS_ID" | jq -r '.AccessPoints[] | select(.Name=="'"$edition$PULL_REQUEST_NUMBER"'") | .AccessPointId') @@ -73,31 +73,31 @@ fi #ACCESS_POINT_ID=$(echo $ACCESS_POINT | jq -r '.AccessPointId'); echo "Use kubernetes secret to Pull Image" -kubectl create ns $NAMESPACE || true +kubectl create ns "$NAMESPACE" || true -kubectl create secret docker-registry $SECRET \ +kubectl create secret docker-registry "$SECRET" \ --docker-server=https://index.docker.io/v1/ \ - --docker-username=$DOCKER_HUB_USERNAME \ - --docker-password=$DOCKER_HUB_ACCESS_TOKEN -n $NAMESPACE + --docker-username="$DOCKER_HUB_USERNAME" \ + --docker-password="$DOCKER_HUB_ACCESS_TOKEN" -n "$NAMESPACE" echo "Add appsmith-ee to helm repo" -AWS_REGION=us-east-2 helm repo add appsmith-ee $HELMCHART_URL; -helm repo update; -helm plugin install https://github.com/helm/helm-mapkubeapis -n $NAMESPACE +AWS_REGION=us-east-2 helm repo add appsmith-ee "$HELMCHART_URL" +helm repo update +helm plugin install https://github.com/helm/helm-mapkubeapis -n "$NAMESPACE" helm plugin ls -helm mapkubeapis $CHARTNAME -n $NAMESPACE +helm mapkubeapis "$CHARTNAME" -n "$NAMESPACE" echo "Deploy appsmith helm chart" -helm upgrade -i $CHARTNAME appsmith-ee/$HELMCHART -n $NAMESPACE --create-namespace --recreate-pods \ - --set _image.repository=$DOCKER_HUB_ORGANIZATION/appsmith-dp --set _image.tag=$IMAGE_HASH \ +helm upgrade -i "$CHARTNAME" "appsmith-ee/$HELMCHART" -n "$NAMESPACE" --create-namespace --recreate-pods \ + --set _image.repository="$DOCKER_HUB_ORGANIZATION/appsmith-dp" --set _image.tag="$IMAGE_HASH" \ --set _image.pullPolicy="Always" \ - --set image.pullSecrets=$SECRET --set autoscaling.enabled=true --set autoscaling.minReplicas=1 \ + --set image.pullSecrets="$SECRET" --set autoscaling.enabled=true --set autoscaling.minReplicas=1 \ --set autoscaling.maxReplicas=1 --set redis.enabled=false --set postgresql.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" \ --set autoupdate.enabled=false --set persistence.efs.enabled=true --set ingress.className="nginx" \ --set persistence.efs.driver=efs.csi.aws.com --set persistence.storageClass=efs-dp-appsmith \ - --set persistence.efs.volumeHandle=$DP_EFS_ID:/$edition/$edition$PULL_REQUEST_NUMBER \ + --set persistence.efs.volumeHandle="$DP_EFS_ID:/$edition/$edition$PULL_REQUEST_NUMBER" \ --set resources.requests.cpu="1m" \ --set resources.requests.memory="2048Mi" \ --set applicationConfig.APPSMITH_SENTRY_DSN="https://abf15a075d1347969df44c746cca7eaa@o296332.ingest.sentry.io/1546547" \ @@ -105,4 +105,4 @@ helm upgrade -i $CHARTNAME appsmith-ee/$HELMCHART -n $NAMESPACE --create-namespa --set applicationConfig.APPSMITH_MONGODB_URI="mongodb+srv://$DB_USERNAME:$DB_PASSWORD@$DB_URL/$DBNAME?retryWrites=true&minPoolSize=1&maxPoolSize=10&maxIdleTimeMS=900000&authSource=admin" \ --set applicationConfig.APPSMITH_DISABLE_EMBEDDED_KEYCLOAK=\"1\" \ --set applicationConfig.APPSMITH_CUSTOMER_PORTAL_URL="https://release-customer.appsmith.com" \ - --version $HELMCHART_VERSION + --version "$HELMCHART_VERSION"