-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.envrc
87 lines (74 loc) · 3.02 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
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
#! /usr/bin/env bash
# !!! -------------------------------------- !!!
# !!! DO NOT MAKE LOCAL CHANGES TO THIS FILE !!!
# !!! -------------------------------------- !!!
# Vars in this file can be overridden by exporting them in .envrc.local
# ------------------
# AWS VAULT SETTINGS
# ------------------
export AWS_VAULT_KEYCHAIN_NAME=login
export AWS_PROFILE=transcom-gov-dev
export AWS_REGION="us-gov-west-1"
export DISABLE_AWS_VAULT_WRAPPER=1
# ----------------
# CHAMBER SETTINGS
# ----------------
# Make Chamber read ~/.aws/config
export AWS_SDK_LOAD_CONFIG=1
# Make Chamber use the default AWS KMS key
export CHAMBER_KMS_KEY_ALIAS='alias/aws/ssm'
# Make Chamber use path based keys ('/' instead of '.')
export CHAMBER_USE_PATHS=1
# Sets the number of retries for chamber to 20.
export CHAMBER_RETRIES=20
#### Nix Experiment Start ####
# if nix is installed, use it
if [ ! -r .nix-disable ] && has nix-env; then
# set NIX_PROFILE so nix-env operations don't need to manually
# specify the profile path
export NIX_PROFILE="/nix/var/nix/profiles/per-user/${LOGNAME}/milmove-load-testing"
nix_dir="nix"
# add the nix files so that if they change, direnv needs to be reloaded
watch_file "${nix_dir}"/*.nix
config_hash=$(nix-hash "${nix_dir}")
store_hash=$(nix-store -q --hash "${NIX_PROFILE}")
# The .nix-hash file is created by nix/update.sh
if [ ! -r .nix-hash ] || ! grep -q "${config_hash}-${store_hash}" .nix-hash; then
log_status "WARNING: nix packages out of date. Run ${nix_dir}/update.sh"
fi
# add the NIX_PROFILE bin path so that everything we just installed
# is available on the path
PATH_add "${NIX_PROFILE}/bin"
fi
# Loads secrets from chamber instead of requiring them to be listed in .envrc.local
if [ -e .envrc.chamber ]; then
# Loading secrets from Chamber can take a while. Prevent direnv from complaining
export DIRENV_WARN_TIMEOUT="20s"
# Evaluate if the files have drifted
if ! cmp .envrc.chamber .envrc.chamber.template >/dev/null 2>&1; then
log_error "Your .envrc.chamber has drifted from .envrc.chamber.template.
Please 'cp .envrc.chamber.template .envrc.chamber' or 'ln -s .envrc.chamber.template .envrc.chamber"
fi
source_env .envrc.chamber
else
log_status "Want to load secrets from chamber? 'ln -s .envrc.chamber.template .envrc.chamber'"
fi
# ----------------
# LOCUST REPORTING
# ----------------
# Set the directories for the reports generated by Locust during a load test.
# DOES NOT use the Locust env variable names because those automatically override the logging/reporting settings for all
# tests thereafter.
export LOCAL_CSV_DIR="static/reports"
export DOCKER_CSV_DIR="/app/$LOCAL_CSV_DIR"
# ---------------
# LOCAL OVERRIDES
# ---------------
# Load a local overrides file. Any changes you want to make for your local environment should live in that file.
# These values will override the values set in this file AND the ones loaded from chamber.
if [ -e .envrc.local ]
then
source_env .envrc.local
fi
# layout after setting PATH so we get the right python version
layout pipenv