From 64a45510c802ce057f945703883cf7a2d8def8a1 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Mon, 12 Feb 2018 14:11:41 -0500 Subject: [PATCH] [jenkins] add triqs-docker-based linux builds --- .dockerignore | 3 +++ Dockerfile | 10 ++++++++++ Jenkinsfile | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 Jenkinsfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..f6f7fc8a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +Dockerfile +Jenkinsfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..704e29a7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +# See ../triqs/packaging for other options +FROM flatironinstitute/triqs:master-ubuntu-clang + +COPY . ${SRC}/dft_tools +WORKDIR ${BUILD}/dft_tools +RUN chown build . +USER build +RUN cmake ${SRC}/dft_tools -DTRIQS_ROOT=${INSTALL} && make -j2 && make test +USER root +RUN make install diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 00000000..76333733 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,34 @@ +properties([ + disableConcurrentBuilds(), + pipelineTriggers([ + upstream( + threshold: 'SUCCESS', + upstreamProjects: '/TRIQS/triqs/' + env.BRANCH_NAME.replaceAll('/', '%2F') + ) + ]) +]) + +def platforms = [:] + +def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "centos-gcc"] +for (int i = 0; i < dockerPlatforms.size(); i++) { + def platform = dockerPlatforms[i] + platforms[platform] = { -> + stage(platform) { + timeout(time: 1, unit: 'HOURS') { + node('docker') { + checkout scm + /* construct a Dockerfile for this base */ + sh ''' + ( echo "FROM flatironinstitute/triqs:$BRANCH_NAME-$STAGE_NAME" ; sed '0,/^FROM /d' Dockerfile ) > Dockerfile.jenkins + mv -f Dockerfile.jenkins Dockerfile + ''' + /* build and tag */ + def img = docker.build("flatironinstitute/dft_tools:${env.BRANCH_NAME}-${env.STAGE_NAME}") + } + } + } + } +} + +parallel platforms