Skip to content

Commit

Permalink
feat(elixir): Use asdf to install erlang and elixir (#479)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl0thentr0py authored Jul 25, 2023
1 parent 03be6b6 commit d45ba96
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ ENV DEBIAN_FRONTEND=noninteractive \
COCOAPODS_ALLOW_ROOT=1 \
CARGO_HOME=/root/.cargo \
RUSTUP_HOME=/root/.rustup \
PATH=${PATH}:/root/.cargo/bin:/opt/flutter/bin
PATH=${PATH}:/root/.cargo/bin:/opt/flutter/bin:/root/.asdf/bin:/root/.asdf/shims

RUN apt-get -qq update \
&& apt-get install -y --no-install-recommends \
apt-transport-https \
build-essential \
autoconf \
xsltproc \
fop \
curl \
dirmngr \
gnupg \
Expand All @@ -23,7 +26,6 @@ RUN apt-get -qq update \
unzip \
openjdk-11-jdk \
maven \
elixir \
&& curl -fsSL https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -o /tmp/packages-microsoft-prod.deb \
&& dpkg -i /tmp/packages-microsoft-prod.deb \
&& rm /tmp/packages-microsoft-prod.deb \
Expand Down Expand Up @@ -52,6 +54,14 @@ RUN curl -fsSL https://storage.googleapis.com/flutter_infra_release/releases/sta
&& tar xf /opt/flutter.tar.xz -C /opt \
&& rm /opt/flutter.tar.xz

RUN git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.12.0 \
&& asdf plugin add erlang https://github.com/asdf-vm/asdf-erlang.git \
&& asdf plugin add elixir https://github.com/asdf-vm/asdf-elixir.git \
&& asdf install erlang 25.3 \
&& asdf global erlang 25.3 \
&& asdf install elixir 1.14 \
&& asdf global elixir 1.14

# craft does `git` things against mounted directories as root
RUN git config --global --add safe.directory '*'

Expand Down
1 change: 1 addition & 0 deletions src/targets/hex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export class HexTarget extends BaseTarget {
const spawnOptions = { cwd: directory };
const spawnProcessOptions = { showStdout: true };
await spawnProcess(MIX_BIN, ['local.hex', '--force'], spawnOptions, spawnProcessOptions);
await spawnProcess(MIX_BIN, ['local.rebar', '--force'], spawnOptions, spawnProcessOptions);
await spawnProcess(MIX_BIN, ['deps.get'], spawnOptions, spawnProcessOptions);
await spawnProcess(MIX_BIN, ['hex.publish', '--yes'], spawnOptions, spawnProcessOptions);
},
Expand Down

0 comments on commit d45ba96

Please sign in to comment.