From b2eb346ac340827f623a7e0e6d26f82d55169bb5 Mon Sep 17 00:00:00 2001 From: Everett Hildenbrandt Date: Tue, 29 Jan 2019 08:55:37 -0700 Subject: [PATCH] Dockerfile, Jenkinsfile: testing based on Jenkinsfile --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e622ca0 --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..5d6ad95 --- /dev/null +++ b/Jenkinsfile @@ -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 + ''' + } + } + } + } +}