Skip to content

Commit

Permalink
Load the .env before running install-local.sh to avoid requiring the …
Browse files Browse the repository at this point in the history
…env variables multiple times
  • Loading branch information
carlosbaraza committed Dec 1, 2022
1 parent a7bbd78 commit 1d9a19d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .changeset/cool-hounds-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"lostdock-monitoring": patch
"lostdock-portainer": patch
"lostdock-traefik": patch
---

Load the .env before running install-local.sh to avoid requiring the env variables multiple times
3 changes: 3 additions & 0 deletions packages/lostdock-monitoring/install-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi
cd "$(dirname "$0")"

main() {
local GRAFANA_HOST="${GRAFANA_HOST-$(./.env.sh get GRAFANA_HOST)}"
if [[ -z "${GRAFANA_HOST-}" ]]; then
echo "GRAFANA_HOST is not set"
exit 1
fi
./.env.sh set GRAFANA_HOST="${GRAFANA_HOST}"

local NETDATA_HOST="${NETDATA_HOST-$(./.env.sh get NETDATA_HOST)}"
if [[ -z "${NETDATA_HOST-}" ]]; then
echo "NETDATA_HOST is not set"
exit 1
fi
./.env.sh set NETDATA_HOST="${NETDATA_HOST}"

local NETDATA_BASIC_AUTH="${NETDATA_BASIC_AUTH-$(./.env.sh get NETDATA_BASIC_AUTH)}"
if [[ -z "${NETDATA_BASIC_AUTH-}" ]]; then
echo "NETDATA_BASIC_AUTH is not set"
exit 1
Expand Down
1 change: 1 addition & 0 deletions packages/lostdock-portainer/install-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi
cd "$(dirname "$0")"

main() {
local PORTAINER_HOST="${PORTAINER_HOST-$(./.env.sh get PORTAINER_HOST)}"
if [[ -z "${PORTAINER_HOST-}" ]]; then
echo "PORTAINER_HOST is not set"
exit 1
Expand Down
5 changes: 4 additions & 1 deletion packages/lostdock-traefik/install-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,21 @@ if [[ "${TRACE-0}" == "1" ]]; then set -o xtrace; fi
cd "$(dirname "$0")"

main() {
if [[ -z "${TRAEFIK_HOST-}" ]]; then
local TRAEFIK_HOST="${TRAEFIK_HOST-$(./.env.sh get TRAEFIK_HOST)}"
if [[ -z "$TRAEFIK_HOST" ]]; then
echo "TRAEFIK_HOST is not set"
exit 1
fi
./.env.sh set TRAEFIK_HOST="${TRAEFIK_HOST}"

local TRAEFIK_BASIC_AUTH="${TRAEFIK_BASIC_AUTH-$(./.env.sh get TRAEFIK_BASIC_AUTH)}"
if [[ -z "${TRAEFIK_BASIC_AUTH-}" ]]; then
echo "TRAEFIK_BASIC_AUTH is not set"
exit 1
fi
./.env.sh set TRAEFIK_BASIC_AUTH="${TRAEFIK_BASIC_AUTH}"

local LETSENCRYPT_EMAIL="${LETSENCRYPT_EMAIL-$(./.env.sh get LETSENCRYPT_EMAIL)}"
if [[ -z "${LETSENCRYPT_EMAIL-}" ]]; then
echo "LETSENCRYPT_EMAIL is not set"
exit 1
Expand Down

0 comments on commit 1d9a19d

Please sign in to comment.