forked from tektoncd/pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This add a .envrc file that will be used by direnv to setup the environment for the project if `direnv` is enabled. It also adds a `.env.sample` to give an example of what it could be useful for. And it adds `.env` to gitignore to make sure people do not commit their specific environment configurations. Signed-off-by: Vincent Demeester <[email protected]>
- Loading branch information
1 parent
f975869
commit 89ac5c2
Showing
3 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# shellcheck shell=bash | ||
# This is an example of a .env file | ||
export GOMAXPROCS=6 | ||
export KO_DOCKER_REPO=gcr.io/tektoncd/pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# shellcheck shell=bash | ||
|
||
# If .env missing; restore from .env.sample and validate | ||
# See https://github.com/direnv/direnv/wiki/.envrc-Boilerplate | ||
if [[ -f .env.sample ]]; then | ||
if [[ ! -f .env ]]; then | ||
if ! command -v createnv > /dev/null; then | ||
echo 'WARN|Createnv missing; try: pyenv local 3.x && pip install createnv' | ||
else | ||
createnv --use-default --overwrite || echo 'ERROR|https://github.com/cuducos/createnv' | ||
if command dotenv-linter --version >&/dev/null; then | ||
dotenv-linter .env || echo 'ERROR|https://dotenv-linter.github.io' | ||
fi | ||
fi | ||
fi | ||
fi | ||
|
||
dotenv_if_exists || direnv status # https://direnv.net/man/direnv-stdlib.1.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters