forked from chef/automate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.envrc
41 lines (36 loc) · 1.55 KB
/
.envrc
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
# Make sure that we have specified the HAB_STUDIO_SECRET_GITHUB_TOKEN variable
if [[ "x$HAB_STUDIO_SECRET_GITHUB_TOKEN" == "x" ]]; then
echo -e "\n\nERROR: Please update your shell environment and set the HAB_STUDIO_SECRET_GITHUB_TOKEN environment variable."
echo -e "If you don't have one, you can create a token at https://github.com/settings/tokens. It should have all the scopes under repo.\n\n"
fi
# Add extra ports you need for development. (ex. 9200 for elasticsearch)
ports_to_export=(
2000 # automate-gateway
443 # automate-load-balancer
8989 # workflow git server
2345 # Delve Server (Go debugger)
10141 # Elasticsearch port
10140 # NATS internal-to-a2 port
4222 # NATS external facing port
10109 # automate-prometheus
3334 # chef-ui-library
)
for p in "${ports_to_export[@]}"
do
[[ $HAB_DOCKER_OPTS != "" ]] && HAB_DOCKER_OPTS=" ${HAB_DOCKER_OPTS}"
HAB_DOCKER_OPTS="-p ${p}:${p}${HAB_DOCKER_OPTS}"
done
export HAB_DOCKER_OPTS
if [[ -f ".dev/secrets-env.sh" ]]; then
source ".dev/secrets-env.sh"
fi
# Avoid starting the supervisor automatically
# We will be injecting the config via the .studiorc
export HAB_STUDIO_SUP=false
# Read in aws creds from environment
export HAB_STUDIO_SECRET_AWS_ACCESS_KEY_ID="${AWS_ACCESS_KEY_ID}"
export HAB_STUDIO_SECRET_AWS_SECRET_ACCESS_KEY="${AWS_SECRET_ACCESS_KEY}"
# Read in azure creds from environment
export HAB_STUDIO_SECRET_AZURE_CLIENT_ID="${AZURE_CLIENT_ID}"
export HAB_STUDIO_SECRET_AZURE_CLIENT_SECRET="${AZURE_CLIENT_SECRET}"
export HAB_STUDIO_SECRET_AZURE_TENANT_ID="${AZURE_TENANT_ID}"