Skip to content

Commit 138bb59

Browse files
chaopengcopybara-github
authored andcommitted
Fix GAE deployment
PiperOrigin-RevId: 360749150 Change-Id: I4e2e3e39f786be22a3f6016560be8160e33fb719
1 parent d3cd22b commit 138bb59

6 files changed

Lines changed: 56 additions & 3 deletions

File tree

deploy.bash

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,10 @@ if deploy_service "personas"; then
235235
fi
236236

237237
if deploy_service "ic"; then
238+
DB_EXISTS=`gcloud sql databases list --project=${PROJECT?} --instance=hydra | grep ic${ENV?}`
239+
if [[ "${DB_EXISTS}" == "" ]]; then
240+
gcloud sql databases create ic${ENV?} --project=${PROJECT?} --instance=hydra
241+
fi
238242
echo -e ${GREEN?}'Deploy IC.'${RESET?}
239243
gcloud beta -q --project=${PROJECT?} app deploy deploy/build/ic/ic.yaml --image-url=gcr.io/${PROJECT?}/hcls-fa-ic:latest --version=master
240244
fi
@@ -245,6 +249,10 @@ if deploy_service "icdemo"; then
245249
fi
246250

247251
if deploy_service "dam"; then
252+
DB_EXISTS=`gcloud sql databases list --project=${PROJECT?} --instance=hydra | grep dam${ENV?}`
253+
if [[ "${DB_EXISTS}" == "" ]]; then
254+
gcloud sql databases create dam${ENV?} --project=${PROJECT?} --instance=hydra
255+
fi
248256
echo -e ${GREEN?}'Deploy DAM.'${RESET?}
249257
gcloud beta -q --project=${PROJECT?} app deploy deploy/build/dam/dam.yaml --image-url=gcr.io/${PROJECT?}/hcls-fa-dam:latest --version=master
250258
fi

deploy/build-templates/damdemo/damdemo.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ env_variables:
2121
DAM_TYPE: "dam${YOUR_ENVIRONMENT}"
2222
PROJECT: "${YOUR_PROJECT_ID}"
2323
CSP: "connect-src https://*.appspot.com"
24+
25+
liveness_check:
26+
path: "/liveness_check"
27+
check_interval_sec: 30
28+
timeout_sec: 4
29+
failure_threshold: 2
30+
success_threshold: 2
31+
32+
readiness_check:
33+
path: "/liveness_check"
34+
check_interval_sec: 5
35+
timeout_sec: 4
36+
failure_threshold: 2
37+
success_threshold: 2
38+
app_start_timeout_sec: 300

deploy/build-templates/hydra/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ARG HYDRA_VERSION=v1.4.2
2020

2121
# Install depends and nginx
2222
RUN export JQ_VERSION=1.5+dfsg-2+b1 && \
23-
export NGINX_VERSION=1.14.2-2+deb10u1 && \
23+
export NGINX_VERSION=1.14.2-2+deb10u3 && \
2424
apt update && \
2525
apt install -y jq=${JQ_VERSION} nginx=${NGINX_VERSION}
2626

deploy/build-templates/icdemo/icdemo.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,18 @@ env_variables:
2121
IC_TYPE: "ic${YOUR_ENVIRONMENT}"
2222
PROJECT: "${YOUR_PROJECT_ID}"
2323
CSP: "connect-src https://*.appspot.com"
24+
25+
liveness_check:
26+
path: "/liveness_check"
27+
check_interval_sec: 30
28+
timeout_sec: 4
29+
failure_threshold: 2
30+
success_threshold: 2
31+
32+
readiness_check:
33+
path: "/liveness_check"
34+
check_interval_sec: 5
35+
timeout_sec: 4
36+
failure_threshold: 2
37+
success_threshold: 2
38+
app_start_timeout_sec: 300

deploy/build-templates/personas/personas.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@ service: "personas${YOUR_ENVIRONMENT}"
1919
env_variables:
2020
TYPE: "personas${YOUR_ENVIRONMENT}"
2121
PROJECT: "${YOUR_PROJECT_ID}"
22+
23+
liveness_check:
24+
path: "/liveness_check"
25+
check_interval_sec: 30
26+
timeout_sec: 4
27+
failure_threshold: 2
28+
success_threshold: 2
29+
30+
readiness_check:
31+
path: "/liveness_check"
32+
check_interval_sec: 5
33+
timeout_sec: 4
34+
failure_threshold: 2
35+
success_threshold: 2
36+
app_start_timeout_sec: 300

prepare_project.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ gcloud datastore indexes create deploy/index.yaml --project=${PROJECT?} --quiet
9999
echo -e ${GREEN?}'Creating Cloud SQL database for Hydra.'${RESET?}
100100

101101
gcloud sql instances create hydra --project=${PROJECT?} --database-version=POSTGRES_11 \
102-
--tier=db-f1-micro --region=us-central1
102+
--tier=db-f1-micro --region=us-central1 --require-ssl
103103
# Create user: name="${NAME}", password="${PASSWORD}"
104-
gcloud sql users create hydra --project=${PROJECT?} --instance=hydra --password=hydra --require-ssl
104+
gcloud sql users create hydra --project=${PROJECT?} --instance=hydra --password=hydra
105105
# Create database ic
106106
gcloud sql databases create ic --project=${PROJECT?} --instance=hydra
107107
# Create database dam

0 commit comments

Comments
 (0)