-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.env.sh.dist
executable file
·115 lines (90 loc) · 4.93 KB
/
.env.sh.dist
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
##################################################################
# `.env.sh.dist` History (useful if you used a previous one!)
##################################################################
export ENV_SH_CONFIG="2.1"
# 2022-08-16 2.1 Added the ENABLE_APP03 (defaults to FALSE)
# 2022-08-16 2.1 Deprecated GKE_ALTERNATIVE_REGION which was not used anymore, anyway.
# 2022-07-18 2.0 [breaking change] Deprecated URLMAP_NAME now only using URLMAP_NAME_MTSUFFIX for sol2.
# 2022-07-08 1.9 Added $CLOUD_DNS_PROJECT_ID
# 2022-07-08 1.8 Added $DEBUG to .env.sh and DIST. Also added some echoes in .env.sh.dist n case its TRUE which is enabled by DFLT :)
# 2022-07-08 1.7 Moved GITHUB_REPO_OWNER to .env.sh.dist/.env.sh to let people use the code for their fork. See docs 6.5 coming.
# 2022-07-08 1.6 Woops, Renamed GKE_REGION to GKE_ALTERNATIVE_REGION as that was the second. The first is REGION which i now aliases to GKE_REGION to avoid confusion in the .post script.
# 2022-07-07 1.5 Renamed GKE_REGION2 to GKE_REGION. It was just confusing.
# 2022-07-06 1.4 Added URLMAP_NAME for solution 2 Load Balancing (and FWD_RULE to .env.sh.post)
# 2022-07-05 1.3 Added MY_DOMAIN for real DNS websites. (not strictly needed if youre ok to do curl -H)
# 2022-06-14 1.2 Added GKE_REGION2 to create a second pair of GKE clusters (without autpilot as per dmarzi directives) and not to incur QUOTA issues :/
# 2022-06-03 1.1 Added a mandatory 'source .env.sh.post' please upgrade your .env.sh!
# 2022-05-XX 1.0 Initial stesure.
##################################################################
########################################
# GCP Stuff: CHANGE ME!!!
########################################
export PROJECT_ID='your-project-id' # changeme!
export ACCOUNT='your.gcp.account.probably-on@gmail.com' # changeme!
export GCLOUD_REGION='us-central1' # changeme!
export GITHUB_REPO_OWNER="aablsk" # changeme!
########################################
# /END CHANGE ME (everything below here is optional)
########################################
# You dont need to change this.
export GCLOUD_CONFIG='platinum-cicd-test' # This is your gcloud configuration. If unsure leaves as this
# JFYI: This will be set in the .post script.
#export GKE_REGION="$REGION"
# Currently not used as of v0.4
#OBSOLETE export GKE_ALTERNATIVE_REGION="europe-north1" # Finland
#########################################################
# *Note* this is TOTALLY OPTIONAL and not part of the codelab. To make it work, you need to go through
# the `examples/` folder and tweak the scripts a bit. The set up of Cloud DNS is beyond the purposes of this.
export MY_DOMAIN="riccardo.example.com"
#########################################################
####################
# Application-wise
####################
export APPNAME="cicd-codelab"
##############################
# Derived from above values
##############################
export REGION="$GCLOUD_REGION"
export LOCATION="$GCLOUD_REGION"
export APP_NAME="$APPNAME"
# Note this makes more sense for a monolithic app.
export APP_VERSION=$(cat ./VERSION)
# Useful for docker
export APPNAME_WITH_VERSION="$APPNAME:v$APP_VERSION"
## Derived - for this platinum project
export SKAFFOLD_BUCKET="${PROJECT_ID}-skaffoldcache"
# you can change this but no reason to do it.
export ARTIFACT_REPONAME="cicd-plat"
#CLUSTER_NAMES=cicd-dev / cicd-prod (hardcoded sorry)
# You might have to change this to a bigger region as I wasnt able to create a
# CD pipeline in Zurich, for instance. If you have the same problem, change it
# to a bigger region.
export CLOUD_DEPLOY_REGION="$REGION"
##########################################################
# Solution pertinent vars
##########################################################
##########################################################
#Solution 0-3 (ILB) variables
##########################################################
#Solution 1 variables
##########################################################
#Solution2
#export URLMAP_NAME="http-svc9010-lb-obsolete" # obsolete - should be added to APPXX to make it work
# *NOTE* do NOT remove the "sol2" part since its essential for grepping. Change after the dash as you please.
export URLMAP_NAME_MTSUFFIX="sol2-ummt" # Solution2 UrlMap MultiTenant
#export FWD_RULE_MTSUFFIX="DO-NOT-DEFINE-ME" # This is now created in the .env.sh.post
#Solution4
export ENABLE_APP03="true"
##########################################################
# /Solutions
##########################################################
export DEBUG="true"
# change it if its different!
export CLOUD_DNS_PROJECT_ID="$PROJECT_ID"
#####################################################
# Mandatory as of v1.1
# Magic DIR: https://stackoverflow.com/questions/59895/how-can-i-get-the-source-directory-of-a-bash-script-from-within-the-script-itsel
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )";
source "$SCRIPT_DIR/.env.sh.post"
#####################################################