Add Redis to notifier production setup (#2258)

Co-authored-by: Kyle Ju <kyleju@chromium.org>
This commit is contained in:
Kyle Ju 2022-09-20 09:55:24 -07:00 коммит произвёл GitHub
Родитель eea1a0ab80
Коммит 88014a2844
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 34 добавлений и 8 удалений

24
notifier.staging.yaml Normal file
Просмотреть файл

@ -0,0 +1,24 @@
runtime: python39
service: notifier
handlers:
- url: /tasks/detect-intent
script: auto
# Header checks prevent raw access to this handler. Tasks have headers.
- url: /tasks/email-subscribers
script: auto
# Header checks prevent raw access to this handler. Tasks have headers.
app_engine_apis: true
# Set up VPC Access Connector for Redis.
vpc_access_connector:
name: projects/cr-status-staging/locations/us-central1/connectors/redis-connector
env_variables:
DJANGO_SETTINGS_MODULE: 'settings'
DJANGO_SECRET: 'this-is-a-secret'
# Redis envs
REDISHOST: '10.231.56.251'
REDISPORT: '6379'

Просмотреть файл

@ -12,13 +12,13 @@ handlers:
app_engine_apis: true
# Set up VPC Access Connector for Redis.
# Set up VPC Access Connector for Redis in prod.
vpc_access_connector:
name: projects/cr-status-staging/locations/us-central1/connectors/redis-connector
name: projects/cr-status/locations/us-central1/connectors/redis-connector
env_variables:
DJANGO_SETTINGS_MODULE: 'settings'
DJANGO_SECRET: 'this-is-a-secret'
# Redis envs
REDISHOST: '10.231.56.251'
# Redis envs for prod
REDISHOST: '10.250.3.187'
REDISPORT: '6379'

Просмотреть файл

@ -11,9 +11,11 @@
deployVersion=$1
appName=${2:-cr-status}
deployYaml="app.staging.yaml"
deployAppYaml="app.staging.yaml"
deployNotifierYaml="notifier.staging.yaml"
if [[ "${appName}" == "cr-status" ]]; then
deployYaml="app.yaml"
deployAppYaml="app.yaml"
deployNotifierYaml="notifier.yaml"
fi
usage="Usage: deploy.sh `date +%Y-%m-%d`"
@ -34,7 +36,7 @@ gcloud beta app deploy \
--project $appName \
--version $deployVersion \
--no-promote \
$BASEDIR/../notifier.yaml \
$BASEDIR/../$deployYaml \
$BASEDIR/../$deployNotifierYaml \
$BASEDIR/../$deployAppYaml \
$BASEDIR/../dispatch.yaml \
$BASEDIR/../cron.yaml