Skip to content

Commit

Permalink
Change envrc to .env (#483)
Browse files Browse the repository at this point in the history
## Description

The setup scripts in `tinkerbell/tink` are different from that of `tinkerbell/sandbox`.

## Why is this needed

Fixes: #481
  • Loading branch information
mergify[bot] authored Apr 20, 2021
2 parents a56e5cf + c03a265 commit d13a368
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ terraform.tfstate.backup
# Vagrant
**/.vagrant
envrc
.env
deploy/state
6 changes: 3 additions & 3 deletions deploy/vagrant/scripts/tinkerbell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ main() (
ensure_docker_exists
ensure_docker-compose_exists

if [ ! -f ./envrc ]; then
./generate-envrc.sh eth1 >envrc
if [ ! -f ./.env ]; then
./generate-env.sh eth1 >.env
fi

# shellcheck disable=SC1091
. ./envrc
. ./.env

make_certs_writable

Expand Down
6 changes: 3 additions & 3 deletions generate-envrc.sh → generate-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ generate_password() (
head -c 12 /dev/urandom | sha256sum | cut -d' ' -f1
)

generate_envrc() (
generate_env() (
local tink_interface=$1

validate_tinkerbell_network_interface "$tink_interface"
Expand Down Expand Up @@ -85,11 +85,11 @@ EOF

main() (
if [ -z "${1:-}" ]; then
err "Usage: $0 network-interface-name > envrc"
err "Usage: $0 network-interface-name > .env"
exit 1
fi

generate_envrc "$1"
generate_env "$1"
)

main "$@"
6 changes: 3 additions & 3 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set -eu
# See https://tinkerbell.org/setup for the installation steps.

# file to hold all environment variables
ENV_FILE=envrc
ENV_FILE=.env

SCRATCH=$(mktemp -d -t tmp.XXXXXXXXXX)
readonly SCRATCH
Expand Down Expand Up @@ -480,7 +480,7 @@ check_prerequisites() (
)

whats_next() (
echo "$NEXT 1. Enter /vagrant/deploy and run: source ../envrc; docker-compose up -d"
echo "$NEXT 1. Enter /vagrant/deploy and run: source ../.env; docker-compose up -d"
echo "$BLANK 2. Try executing your first workflow."
echo "$BLANK Follow the steps described in https://tinkerbell.org/examples/hello-world/ to say 'Hello World!' with a workflow."
)
Expand All @@ -500,7 +500,7 @@ do_setup() (
check_prerequisites "$lsb_dist" "$lsb_version"

if [ ! -f "$ENV_FILE" ]; then
echo "$ERR Run './generate-envrc.sh network-interface > \"$ENV_FILE\"' before continuing."
echo "$ERR Run './generate-env.sh network-interface > \"$ENV_FILE\"' before continuing."
exit 1
fi

Expand Down

0 comments on commit d13a368

Please sign in to comment.