fix: rewrite the sql args and variables codebase to use expression values

This commit is contained in:
Vikram Rangnekar
2020-05-26 19:41:28 -04:00
parent f63e270c73
commit 2241364d00
35 changed files with 397 additions and 555 deletions

View File

@ -5,7 +5,7 @@ steps:
[
"build",
"--tag",
"gcr.io/$PROJECT_ID/{% app_name_slug %}:latest",
"gcr.io/$PROJECT_ID/{{- .AppNameSlug -}}:latest",
"--build-arg",
"GO_ENV=production",
".",
@ -13,7 +13,7 @@ steps:
# Push new image to Google Container Registry
- name: "gcr.io/cloud-builders/docker"
args: ["push", "gcr.io/$PROJECT_ID/{% app_name_slug %}:latest"]
args: ["push", "gcr.io/$PROJECT_ID/{{- .AppNameSlug -}}:latest"]
# Deploy image to Cloud Run
- name: "gcr.io/cloud-builders/gcloud"
@ -23,15 +23,15 @@ steps:
"deploy",
"data",
"--image",
"gcr.io/$PROJECT_ID/{% app_name_slug %}:latest",
"gcr.io/$PROJECT_ID/{{- .AppNameSlug -}}:latest",
"--add-cloudsql-instances",
"$PROJECT_ID:$REGION:{% app_name_slug %}_production",
"$PROJECT_ID:$REGION:{{- .AppNameSlug -}}_production",
"--region",
"$REGION",
"--platform",
"managed",
"--update-env-vars",
"GO_ENV=production,SG_DATABASE_HOST=/cloudsql/$PROJECT_ID:$REGION:{% app_name_slug %}_production,SECRETS_FILE=prod.secrets.yml",
"GO_ENV=production,SG_DATABASE_HOST=/cloudsql/$PROJECT_ID:$REGION:{{- .AppNameSlug -}}_production,SECRETS_FILE=prod.secrets.yml",
"--port",
"8080",
"--service-account",

View File

@ -1,4 +1,4 @@
app_name: "{% app_name %} Development"
app_name: "{{- .AppName }} Development"
host_port: 0.0.0.0:8080
web_ui: true
@ -82,7 +82,7 @@ cors_debug: false
auth:
# Can be 'rails', 'jwt' or 'header'
type: rails
cookie: _{% app_name_slug %}_session
cookie: _{{- .AppNameSlug -}}_session
# Comment this out if you want to disable setting
# the user_id via a header for testing.
@ -134,7 +134,7 @@ database:
type: postgres
host: db
port: 5432
dbname: {% app_name_slug %}_development
dbname: {{- .AppNameSlug -}}_development
user: postgres
password: postgres

View File

@ -9,48 +9,10 @@ services:
ports:
- "5432:5432"
# Yugabyte DB
# yb-master:
# image: yugabytedb/yugabyte:latest
# container_name: yb-master-n1
# command: [ "/home/yugabyte/bin/yb-master",
# "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
# "--master_addresses=yb-master-n1:7100",
# "--replication_factor=1",
# "--enable_ysql=true"]
# ports:
# - "7000:7000"
# environment:
# SERVICE_7000_NAME: yb-master
# db:
# image: yugabytedb/yugabyte:latest
# container_name: yb-tserver-n1
# command: [ "/home/yugabyte/bin/yb-tserver",
# "--fs_data_dirs=/mnt/disk0,/mnt/disk1",
# "--start_pgsql_proxy",
# "--tserver_master_addrs=yb-master-n1:7100"]
# ports:
# - "9042:9042"
# - "6379:6379"
# - "5433:5433"
# - "9000:9000"
# environment:
# SERVICE_5433_NAME: ysql
# SERVICE_9042_NAME: ycql
# SERVICE_6379_NAME: yedis
# SERVICE_9000_NAME: yb-tserver
# depends_on:
# - yb-master
{% app_name_slug %}_api:
{{ .AppNameSlug -}}_api:
image: dosco/super-graph:latest
environment:
GO_ENV: "development"
# Uncomment below for Yugabyte DB
# SG_DATABASE_PORT: 5433
# SG_DATABASE_USER: yugabyte
# SG_DATABASE_PASSWORD: yugabyte
volumes:
- ./config:/config
ports:

View File

@ -2,7 +2,7 @@
# so I only need to overwrite some values
inherits: dev
app_name: "{% app_name %} Production"
app_name: "{{- .AppName }} Production"
host_port: 0.0.0.0:8080
web_ui: false
@ -82,7 +82,7 @@ database:
type: postgres
host: db
port: 5432
dbname: {% app_name_slug %}_production
dbname: {{- .AppNameSlug -}}_production
user: postgres
password: postgres
#pool_size: 10