Skip to content

Commit

Permalink
copy when linking fails and move BUILD_DIR default to default.env
Browse files Browse the repository at this point in the history
  • Loading branch information
mishaschwartz committed Aug 15, 2023
1 parent 95c6284 commit 9cce2b4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions birdhouse/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
# must use single quotes to avoid early expansion before overrides in env.local
# are applied and must be added to the list of DELAYED_EVAL.

export BUILD_DIR='${COMPOSE_DIR}/build'

export BASH_IMAGE="bash:5.1.4"

# Root directory under which all data persistence should be nested under
Expand All @@ -24,6 +26,7 @@ export PAVICS_FQDN_PUBLIC='${PAVICS_FQDN}'
export DELAYED_EVAL="
$DELAYED_EVAL
PAVICS_FQDN_PUBLIC
BUILD_DIR
"


Expand Down
7 changes: 4 additions & 3 deletions birdhouse/pavics-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ for adir in $AUTODEPLOY_EXTRA_REPOS; do
done
export AUTODEPLOY_EXTRA_REPOS_AS_DOCKER_VOLUMES

BUILD_DIR="${BUILD_DIR:-"${COMPOSE_DIR}/build"}"

COMPOSE_FILE="${BUILD_DIR}/docker-compose.yml"

# Keep the compose project name as "birdhouse" by default (no matter where the build directory is located)
Expand All @@ -98,7 +96,10 @@ if [ x"$1" = x"up" ]; then
RELATIVE_FILE_PATH=${FILE#${adir}}
DEST="${BUILD_DIR}/${CONF_NAME}/${RELATIVE_FILE_PATH#/}"
mkdir -p "$(dirname "${DEST}")"
ln "${FILE}" "${DEST}"
if ! ln "${FILE}" "${DEST}"; then
echo "${YELLOW}Warning:${NORMAL} unable to link '${FILE}' to '${DEST}'. Attempting to copy instead."
cp "${FILE}" "${DEST}"
fi
done
done

Expand Down

0 comments on commit 9cce2b4

Please sign in to comment.