-
Notifications
You must be signed in to change notification settings - Fork 368
Expand file tree
/
Copy path.envrc
More file actions
64 lines (55 loc) · 2.8 KB
/
.envrc
File metadata and controls
64 lines (55 loc) · 2.8 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
# =============================================================================
# Cloud Controller NG - Development Environment
# =============================================================================
#
# QUICK START (local development):
# cc-containers start # Start DBs, UAA, nginx
# bundle install && cc-generate-config && cc-reset-db
# eval "$(cc-db-env psql ccdb)" # Set database env vars
# bin/cloud_controller -c tmp/.dev-generated/cloud_controller.local.yml
#
# SCRIPTS (all start with 'cc-'):
# cc-containers <cmd> # start/stop/logs/status (see --help)
# cc-db-env <db> <schema> # Database env vars (e.g. psql ccdb, mysql test)
# cc-generate-config [mode] # Generate cloud_controller.yml configs
# cc-reset-db # Drop and recreate all databases
# cc-setup-ide # Copy IDE configs (VS Code, IntelliJ)
#
# PERSONAL OVERRIDES (.envrc.local, gitignored):
# export PARALLEL_TEST_PROCESSORS=4
#
# =============================================================================
cores=$(/usr/sbin/sysctl -n hw.logicalcpu 2>/dev/null || nproc 2>/dev/null || echo 4)
if (( cores > 8 )); then
# This environment variable overrides the `parallel_test` gem's default behavior
# which is to use all available logical cores.
# Running with 16 cores is very slow for reasons we don't fully understand
# but are probably due to lock file or disk resource contention
export PARALLEL_TEST_PROCESSORS=8
fi
# Set CC_CONFIG for local development (devcontainer sets CC_CONFIG=devcontainer)
# This is used by VS Code launch configs to select the right cloud_controller.yml
export CC_CONFIG="${CC_CONFIG:-local}"
# Database connection prefixes - used by IDE run configs and parallel tests
# Devcontainer overrides these in devcontainer.json with container hostnames (postgres, mysql)
export POSTGRES_CONNECTION_PREFIX="${POSTGRES_CONNECTION_PREFIX:-postgres://postgres:supersecret@localhost:5432}"
export MYSQL_CONNECTION_PREFIX="${MYSQL_CONNECTION_PREFIX:-mysql2://root:supersecret@127.0.0.1:3306}"
# Storage CLI path for S3 blobstore mode
export STORAGE_CLI_PATH="${PWD}/tmp/bin/storage-cli"
PATH_add bin
PATH_add .devcontainer/scripts
# =============================================================================
# Developer Overrides
# =============================================================================
if [ -f .envrc.local ]; then
source_env .envrc.local
fi
# Show quick hint on directory entry
if [ -n "$DEVCONTAINER" ]; then
log_status "Cloud Controller NG (devcontainer)"
log_status "Quick start: cc-generate-config && eval \"\$(cc-db-env psql ccdb)\""
else
log_status "Cloud Controller NG (local)"
log_status "Quick start: cc-containers start && cc-generate-config && cc-reset-db"
fi
log_status "See README.md for full setup instructions"