From: Timo Heister Date: Thu, 24 May 2018 02:53:55 +0000 (+0800) Subject: Enable continuous integration using Jenkins X-Git-Tag: v9.5.1-r1~4^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F345%2Fhead;p=candi.git Enable continuous integration using Jenkins --- diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..11f4613 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,102 @@ +#!groovy + +pipeline +{ + agent none + + parameters { + booleanParam(defaultValue: false, description: 'Is the pull request approved for testing?', name: 'TRUST_BUILD') + } + + stages { + + stage ("info") + { + steps + { + echo "PR: ${env.CHANGE_ID} - ${env.CHANGE_TITLE}" + echo "CHANGE_AUTHOR_EMAIL: ${env.CHANGE_AUTHOR_EMAIL}" + echo "building on node ${env.NODE_NAME}" + } + } + + stage ("Check permissions") + { + when { + allOf { + environment name: 'TRUST_BUILD', value: 'false' + not {branch 'master'} + not {changeRequest authorEmail: "timo.heister@gmail.com"} + } + } + steps { + echo "Please ask an admin to rerun Jenkins with TRUST_BUILD=true" + sh "exit 1" + } + } + + stage ("Ubuntu-20.04") + { + options {timeout(time: 600, unit: 'MINUTES')} + agent + { + dockerfile + { + dir 'contrib/ubuntu2004' + } + } + + steps + { + sh '''#!/bin/bash + set -e + set -x + mpicxx -v + cmake --version + # Ubuntu 20.04 only ships cmake 3.16 not 3.17: + echo 'PACKAGES="once:cmake ${PACKAGES}"' > local.cfg + ./candi.sh -j 10 -p $WORKSPACE + cp $WORKSPACE/tmp/build/deal.II-*/detailed.log detailed-ubuntu2004.log + ''' + archiveArtifacts artifacts: 'detailed-ubuntu2004.log', fingerprint: true + + sh '''#!/bin/bash + cd $WORKSPACE/tmp/build/deal.II-* && make test + ''' + } + } + + stage ("OSX-M1") + { + options {timeout(time: 600, unit: 'MINUTES')} + agent + { + node + { + label 'osx' + } + } + + post { cleanup { cleanWs() } } + + steps + { + sh '''#!/bin/bash + set -e + set -x + ./candi.sh -j 8 --packages="p4est petsc trilinos sundials dealii" -p $WORKSPACE + cp $WORKSPACE/tmp/build/deal.II-*/detailed.log detailed-osx.log + ''' + + archiveArtifacts artifacts: 'detailed-osx.log', fingerprint: true + + sh '''#!/bin/bash + cd $WORKSPACE/tmp/build/deal.II-* && make test + ''' + } + } + + } + + +} diff --git a/contrib/ubuntu2004/Dockerfile b/contrib/ubuntu2004/Dockerfile new file mode 100644 index 0000000..54e6449 --- /dev/null +++ b/contrib/ubuntu2004/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:20.04 + +USER root + +RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + lsb-release git subversion wget bc libgmp-dev \ + build-essential autoconf automake cmake libtool gfortran python3 \ + zlib1g-dev \ + openmpi-bin openmpi-common libopenmpi-dev \ + libblas3 libblas-dev liblapack3 liblapack-dev libsuitesparse-dev \ + && rm -rf /var/lib/apt/lists/* + +ARG USER=bob +RUN adduser --disabled-password --gecos '' $USER +RUN adduser $USER sudo; echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN chown -R $USER:$USER /home/$USER +USER $USER +ENV HOME /home/$USER +ENV USER $USER +ENV OMPI_MCA_btl "^vader" +WORKDIR $HOME diff --git a/contrib/ubuntu2204/Dockerfile b/contrib/ubuntu2204/Dockerfile new file mode 100644 index 0000000..5f7ef33 --- /dev/null +++ b/contrib/ubuntu2204/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:22.04 + +USER root + +RUN apt-get update && DEBIAN_FRONTEND="noninteractive" apt-get install -y \ + lsb-release git subversion wget bc libgmp-dev \ + build-essential autoconf automake cmake libtool gfortran python3 \ + zlib1g-dev \ + openmpi-bin openmpi-common libopenmpi-dev \ + libblas3 libblas-dev liblapack3 liblapack-dev libsuitesparse-dev \ + && rm -rf /var/lib/apt/lists/* + +ARG USER=bob +RUN adduser --disabled-password --gecos '' $USER +RUN adduser $USER sudo; echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +RUN chown -R $USER:$USER /home/$USER +USER $USER +ENV HOME /home/$USER +ENV USER $USER +ENV OMPI_MCA_btl "^vader" +WORKDIR $HOME