Skip to content

Commit

Permalink
fix(snap): Update env file path for security bootstrapper services (#…
Browse files Browse the repository at this point in the history
…4555)

Signed-off-by: Mengyi Wang <mengyi.wang@canonical.com>
  • Loading branch information
MonicaisHer authored May 8, 2023
1 parent ce5d240 commit 857beb7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion snap/local/runtime-helpers/bin/source-env-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ BINPATH="${ARGV[0]}"

# binary name == service name/key
SERVICE=$(basename "$BINPATH")
ENV_FILE="$SNAP_DATA/config/$SERVICE/overrides.env"
if [ -z $ENV_FILE ]; then
ENV_FILE="$SNAP_DATA/config/$SERVICE/overrides.env"
fi
TAG="edgex-$SERVICE."$(basename "$0")

if [ -f "$ENV_FILE" ]; then
Expand Down
4 changes: 2 additions & 2 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ apps:
command-chain:
- bin/source-env-file.sh
environment:
ENV_FILE: $SNAP_DATA/config/security-bootstrapper/res/security-bootstrapper.env
ENV_FILE: $SNAP_DATA/config/security-bootstrapper/overrides.env
SECRETSTORE_SERVERNAME: localhost
SECRETSTORE_TOKENFILE: $SNAP_DATA/secrets/security-bootstrapper-redis/secrets-token.json
DATABASECONFIG_PATH: $SNAP_DATA/redis/conf
Expand All @@ -148,7 +148,7 @@ apps:
command-chain:
- bin/source-env-file.sh
environment:
ENV_FILE: $SNAP_DATA/config/security-bootstrapper/res/security-bootstrapper.env
ENV_FILE: $SNAP_DATA/config/security-bootstrapper/overrides.env
STAGEGATE_REGISTRY_HOST: localhost
STAGEGATE_REGISTRY_ACL_BOOTSTRAPTOKENPATH: $SNAP_DATA/secrets/consul-acl-token/bootstrap_token.json
STAGEGATE_REGISTRY_ACL_MANAGEMENTTOKENPATH: $SNAP_DATA/secrets/consul-acl-token/mgmt_token.json
Expand Down

0 comments on commit 857beb7

Please sign in to comment.