Skip to content

Commit

Permalink
Parameterise runtime app path
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Jan 18, 2016
1 parent 309f5ca commit 939a2b0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
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
6 changes: 5 additions & 1 deletion lib/path_funcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ function erlang_path() {
echo "$(platform_tools_path)/erlang"
}

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

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

function elixir_path() {
Expand Down

0 comments on commit 939a2b0

Please sign in to comment.