This repository has been archived by the owner on Apr 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.envrc
35 lines (29 loc) · 1.54 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
# Environment variables go here, and can be read in by Python using `os.getenv`:
#
# --------------------------------------------------------
# import os
#
# # Example variable
# EXAMPLE_VARIABLE = os.getenv("EXAMPLE_VARIABLE")
# --------------------------------------------------------
#
# To ensure the `sed` command below works correctly, make sure all file paths in environment variables are absolute
# (recommended), or are relative paths using other environment variables (works for Python users only). Environment
# variable names are expected to contain letters, numbers or underscores only.
#
# DO NOT STORE SECRETS HERE - this file is version-controlled! You should store secrets in a `.secrets` file, which is
# not version-controlled - this can then be sourced here, using `source_env ".secrets"`.
# Extract the variables to `.env` if required. Note `.env` is NOT version-controlled, so `.secrets` will not be
# committed
sed -n 's/^export \(.*\)$/\1/p' .envrc | sed -e 's?$(pwd)?'"$(pwd)"'?g' | sed -e 's?$\([a-zA-Z0-9_]\{1,\}\)?${\1}?g' > .env
# Add the working directory to PYTHONPATH
export PYTHONPATH="$PYTHONPATH:$(pwd)"
# Import secrets from an untracked file `.secrets`
# source_env ".secrets"
# Add environment variables for the `docs` directory
export DIR_DOCS=$(pwd)/docs
# Add environment variables for the `source` directories
export DIR_SOURCE=$(pwd)/source
export DIR_SOURCE_ALPHAGOV_TECH_DOCS_TEMPLATE=$(pwd)/source/alphagov-tech-docs-template
# Add environment variables for the `tests` directory
export DIR_TESTS=$(pwd)/tests