Skip to content

Commit

Permalink
Dockerfile, Jenkinsfile: testing based on Jenkinsfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Everett Hildenbrandt committed Jan 29, 2019
1 parent 1b518a9 commit fd9a970
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
FROM ubuntu:bionic

ENV TZ=America/Chicago
RUN ln --symbolic --no-dereference --force /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone

RUN apt update && apt upgrade --yes

RUN apt install --yes \
autoconf curl flex gcc libffi-dev libmpfr-dev libtool make maven \
opam openjdk-8-jdk pandoc pkg-config python3 python-pygments \
python-recommonmark python-sphinx time zlib1g-dev

RUN update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java

RUN curl -sSL https://get.haskellstack.org/ | sh

RUN git clone 'https://github.com/z3prover/z3' --branch=z3-4.6.0 \
&& cd z3 \
&& python scripts/mk_make.py \
&& cd build \
&& make -j8 \
&& make install \
&& cd ../.. \
&& rm -rf z3

ARG USER_ID=1000
ARG GROUP_ID=1000
RUN groupadd --gid $GROUP_ID user \
&& useradd --create-home --uid $USER_ID --shell /bin/sh --gid user user

USER $USER_ID:$GROUP_ID

RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.28.0

ADD .build/k/k-distribution/src/main/scripts/bin/k-configure-opam-dev .build/k/k-distribution/src/main/scripts/bin/k-configure-opam-common /home/user/.tmp-opam/bin/
ADD .build/k/k-distribution/src/main/scripts/lib/opam /home/user/.tmp-opam/lib/opam/
RUN cd /home/user \
&& ./.tmp-opam/bin/k-configure-opam-dev
39 changes: 39 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
pipeline {
agent {
dockerfile {
additionalBuildArgs '--build-arg USER_ID=$(id -u) --build-arg GROUP_ID=$(id -g)'
}
}
stages {
stage("Init title") {
when { changeRequest() }
steps {
script {
currentBuild.displayName = "PR ${env.CHANGE_ID}: ${env.CHANGE_TITLE}"
}
}
}
stage('Build') {
steps {
ansiColor('xterm') {
sh '''
export PATH=$HOME/.local/bin:$PATH
make clean
make deps
make build -j2
'''
}
}
}
stage('Test') {
steps {
ansiColor('xterm') {
sh '''
export PATH=$HOME/.local/bin:$PATH
make test -j6
'''
}
}
}
}
}

0 comments on commit fd9a970

Please sign in to comment.