-
Notifications
You must be signed in to change notification settings - Fork 32
/
.envrc
64 lines (62 loc) · 1.84 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
#
# Commands dependencies
# =====================
#
DIRENV_CMD_DEPENDENCIES="unzip tar mkdir curl chmod rm"
for mandatory_cmd in ${DIRENV_CMD_DEPENDENCIES}; do
if [ -z "$(which ${mandatory_cmd})" ]; then
echo "===> Mandatory command not found: ${mandatory_cmd}"
exit 1
fi
done
#
# Direnv configuration
# =====================
#
layout_python3 || echo "Executing out of direnv"
export DIRENV_TMP_DIR="${PWD}/.direnv"
export DIRENV_BIN_DIR="${DIRENV_TMP_DIR}/bin"
if [ ! -e "${DIRENV_BIN_DIR}" ]; then
mkdir -p "${DIRENV_BIN_DIR}"
fi
export PATH="${DIRENV_BIN_DIR}:${PATH}"
DIRENV_PYTHON_LIBS_DIR_RELATIVE="$(find ${DIRENV_TMP_DIR} -type d -name site-packages)"
export DIRENV_PYTHON_LIBS_DIR="$(realpath ${DIRENV_PYTHON_LIBS_DIR_RELATIVE})"
export PYTHONPATH="${DIRENV_PYTHON_LIBS_DIR}:${PWD}/plugins:${PWD}/docs/plugins"
#
# Ansible configuration
# =====================
#
export ANSIBLE_LIBRARY="${PWD}/plugins/modules:${ANSIBLE_LIBRARY}"
if [ ! -e "${PWD}/.is_container" ]; then
export ANSIBLE_COLLECTIONS_PATH="${DIRENV_TMP_DIR}"
fi
export ANSIBLE_INVENTORY="inventory"
export ANSIBLE_SSH_ARGS="-F ssh.cfg"
export ANSIBLE_ROLES_PATH="${DIRENV_TMP_DIR}/ansible_roles:${PWD}/roles"
export ANSIBLE_DISPLAY_SKIPPED_HOSTS="True"
# export ANSIBLE_VAULT_PASSWORD_FILE="${PWD}/.env.vault"
export MOLECULE_CONTAINERS_BACKEND="docker"
#
# Fork management for OSX
#
export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
#
# Environment configuration
# =========================
#
#
ENV_ADDONS=".env.local .env.secrets .env.secret"
for addon in ${ENV_ADDONS}; do
if [ -e "${PWD}/${addon}" ]; then
source ${PWD}/${addon}
fi
done
#
# Terraform CLI configuration
# ==========================
#
export TF_PLUGIN_CACHE_DIR="${DIRENV_TMP_DIR}/terraform-plugin-cache"
if [ ! -e "${TF_PLUGIN_CACHE_DIR}" ]; then
mkdir -p "${TF_PLUGIN_CACHE_DIR}"
fi