-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.env.template
More file actions
97 lines (87 loc) · 4.7 KB
/
Copy pathdeploy.env.template
File metadata and controls
97 lines (87 loc) · 4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# =============================================================================
# deploy.env.template — deployment settings for build-dev.sh / build-sccssar-dev.sh
#
# COPY THIS FILE to `deploy.env` in the repo root, then replace every
# placeholder below with your own values.
#
# cp deploy.env.template deploy.env
#
# `deploy.env` is GITIGNORED — never commit it. This template is intentionally
# committed and MUST contain placeholders only, exactly like
# terraform/environments/dev/terraform.tfvars.template.
#
# Why a separate untracked file rather than editing the build scripts directly:
# .gitignore has no effect on a file that is already tracked, so an edited
# build-*.sh would still stage and commit your project IDs. The only mechanism
# that actually works is keeping the real values in a file git never tracked.
#
# Each build script sets ENV_NAME and sources this file. Add a case block per
# environment you deploy to. Every value is required; a missing one aborts the
# build rather than deploying somewhere unintended.
# =============================================================================
case "${ENV_NAME}" in
# ---------------------------------------------------------------------------
# Your sandbox / staging project. Deploy here FIRST, always.
# ---------------------------------------------------------------------------
dev)
# GCP project ID (Console → project picker, or `gcloud projects list`).
PROJECT="your-dev-project-id"
# OAuth 2.0 Web application client ID:
# Console → APIs & Services → Credentials → OAuth 2.0 Client IDs.
# Add the Cloud Run URL below as an authorized JavaScript origin.
# Injected at image build time and substituted into frontend/index.html;
# this is NOT a secret (it ships to every browser), but it must match the
# project you are deploying to or sign-in fails with origin_mismatch.
OAUTH_CLIENT_ID="YOUR_DEV_OAUTH_CLIENT_ID.apps.googleusercontent.com"
# Cloud Run service URL, printed in the post-deploy verification hints.
# Shown by `gcloud run services describe dispatch-console --region us-central1`.
SERVICE_URL="https://dispatch-console-YOURPROJECTNUMBER.us-central1.run.app"
# Banner text rendered in the app so a sandbox is never mistaken for the
# real thing. Leave EMPTY for a production-facing environment.
#
# Deliberately NOT guarded: an environment that fails to set it renders no
# banner and so looks production-facing, which makes the operator more
# careful. A guard would instead risk labelling production a sandbox.
# Passed by build-dev.sh; build-sccssar-dev.sh omits the build-arg entirely.
ENV_LABEL="SANDBOX — dev"
# Human-readable name for the deploy script's own header.
DISPLAY_NAME="Dev"
# Read-only tooling only (the dispatch-after-action skill); the build
# scripts do not use these. GCLOUD_CONFIG is the named gcloud
# configuration that holds this project's credentials
# (`gcloud config configurations list`), and OPERATOR_ACCOUNT is the
# account it should be authenticated as. Activate the configuration
# FIRST and authenticate SECOND -- `gcloud auth login` writes
# core/account into whichever configuration is active, so doing it the
# other way round silently rewrites the profile you were already in.
GCLOUD_CONFIG="default"
OPERATOR_ACCOUNT="you@example.org"
;;
# ---------------------------------------------------------------------------
# Your team / production-facing project. Deploy here only after dev is good.
#
# The key is the ENV_NAME that build-sccssar-dev.sh sets. It is just a label
# for the second environment -- rename the script and this block together if
# you prefer something else.
# ---------------------------------------------------------------------------
sccssar-dev)
PROJECT="your-team-project-id"
OAUTH_CLIENT_ID="YOUR_TEAM_OAUTH_CLIENT_ID.apps.googleusercontent.com"
SERVICE_URL="https://dispatch-console-YOURPROJECTNUMBER.us-central1.run.app"
ENV_LABEL=""
DISPLAY_NAME="Team Dev"
GCLOUD_CONFIG="team-dev"
OPERATOR_ACCOUNT="you@your-team-domain.org"
;;
*)
echo " ERROR: deploy.env has no case block for ENV_NAME='${ENV_NAME}'." >&2
echo " Add one, or check the ENV_NAME set by the build script." >&2
exit 1
;;
esac
# -----------------------------------------------------------------------------
# Path to the gcloud CLI. The default resolves gcloud from PATH; override only
# if yours is somewhere PATH does not reach (a Homebrew install under
# /opt/homebrew/share/google-cloud-sdk/bin, for example).
# -----------------------------------------------------------------------------
GCLOUD="${GCLOUD:-$(command -v gcloud || true)}"