Use set -a/+a and docker env file formats
Some checks failed
continuous-integration/drone/pr Build is failing
Some checks failed
continuous-integration/drone/pr Build is failing
Closes https://git.autonomic.zone/coop-cloud/abra/issues/40.
This commit is contained in:
9
abra
9
abra
@ -407,8 +407,11 @@ load_instance() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
load_instance_env() {
|
load_instance_env() {
|
||||||
|
set -a
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
source "$ENV_FILE"
|
source "$ENV_FILE"
|
||||||
|
set +a
|
||||||
|
|
||||||
if [ -z "$APP" ]; then
|
if [ -z "$APP" ]; then
|
||||||
error "APP not set, maybe $ENV_FILE is using an old format?"
|
error "APP not set, maybe $ENV_FILE is using an old format?"
|
||||||
fi
|
fi
|
||||||
@ -513,10 +516,14 @@ sub_app_list (){
|
|||||||
FILE="${PARTS[-1]}"
|
FILE="${PARTS[-1]}"
|
||||||
SERVER="${PARTS[-2]}"
|
SERVER="${PARTS[-2]}"
|
||||||
DOMAIN="${FILE%.env}"
|
DOMAIN="${FILE%.env}"
|
||||||
|
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
|
set -a
|
||||||
APP="$(source "$ENV_FILE" && echo "$APP")"
|
APP="$(source "$ENV_FILE" && echo "$APP")"
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
APP_STACK_NAME="$(source "$ENV_FILE" && echo "$STACK_NAME")"
|
APP_STACK_NAME="$(source "$ENV_FILE" && echo "$STACK_NAME")"
|
||||||
|
set +a
|
||||||
|
|
||||||
if [ -z "$APP_STACK_NAME" ]; then
|
if [ -z "$APP_STACK_NAME" ]; then
|
||||||
APP_STACK_NAME="${DOMAIN//./_}"
|
APP_STACK_NAME="${DOMAIN//./_}"
|
||||||
fi
|
fi
|
||||||
@ -1042,7 +1049,9 @@ abra() {
|
|||||||
# --env <env>
|
# --env <env>
|
||||||
if [ -n "$abra___env" ]; then
|
if [ -n "$abra___env" ]; then
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
|
set -a
|
||||||
source "$abra___env" || error "Unable to load env from '$abra___env'"
|
source "$abra___env" || error "Unable to load env from '$abra___env'"
|
||||||
|
set +a
|
||||||
fi
|
fi
|
||||||
|
|
||||||
load_custom_commands
|
load_custom_commands
|
||||||
|
Reference in New Issue
Block a user