From 9286fe02695c98803d1dded660433c9bdaf5bb91 Mon Sep 17 00:00:00 2001 From: Lukas Breuer Date: Mon, 9 Apr 2018 12:17:46 +0200 Subject: [PATCH] Improve precompilation --- entrypoint.ash | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/entrypoint.ash b/entrypoint.ash index 89d9337..2f4600c 100755 --- a/entrypoint.ash +++ b/entrypoint.ash @@ -4,8 +4,10 @@ set -e function compile { # Make sure that the tooling is present - mix local.hex --force - mix local.rebar --force + if [[ ! -d /mix-archives/hex-* ]] || [[ ! -f /mix/rebar ]] || [[ ! -f /mix/rebar3 ]]; then + mix local.hex --force + mix local.rebar --force + fi # Recompile mix deps.get @@ -14,9 +16,16 @@ function compile { # Execute onbuild actions if required if [[ "$1" == "onbuild" ]]; then - # On build we use the sources instead of the runtime - cd /pleroma + # Pretend we're in runtime mode + mv /pleroma /pleroma-runtime + cd /pleroma-runtime + + # Build pleroma compile + + # Put precompiled sources back + cd / + mv /pleroma-runtime /pleroma exit 0 fi