From df233533a05f4c8ed920cd13dc927020fbcfac8f Mon Sep 17 00:00:00 2001 From: Brien Wankel Date: Thu, 25 Oct 2018 16:02:51 -0700 Subject: [PATCH 1/3] Use kerl to manage OTP installation --- .circleci/config.yml | 2 ++ script/ci/prepare.sh | 18 +++++------------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1ebb5df..2ab41e7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,11 +20,13 @@ jobs: - run: mix local.rebar --force - restore_cache: # restores saved mix cache + name: Restore mix cache keys: # list of cache keys, in decreasing specificity - mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }} - mix-cache-{{ .Branch }} - mix-cache - restore_cache: # restores saved build cache + name: Restore build cache keys: - build-cache-{{ .Branch }} - build-cache diff --git a/script/ci/prepare.sh b/script/ci/prepare.sh index 5622e9e..5710382 100755 --- a/script/ci/prepare.sh +++ b/script/ci/prepare.sh @@ -11,25 +11,17 @@ export ELIXIR_VERSION="v1.6.0" export ERLANG_PATH="$INSTALL_PATH/otp_src_$ERLANG_VERSION" export ELIXIR_PATH="$INSTALL_PATH/elixir_$ELIXIR_VERSION" +export KERL_PATH="$INSTALL_PATH/bin/kerl" mkdir -p $INSTALL_PATH cd $INSTALL_PATH # Install erlang if [ ! -e $INSTALL_PATH/bin/erl ]; then - curl -L -O http://www.erlang.org/download/otp_src_$ERLANG_VERSION.tar.gz - tar xzf otp_src_$ERLANG_VERSION.tar.gz - cd $ERLANG_PATH - ./configure --enable-smp-support \ - --enable-m64-build \ - --disable-native-libs \ - --disable-sctp \ - --enable-threads \ - --enable-kernel-poll \ - --disable-hipe \ - --without-javac \ - --prefix=$INSTALL_PATH - make install + curl https://raw.githubusercontent.com/kerl/kerl/master/kerl -o $KERL_PATH + chmod a+x $KERL_PATH + $KERL_PATH build $ERLANG_VERSION $ERLANG_VERSION + $KERL_PATH install $ERLANG_VERSION $INSTALL_PATH else echo "Erlang already installed." fi From d2048ed19550f46d1f1b1459d07542233d100a7f Mon Sep 17 00:00:00 2001 From: Brien Wankel Date: Wed, 31 Oct 2018 13:41:51 -0700 Subject: [PATCH 2/3] Manually copy erlang install --- script/ci/prepare.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/script/ci/prepare.sh b/script/ci/prepare.sh index 5710382..47c0e24 100755 --- a/script/ci/prepare.sh +++ b/script/ci/prepare.sh @@ -10,10 +10,12 @@ export ERLANG_VERSION="20.3" export ELIXIR_VERSION="v1.6.0" export ERLANG_PATH="$INSTALL_PATH/otp_src_$ERLANG_VERSION" +export ERLANG_INSTALL="$ERLANG_PATH/$ERLANG_VERSION" export ELIXIR_PATH="$INSTALL_PATH/elixir_$ELIXIR_VERSION" export KERL_PATH="$INSTALL_PATH/bin/kerl" mkdir -p $INSTALL_PATH +mkdir -p $ERLANG_INSTALL cd $INSTALL_PATH # Install erlang @@ -21,7 +23,8 @@ if [ ! -e $INSTALL_PATH/bin/erl ]; then curl https://raw.githubusercontent.com/kerl/kerl/master/kerl -o $KERL_PATH chmod a+x $KERL_PATH $KERL_PATH build $ERLANG_VERSION $ERLANG_VERSION - $KERL_PATH install $ERLANG_VERSION $INSTALL_PATH + $KERL_PATH install $ERLANG_VERSION $ERLANG_INSTALL + cp -R $ERLANG_INSTALL @INSTALL_PATH else echo "Erlang already installed." fi From a89de2731707331db87f2bbe15b8eda3fb6e2265 Mon Sep 17 00:00:00 2001 From: Brien Wankel Date: Wed, 31 Oct 2018 14:00:29 -0700 Subject: [PATCH 3/3] Make sure bin directory exists before downloading kerl --- script/ci/prepare.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/ci/prepare.sh b/script/ci/prepare.sh index 47c0e24..640b30b 100755 --- a/script/ci/prepare.sh +++ b/script/ci/prepare.sh @@ -14,7 +14,7 @@ export ERLANG_INSTALL="$ERLANG_PATH/$ERLANG_VERSION" export ELIXIR_PATH="$INSTALL_PATH/elixir_$ELIXIR_VERSION" export KERL_PATH="$INSTALL_PATH/bin/kerl" -mkdir -p $INSTALL_PATH +mkdir -p $INSTALL_PATH/bin mkdir -p $ERLANG_INSTALL cd $INSTALL_PATH