Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't hard-code runtime application path #62

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ config_vars_to_export=(DATABASE_URL)

# A command to run right after compiling the app
post_compile="pwd"

# Set the path the app is run from
runtime_path=/app
```


Expand Down
1 change: 1 addition & 0 deletions elixir_buildpack.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ erlang_version=18.1.3
elixir_version=1.2.0
always_rebuild=false
config_vars_to_export=(DATABASE_URL)
runtime_path=/app
8 changes: 4 additions & 4 deletions lib/erlang_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ function install_erlang() {
mkdir -p $(erlang_build_path)
tar zxf ${cache_path}/$(erlang_tarball) -C $(erlang_build_path) --strip-components=1

rm -rf /app/.platform_tools/erlang
mkdir -p /app/.platform_tools
ln -s $(erlang_build_path) /app/.platform_tools/erlang
$(erlang_build_path)/Install -minimal /app/.platform_tools/erlang
rm -rf $(runtime_erlang_path)
mkdir -p $(runtime_platform_tools_path)
ln -s $(erlang_build_path) $(runtime_erlang_path)
$(erlang_build_path)/Install -minimal $(runtime_erlang_path)

cp -R $(erlang_build_path) $(erlang_path)
PATH=$(erlang_path)/bin:$PATH
Expand Down
8 changes: 8 additions & 0 deletions lib/path_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ function erlang_path() {
echo "$(platform_tools_path)/erlang"
}

function runtime_platform_tools_path() {
echo "${runtime_path}/.platform_tools"
}

function runtime_erlang_path() {
echo "$(runtime_platform_tools_path)/erlang"
}

function elixir_path() {
echo "$(platform_tools_path)/elixir"
}
Expand Down