diff --git a/bin/build b/bin/build index a0b31b1..d7809cf 100755 --- a/bin/build +++ b/bin/build @@ -10,6 +10,7 @@ source_dir="${bp_dir}/target" layers_dir="${1:?}" platform_dir="${2:?}" +app_dir="$(pwd)" # translate new stack ID to old stack ID export STACK="$CNB_STACK_ID" @@ -24,13 +25,18 @@ cache_dir="${layers_dir}/shim" mkdir -p "${cache_dir}" echo "cache = true" > ${layers_dir}/shim.toml -"${target_dir}/bin/compile" "$(pwd)" "${cache_dir}" "${platform_dir}/env" +"${target_dir}/bin/compile" "$app_dir" "${cache_dir}" "${platform_dir}/env" # copy profile.d scripts into a layer so they will be sourced if [[ -d .profile.d ]]; then profile_dir="${layers_dir}/profile" + mkdir -p "${profile_dir}/profile.d" cp .profile.d/* "${profile_dir}/profile.d/" + + mkdir -p "${profile_dir}/env.launch" + echo -n "$app_dir" > "${profile_dir}/env.launch/HOME.override" + echo "launch = true" > "${profile_dir}.toml" fi @@ -41,4 +47,4 @@ if [[ -f "${target_dir}/export" ]]; then fi # run bin/release, read Procfile, and generate launch.toml -"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}" "${platform_dir}" "$(pwd)" +"${bp_dir}/bin/release" "${target_dir}" "${layers_dir}" "${platform_dir}" "$app_dir"