chore(elixir): clone the repo only one time
Install each version on a separate release folder.
This commit is contained in:
parent
04cf851b80
commit
f19ab4df1a
12
Dockerfile
12
Dockerfile
@ -200,11 +200,7 @@ RUN mkdir -p ${HOME}/.local/src \
|
|||||||
# mix do deps.get, deps.compile
|
# mix do deps.get, deps.compile
|
||||||
# MIX_ENV=prod mix compile
|
# MIX_ENV=prod mix compile
|
||||||
# MIX_ENV=prod mix elixir_ls.release
|
# MIX_ENV=prod mix elixir_ls.release
|
||||||
RUN git clone https://github.com/elixir-lsp/elixir-ls.git ${LOCAL_SRC_HOME}/elixir-ls/v0.12.0 \
|
RUN git clone https://github.com/elixir-lsp/elixir-ls.git ${LOCAL_SRC_HOME}/elixir-ls
|
||||||
&& cd ${LOCAL_SRC_HOME}/elixir-ls/v0.12.0 \
|
|
||||||
&& git checkout tags/v0.12.0 \
|
COPY ./scripts/docker-entrypoint.sh /usr/local/bin/docker-entrypoint
|
||||||
&& cp .release-tool-versions .tool-versions \
|
COPY ./scripts/elixir-ls-setup.sh /usr/local/bin/elixir-ls-setup
|
||||||
&& git clone https://github.com/elixir-lsp/elixir-ls.git ${LOCAL_SRC_HOME}/elixir-ls/v0.14.6 \
|
|
||||||
&& cd ${LOCAL_SRC_HOME}/elixir-ls/v0.14.6 \
|
|
||||||
&& git checkout tags/v0.14.6 \
|
|
||||||
&& cp .release-tool-versions .tool-versions
|
|
||||||
|
12
scripts/docker-entrypoint.sh
Executable file
12
scripts/docker-entrypoint.sh
Executable file
@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# NOTE (jpd): setup elixir-ls for older versions of elixir
|
||||||
|
if [ ! -d ${LOCAL_SRC_HOME}/elixir-ls/release ]; then
|
||||||
|
echo "setup elixir ls version 0.12.0"
|
||||||
|
/usr/local/bin/elixir-ls-setup v0.12.0
|
||||||
|
echo "setup elixir ls version 0.14.6"
|
||||||
|
/usr/local/bin/elixir-ls-setup v0.14.6
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec "$@"
|
28
scripts/elixir-ls-setup.sh
Executable file
28
scripts/elixir-ls-setup.sh
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
function setup() {
|
||||||
|
local elixir_ls_home=${LOCAL_SRC_HOME}/elixir-ls
|
||||||
|
local elixir_ls_release=${elixir_ls_home}/release
|
||||||
|
echo "elixir-ls repo"
|
||||||
|
cd ${elixir_ls_home}
|
||||||
|
echo "checkout versions ${1}"
|
||||||
|
git checkout tags/${1}
|
||||||
|
echo "set erlang/elixir versions"
|
||||||
|
cp .release-tool-versions .tool-versions
|
||||||
|
echo "using erlang $(rtx current erlang) / elixir $(rtx current elixir)"
|
||||||
|
echo "install erlang/elixir runtimes"
|
||||||
|
KERL_CONFIGURE_OPTIONS="-with-ssl=${HOME}/.local/lib/ssl" rtx install
|
||||||
|
echo "install elixir-ls deps"
|
||||||
|
mix do local.rebar --force, local.hex --force, deps.get, deps.compile
|
||||||
|
echo "compile and release elixir-ls"
|
||||||
|
MIX_ENV=prod mix compile
|
||||||
|
MIX_ENV=prod mix elixir_ls.release -o ${elixir_ls_release}/${1}
|
||||||
|
echo "remove local .tool-versions"
|
||||||
|
cp .tool-versions ${elixir_ls_release}/${1}
|
||||||
|
rm .tool-versions
|
||||||
|
mix do deps.clean --all, clean
|
||||||
|
git checkout master
|
||||||
|
}
|
||||||
|
|
||||||
|
setup $1
|
Loading…
x
Reference in New Issue
Block a user