From 25e16c1cdd353803c11bf61aa317bf092665df95 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Thu, 27 Jul 2023 19:52:26 +0800 Subject: [PATCH] [snackpub] cleanup cloud run deployment scripts --- .github/workflows/snackpub.yml | 8 --- snackpub/scripts/deploy.sh | 60 ------------------ snackpub/secrets/.gitattributes | 2 - snackpub/secrets/production/snackpub.env.yaml | Bin 62 -> 0 bytes snackpub/secrets/staging/snackpub.env.yaml | Bin 62 -> 0 bytes 5 files changed, 70 deletions(-) delete mode 100755 snackpub/scripts/deploy.sh delete mode 100644 snackpub/secrets/.gitattributes delete mode 100644 snackpub/secrets/production/snackpub.env.yaml delete mode 100644 snackpub/secrets/staging/snackpub.env.yaml diff --git a/.github/workflows/snackpub.yml b/.github/workflows/snackpub.yml index 02a3c377..c5845b8c 100644 --- a/.github/workflows/snackpub.yml +++ b/.github/workflows/snackpub.yml @@ -119,10 +119,6 @@ jobs: run: ./bin/prune-gcr snackpub --dry-run working-directory: ./ - - name: 🚀 Deploy snackpub to cloud run - run: ./scripts/deploy.sh -e staging - working-directory: snackpub - - name: 🚀 Deploy snackpub to k8s run: skaffold deploy --status-check --build-artifacts /tmp/build.json working-directory: snackpub @@ -170,10 +166,6 @@ jobs: ENVIRONMENT: production SKAFFOLD_PUSH_IMAGE: 'true' - - name: 🚀 Deploy snackpub to cloud run - run: ./scripts/deploy.sh -e production - working-directory: snackpub - - name: 🚀 Deploy snackpub to k8s run: skaffold deploy --status-check --build-artifacts /tmp/build.json working-directory: snackpub diff --git a/snackpub/scripts/deploy.sh b/snackpub/scripts/deploy.sh deleted file mode 100755 index 8b8fb0b6..00000000 --- a/snackpub/scripts/deploy.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash -set -eo pipefail - -usage() { - echo "Usage: $0 -e " - exit 1 -} - -while getopts "e:" option; do - case $option in - e) - environment=$OPTARG - if [ "$environment" != 'staging' ] && [ "$environment" != 'production' ]; then - echo "Invalid environment: $environment" - exit 1 - fi - ;; - *) - usage - ;; - esac -done - -if [ -z "$environment" ]; then - usage -elif [ "$environment" = 'staging' ]; then - service_name='staging-snackpub' - max_instances=10 - cpu_throttling='--cpu-throttling' - vpc_connector='production-general' - env_vars_file='secrets/staging/snackpub.env.yaml' - service_account='snackpub-staging@exponentjs.iam.gserviceaccount.com' -elif [ "$environment" = 'production' ]; then - service_name='production-snackpub' - max_instances=200 - cpu_throttling='--no-cpu-throttling' - vpc_connector='production-general' - env_vars_file='secrets/production/snackpub.env.yaml' - service_account='snackpub-production@exponentjs.iam.gserviceaccount.com' -fi - -printf "\nDeploying to Google Cloud Platform...\n" - -# We need beta gcloud cli for `--session-affinity` -gcloud --quiet beta run deploy "$service_name" \ - --image=gcr.io/exponentjs/snackpub:latest \ - --labels="app=snack,component=snackpub,environment=$environment" \ - --port=3013 \ - --allow-unauthenticated \ - --session-affinity \ - --ingress=internal-and-cloud-load-balancing \ - --timeout=1800 \ - --concurrency=1000 \ - --max-instances=$max_instances \ - "$cpu_throttling" \ - --vpc-connector="$vpc_connector" \ - --env-vars-file="$env_vars_file" \ - --service-account="$service_account" - -printf "\nCloud Run $service_name has been deployed" diff --git a/snackpub/secrets/.gitattributes b/snackpub/secrets/.gitattributes deleted file mode 100644 index daf82f11..00000000 --- a/snackpub/secrets/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -staging/* filter=git-crypt diff=git-crypt -production/* filter=git-crypt diff=git-crypt diff --git a/snackpub/secrets/production/snackpub.env.yaml b/snackpub/secrets/production/snackpub.env.yaml deleted file mode 100644 index a52c7a7f385daf0c30027f1587a7d5d585946d61..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62 zcmV-E0KxwNM@dveQdv+`01pfb70LZaj8SW+