Skip to content

Commit

Permalink
Update gae_deploy.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhigh committed Apr 24, 2024
1 parent e26eb3e commit 0f495f0
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions tools/gae_deploy.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
#!/bin/bash
if [ -z "$GOOGLE_CLOUD_PROJECT" ]; then
read -p "Please input your project ID: " GOOGLE_CLOUD_PROJECT
if [ -z "$GOOGLE_CLOUD_PROJECT" ]; then
echo "Error: Project ID cannot be empty."
exit 1
fi
export GOOGLE_CLOUD_PROJECT
fi
gcloud config set project $GOOGLE_CLOUD_PROJECT
gcloud app create #select a region for app if it's first time
python ./kindleear/tools/update_req.py gae
if [ $? -eq 0 ]; then
if ! gcloud app describe >/dev/null 2>&1; then
gcloud app create #select a region for app if it's first time
fi

if python ./kindleear/tools/update_req.py gae; then
gcloud beta app deploy --version=1 ./kindleear/app.yaml
gcloud beta app deploy --quiet --version=1 ./kindleear/worker.yaml
gcloud beta app deploy --quiet --version=1 ./kindleear/cron.yaml
Expand All @@ -11,7 +21,6 @@ if [ $? -eq 0 ]; then
echo -e "The deployment is completed."
echo -e "The access address is: https://$GOOGLE_CLOUD_PROJECT.appspot.com"
else
echo -e "The deployment is terminated."
echo -e "Error: Update requirements failed. The deployment is terminated."
exit 1
fi

0 comments on commit 0f495f0

Please sign in to comment.