I have an Elixir Umbrella application that I’m trying to build a CI/CD pipeline for using Elixir 1.9 Releases. I’m using Jenkins Pipelines with a Dockerfile agent to setup the build environment and getting the following error when I run mix deps.get
in the Docker agent:
+ echo install dependencies
install dependencies
+ mix deps.get
==> trumpet
Could not find Hex, which is needed to build dependency :ecto_sql
Shall I install Hex? (if running non-interactively, use "mix local.hex --force") [Yn] ** (Mix) Could not find an SCM for dependency :ecto_sql from MyProject.MixProject
My Dockerfile looks like this:
FROM ubuntu:16.04
# install basic tooling
RUN apt-get update && apt-get install -y wget curl apt-transport-https locales
RUN rm -rf /var/lib/apt/lists/* && \
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
# install node & npm
# https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-ubuntu-16-04#how-to-install-using-a-ppa
RUN curl -sL https://deb.nodesource.com/setup_8.x -o nodesource_setup.sh && \
bash nodesource_setup.sh && apt-get install -y nodejs && \
apt-get install -y build-essential
# install yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
# install erlang solution repository
RUN wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && \
dpkg -i erlang-solutions_1.0_all.deb
RUN apt-get update && apt-get install -y esl-erlang
# install elixir
RUN apt-get install -y elixir
# install hex
RUN mix local.hex --force
# install rebar
RUN mix local.rebar --force
and my Jenkinsfile like this:
pipeline {
agent {
dockerfile {
reuseNode true
args '-v $HOME/.mix:/root/.m2'
}
}
stages {
stage('Build') {
environment {
MIX_ENV = credentials('mix-env')
}
steps {
sh """
echo 'install dependencies'
mix deps.get
mix deps.compile
"""
}
}
}
}
Am I missing some piece of Elixir/Erlang configuration to get this working? Or is the issue more with some esoteric feature of Jenkins that I’m not familiar with yet?