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