Skip to content

Commit

Permalink
buildspec.yaml updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sfdevops committed Jan 20, 2025
1 parent 6fb1838 commit 7b7ebd5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
14 changes: 7 additions & 7 deletions files/tenant-samples/bridge/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ phases:
on-failure: ABORT
commands:
- cd $CODEBUILD_SRC_DIR/tenant-templates/bridge
- export WEBHOOK_PATH="$CODEBUILD_SRC_DIR/tenant-templates/bridge/event.js"
- export EVENT_FILE_PATH="$CODEBUILD_SRC_DIR/tenant-templates/bridge/event.js"
- curl -sS -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator
- curl -sS -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl
- chmod +x ./kubectl ./aws-iam-authenticator
Expand All @@ -18,9 +18,9 @@ phases:
- apt-get update -y && apt-get install -y jq unzip
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh && chmod 700 get_helm.sh && ./get_helm.sh --version v3.12.3
- npm i @aws-sdk/client-eventbridge
- ln -sf $WEBHOOK_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
- ln -sf $EVENT_FILE_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
pre_build:
on-failure: ABORT
commands:
Expand All @@ -33,7 +33,7 @@ phases:
- export AWS_EXPIRATION=$(echo ${CREDENTIALS} | jq -r '.Credentials.Expiration')
- aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME} --region ${AWS_REGION}
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
build:
on-failure: ABORT
commands:
Expand All @@ -49,7 +49,7 @@ phases:
#- export IdP="cognito"
- export TIER=$(echo "${tier}" | tr '[:upper:]' '[:lower:]')

# Webhook Envs
# event.js Envs
- export API_ENDPOINT="${CONTROL_PLANE_HOST}/tenant-mgmt-facade/webhook"
- export REDIRECT_URL="${CONTROL_PLANE_HOST}/main/home"
- export APP_PLANE_REDIRECT_URL="https://${KEY}.${DOMAIN_NAME}/home"
Expand Down Expand Up @@ -126,14 +126,14 @@ phases:


finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH

post_build:
commands:
- export CODEBUILD_BUILD_POSTBUILD=1
- export CREATE_USER=1
# To run the webhook which will send notification and create tenant first admin user in pooled database
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
- python push_to_dynamodb.py # pushing tenant config to dynamodb based on tenant_id mapping


Expand Down
14 changes: 7 additions & 7 deletions files/tenant-samples/pooled/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ phases:
on-failure: ABORT
commands:
- cd $CODEBUILD_SRC_DIR/tenant-templates/pooled
- export WEBHOOK_PATH="$CODEBUILD_SRC_DIR/tenant-templates/pooled/event.js"
- export EVENT_FILE_PATH="$CODEBUILD_SRC_DIR/tenant-templates/pooled/event.js"
- curl -sS -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator
- curl -sS -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl
- chmod +x ./kubectl ./aws-iam-authenticator
Expand All @@ -18,9 +18,9 @@ phases:
- apt-get update -y && apt-get install -y jq unzip
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh && chmod 700 get_helm.sh && ./get_helm.sh --version v3.12.3
- npm i @aws-sdk/client-eventbridge
- ln -sf $WEBHOOK_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
- ln -sf $EVENT_FILE_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
pre_build:
on-failure: ABORT
commands:
Expand All @@ -33,7 +33,7 @@ phases:
- export AWS_EXPIRATION=$(echo ${CREDENTIALS} | jq -r '.Credentials.Expiration')
- aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME} --region ${AWS_REGION}
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
build:
on-failure: ABORT
commands:
Expand All @@ -49,7 +49,7 @@ phases:
#- export IdP="cognito"
- export TIER=$(echo "${tier}" | tr '[:upper:]' '[:lower:]')

# Webhook Envs
# event.js Envs
- export API_ENDPOINT="${CONTROL_PLANE_HOST}/tenant-mgmt-facade/webhook"
- export REDIRECT_URL="${CONTROL_PLANE_HOST}/main/home"
- export APP_PLANE_REDIRECT_URL="https://${KEY}.${DOMAIN_NAME}/home"
Expand Down Expand Up @@ -124,14 +124,14 @@ phases:
- kubectl apply -f argo-workflow.yaml --namespace argo-workflows || true

finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH

post_build:
commands:
- export CODEBUILD_BUILD_POSTBUILD=1
- export CREATE_USER=1
# To run the webhook which will send notification and create tenant first admin user in pooled database
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
- python push_to_dynamodb.py # pushing tenant config to dynamodb based on tenant_id mapping


Expand Down
14 changes: 7 additions & 7 deletions files/tenant-samples/silo/buildspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ phases:
commands:
# install dependencies
- cd $CODEBUILD_SRC_DIR/tenant-templates/silo
- export WEBHOOK_PATH="$CODEBUILD_SRC_DIR/tenant-templates/silo/event.js"
- export EVENT_FILE_PATH="$CODEBUILD_SRC_DIR/tenant-templates/silo/event.js"
- curl -sS -o aws-iam-authenticator https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-07-26/bin/linux/amd64/aws-iam-authenticator
- curl -sS -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.17.7/2020-07-08/bin/linux/amd64/kubectl
- chmod +x ./kubectl ./aws-iam-authenticator
Expand All @@ -21,10 +21,10 @@ phases:
- curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh && chmod 700 get_helm.sh && ./get_helm.sh --version v3.12.3
- pip install boto3
- npm i @aws-sdk/client-eventbridge
- ln -sf $WEBHOOK_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
- ln -sf $EVENT_FILE_PATH /usr/local/bin/webhook #create webhook symlink and will execute webhook at every phase to update status in control plane
finally:
- ls -la
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
pre_build:
on-failure: ABORT
commands:
Expand All @@ -37,7 +37,7 @@ phases:
- export AWS_EXPIRATION=$(echo ${CREDENTIALS} | jq -r '.Credentials.Expiration')
- aws eks update-kubeconfig --name ${EKS_CLUSTER_NAME} --region ${AWS_REGION}
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
build:
on-failure: ABORT
commands:
Expand All @@ -51,7 +51,7 @@ phases:
- export IdP=$(echo $tenant | jq -r '.identityProvider')
- export TIER=$(echo "${tier}" | tr '[:upper:]' '[:lower:]')

# Exporting Webhook Envs
# Exporting event.js Envs
- export API_ENDPOINT="${CONTROL_PLANE_HOST}/tenant-mgmt-facade/webhook"
- export REDIRECT_URL="${CONTROL_PLANE_HOST}/main/home"
- export TENANT_MGMT_ENDPOINT="${CONTROL_PLANE_HOST}/tenant-mgmt-service"
Expand Down Expand Up @@ -118,14 +118,14 @@ phases:
#- terraform apply -auto-approve --refresh=false # refresh is false to avoid API hitting
- kubectl apply -f argo-workflow.yaml --namespace argo-workflows || true
finally:
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH


post_build:
commands:
- export CODEBUILD_BUILD_POSTBUILD=1
- export CREATE_USER=0
- node $WEBHOOK_PATH
- node $EVENT_FILE_PATH
- python push_to_dynamodb.py # pushing tenant config to dynamodb based on tenant_id mapping


Expand Down

0 comments on commit 7b7ebd5

Please sign in to comment.