Move .build-template.yml definitions closer to point of use.
authorM. Eric Irrgang <ericirrgang@gmail.com>
Mon, 16 Mar 2020 16:01:37 +0000 (19:01 +0300)
committerPaul Bauer <paul.bauer.q@gmail.com>
Sun, 22 Mar 2020 11:09:22 +0000 (12:09 +0100)
Change-Id: I2d4d5e6063495b658550640c7cdf6655e0f03f6e

.gitlab-ci.yml
admin/ci-templates/.build-template.yml [deleted file]
admin/gitlab-ci/archive.gitlab-ci.yml
admin/gitlab-ci/testing-matrix.gitlab-ci.yml

index 032c30c223b1e9f679e3d6e20a64c2f792cbfd92..40989e01428f1cd560f14b6d82af5521bf635e12 100644 (file)
@@ -44,7 +44,6 @@ include:
   # Mix-in helper job definitions of general utility.
   - local: '/admin/gitlab-ci/global.gitlab-ci.yml'
   # Various composable job definitions.
-  - local: '/admin/ci-templates/.build-template.yml'
   - local: '/admin/ci-templates/.gcc-before-script.yml'
   - local: '/admin/ci-templates/.gcc-build-template.yml'
   - local: '/admin/ci-templates/.clang-build-template.yml'
diff --git a/admin/ci-templates/.build-template.yml b/admin/ci-templates/.build-template.yml
deleted file mode 100644 (file)
index d4cab7c..0000000
+++ /dev/null
@@ -1,291 +0,0 @@
-.configure-build-template:
-  # Docker image uploaded to dockerhub by user eriklindahl
-  # TODO: Get DockerFile for admin/dockerfiles
-  stage: configure-build
-  image: biophysics/gcc-gromacs
-  variables:
-    KUBERNETES_CPU_LIMIT: 1
-    KUBERNETES_CPU_REQUEST: 1
-    KUBERNETES_MEMORY_LIMIT: 2Gi
-    CMAKE_COMPILER_SCRIPT: ""
-    CMAKE_EXTRA_OPTIONS: ""
-    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
-    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
-    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
-    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
-    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
-    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
-
-  script:
-    - echo $CMAKE_COMPILER_SCRIPT
-    - echo $CMAKE_EXTRA_OPTIONS
-    - echo $CMAKE_SIMD_OPTIONS
-    - echo $CMAKE_GPU_OPTIONS
-    - echo $CMAKE_MPI_OPTIONS
-    - echo $CMAKE_PRECISION_OPTIONS
-    - echo $CMAKE_BUILD_TYPE_OPTIONS
-    - echo $CMAKE_GMXAPI_OPTIONS
-    - if [[ -d $BUILD_DIR ]] ; then
-        rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
-      else
-        echo "Preparing new build directory" ;
-        mkdir $BUILD_DIR ;
-      fi
-    - cd $BUILD_DIR
-    - cmake ..
-        -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-        $CMAKE_COMPILER_SCRIPT
-        $CMAKE_EXTRA_OPTIONS
-        $CMAKE_SIMD_OPTIONS
-        $CMAKE_MPI_OPTIONS
-        $CMAKE_PRECISION_OPTIONS
-        $CMAKE_BUILD_TYPE_OPTIONS
-        $CMAKE_GPU_OPTIONS
-        $CMAKE_GMXAPI_OPTIONS
-        -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
-        2>&1 | tee cmakeLog.log
-    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
-    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
-    - cd ..
-  artifacts:
-    when: always
-    paths:
-      - $BUILD_DIR
-
-.configure-build-release-template:
-  # Dockerfiles are from dockerhub, user eriklindahl
-  # image in admin/dockerimages/ci-docs-py27
-  stage: release-configure
-  image: biophysics/gcc-gromacs
-  variables:
-    KUBERNETES_CPU_LIMIT: 1
-    KUBERNETES_CPU_REQUEST: 1
-    KUBERNETES_MEMORY_LIMIT: 2Gi
-    CMAKE_COMPILER_SCRIPT: ""
-    CMAKE_EXTRA_OPTIONS: ""
-    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
-    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
-    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
-    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
-    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
-    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
-    RELEASE_BUILD_DIR: release-builds
-    RELEASE_SOURCE: release-source-from-tarball
-    RELEASE_REGRESSIONTESTS: release-regressiontests-from-tarball
-
-  only:
-    refs:
-      - web
-      - schedules
-      - triggers
-    variables:
-      - $GROMACS_RELEASE
-  script:
-    - VERSION=`cat version.json |
-        python3 -c "import json,sys; print(json.load(sys.stdin)['version'])"`
-    - if [[ $GROMACS_RELEASE != "true" ]] ; then
-          VERSION=$VERSION-dev ;
-      fi
-    - SOURCENAME=gromacs-$VERSION
-    - SOURCETARBALL=$SOURCENAME.tar.gz
-    - REGTESTNAME=regressiontests-$VERSION
-    - REGTESTTARBALL=$REGTESTNAME.tar.gz
-    - echo "$SOURCETARBALL"
-    - echo "$REGTESTTARBALL"
-    - RELEASE_TARBALLS=release-tarballs
-    - rm -rf $RELEASE_TARBALLS $RELEASE_SOURCE $RELEASE_REGRESSIONTESTS && mkdir $RELEASE_TARBALLS
-    - mv $SOURCETARBALL $RELEASE_TARBALLS
-    - mv $REGTESTTARBALL $RELEASE_TARBALLS
-    - cd $RELEASE_TARBALLS
-# We rename the source and regressiontest directories
-# to have names for them that don't change for different versions.
-    - tar -xf $SOURCETARBALL
-    - mv $SOURCENAME ../$RELEASE_SOURCE
-    - tar -xf $REGTESTTARBALL
-    - mv $REGTESTNAME ../$RELEASE_REGRESSIONTESTS
-    - rm $SOURCETARBALL $REGTESTTARBALL
-    - cd ..
-    - echo $CMAKE_COMPILER_SCRIPT
-    - echo $CMAKE_EXTRA_OPTIONS
-    - echo $CMAKE_SIMD_OPTIONS
-    - echo $CMAKE_GPU_OPTIONS
-    - echo $CMAKE_MPI_OPTIONS
-    - echo $CMAKE_PRECISION_OPTIONS
-    - echo $CMAKE_BUILD_TYPE_OPTIONS
-    - echo $CMAKE_GMXAPI_OPTIONS
-    - if [[ -d $RELEASE_BUILD_DIR ]] ; then
-        echo "Cleaning up build directory" ;
-        rm -rf $RELEASE_BUILD_DIR && mkdir $RELEASE_BUILD_DIR ;
-      else
-        echo "Preparing new build directory" ;
-        mkdir $RELEASE_BUILD_DIR ;
-      fi
-    - cd $RELEASE_BUILD_DIR
-    - cmake ../$RELEASE_SOURCE/
-        -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-        $CMAKE_COMPILER_SCRIPT
-        $CMAKE_EXTRA_OPTIONS
-        $CMAKE_SIMD_OPTIONS
-        $CMAKE_MPI_OPTIONS
-        $CMAKE_PRECISION_OPTIONS
-        $CMAKE_BUILD_TYPE_OPTIONS
-        $CMAKE_GPU_OPTIONS
-        $CMAKE_GMXAPI_OPTIONS
-        "-DREGRESSIONTEST_PATH=../$RELEASE_REGRESSIONTESTS"
-        -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
-        2>&1 | tee cmakeLog.log
-    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
-    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
-    - cd ..
-  artifacts:
-    when: always
-    paths:
-      - $RELEASE_BUILD_DIR
-      - $RELEASE_REGRESSIONTESTS
-      - $RELEASE_SOURCE
-
-.binary-build-template:
-  # Dockerfiles are from dockerhub, user eriklindahl
-  # image in admin/dockerimages/ci-docs-py27
-  stage: build
-  image: biophysics/gcc-gromacs
-  variables:
-
-  script:
-    - cd $BUILD_DIR
-    - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
-    - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
-    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
-      | grep -v "CMake" | tee buildErrors.log || true
-    - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
-    - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
-    - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
-    - cd ..
-  artifacts:
-    when: always
-    paths:
-      - $BUILD_DIR
-      - $INSTALL_DIR/
-
-# Right now we need to use an ugly hack to move the original build directory
-# and the ccache files out of the build archive, as it is not possible to use
-# the custom build directory due to https://gitlab.com/gitlab-org/gitlab-runner/issues/4203
-# As soon as this is resolved we should use the separate build directories instead of
-# manually hacking things. TODO
-# Redmine #3361
-.archive-build-template:
-  # Dockerfiles are from dockerhub, user eriklindahl
-  image: gromacs/ci-docs-clang:master
-  variables:
-    KUBERNETES_CPU_LIMIT: 4
-    KUBERNETES_CPU_REQUEST: 2
-    KUBERNETES_MEMORY_LIMIT: 4Gi
-  script:
-    - rm -rf gromacs*tar.gz
-    - cd $BUILD_DIR
-    - cmake --build . --target gmx -- -j4 2>&1 | tee buildLogFile.log
-    - cmake --build . --target man -- -j4 2>&1 | tee manBuildLogFile.log
-    - cmake --build . --target completion -- -j4 2>&1 | tee completionBuildLogFile.log
-    - cmake --build . --target install-guide -- -j4 2>&1 | tee installGuideBuildLogFile.log
-    - cmake --build . --target reference_checksum -- -j4 2>&1 | tee checksumBuildLogFile.log
-    - cmake --build . --target package_source -- -j4 2>&1 | tee packageBuildLogFile.log
-    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log manBuildLogFile.log 
-      completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
-      packageBuildLogFile.log | grep -v "CMake" | tee buildErrors.log || true
-    - grep "cannot be built" buildLogFile.log manBuildLogFile.log 
-      completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
-      packageBuildLogFile.log | tee -a buildErrors.log || true 
-    - if [ -s buildErrors.log ] ; then echo "Found warnings during build"; cat buildErrors.log; exit 1; fi
-    - mv gromacs*tar.gz ..
-    - cd ..
-    # ugly hack begins here
-    - mkdir tempdir
-    - SOURCETARBALL=`ls gromacs*tar.gz`
-    - mv $SOURCETARBALL tempdir
-    - cd tempdir
-    - tar -xf $SOURCETARBALL
-    - rm -rf gromacs-*/$BUILD_DIR
-    - tar -c --gzip -f $SOURCETARBALL gromacs-*/
-    - mv $SOURCETARBALL ..
-    - cd ..
-    - rm -rf tempdir
-    # Hack ends here
-  artifacts:
-    when: always
-    expire_in: 1 week
-    paths:
-      - $BUILD_DIR/*log
-      - gromacs*tar.gz
-
-
-.simple-build-template:
-  # Docker images are from dockerhub, user eriklindahl
-  stage: pre-build
-  image: biophysics/gcc-gromacs
-  variables:
-    KUBERNETES_CPU_LIMIT: 8
-    KUBERNETES_CPU_REQUEST: 4
-    KUBERNETES_MEMORY_LIMIT: 8Gi
-    CMAKE_COMPILER_SCRIPT: ""
-    CMAKE_EXTRA_OPTIONS: ""
-    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
-    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
-    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
-    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
-    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
-    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
-
-  script:
-    - echo $CMAKE_COMPILER_SCRIPT
-    - echo $CMAKE_EXTRA_OPTIONS
-    - echo $CMAKE_SIMD_OPTIONS
-    - echo $CMAKE_GPU_OPTIONS
-    - echo $CMAKE_MPI_OPTIONS
-    - echo $CMAKE_PRECISION_OPTIONS
-    - echo $CMAKE_BUILD_TYPE_OPTIONS
-    - echo $CMAKE_GMXAPI_OPTIONS
-    - if [[ -d $BUILD_DIR ]] ; then
-        echo "Cleaning up build directory" ;
-        rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
-      else
-        echo "Preparing new build directory" ;
-        mkdir $BUILD_DIR ;
-      fi
-    - cd $BUILD_DIR
-    - cmake ..
-        -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-        $CMAKE_COMPILER_SCRIPT
-        $CMAKE_EXTRA_OPTIONS
-        $CMAKE_SIMD_OPTIONS
-        $CMAKE_MPI_OPTIONS
-        $CMAKE_PRECISION_OPTIONS
-        $CMAKE_BUILD_TYPE_OPTIONS
-        $CMAKE_GPU_OPTIONS
-        $CMAKE_GMXAPI_OPTIONS
-        -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
-        2>&1 | tee cmakeLog.log
-    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
-    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
-    - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
-    - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
-    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
-      | grep -v "CMake" | tee buildErrors.log || true
-    - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
-    - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
-    - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
-    - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
-    - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
-         ctestLog.log | tee ctestErrors.log
-    - xsltproc scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
-    - if [ -s ctestErrors.log ] ; then
-        echo "Error during running ctest";
-        exit 1;
-      fi
-    - cd ..
-  artifacts:
-    reports:
-      junit: $BUILD_DIR/JUnitTestResults.xml
-    paths:
-        - $BUILD_DIR/*log
-    when: always
-    expire_in: 1 week
index 28a10814b459b0b32491d10953615042ecdf9ae7..2ec33f3f9cb0f5ba66e41ed63a70fc08284eda97 100644 (file)
@@ -182,6 +182,56 @@ configure-archive-release:
     CMAKE_EXTRA_OPTIONS: -DGMX_BUILD_HELP=on -DGMX_USE_RDTSCP=OFF
     CMAKE_MPI_OPTIONS: -DGMX_THREAD_MPI=OFF -DGMX_OPENMP=OFF
 
+# Right now we need to use an ugly hack to move the original build directory
+# and the ccache files out of the build archive, as it is not possible to use
+# the custom build directory due to https://gitlab.com/gitlab-org/gitlab-runner/issues/4203
+# As soon as this is resolved we should use the separate build directories instead of
+# manually hacking things. TODO
+# Redmine #3361
+.archive-build-template:
+  # Dockerfiles are from dockerhub, user eriklindahl
+  image: gromacs/ci-docs-clang:master
+  variables:
+    KUBERNETES_CPU_LIMIT: 4
+    KUBERNETES_CPU_REQUEST: 2
+    KUBERNETES_MEMORY_LIMIT: 4Gi
+  script:
+    - rm -rf gromacs*tar.gz
+    - cd $BUILD_DIR
+    - cmake --build . --target gmx -- -j4 2>&1 | tee buildLogFile.log
+    - cmake --build . --target man -- -j4 2>&1 | tee manBuildLogFile.log
+    - cmake --build . --target completion -- -j4 2>&1 | tee completionBuildLogFile.log
+    - cmake --build . --target install-guide -- -j4 2>&1 | tee installGuideBuildLogFile.log
+    - cmake --build . --target reference_checksum -- -j4 2>&1 | tee checksumBuildLogFile.log
+    - cmake --build . --target package_source -- -j4 2>&1 | tee packageBuildLogFile.log
+    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log manBuildLogFile.log
+      completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
+      packageBuildLogFile.log | grep -v "CMake" | tee buildErrors.log || true
+    - grep "cannot be built" buildLogFile.log manBuildLogFile.log
+      completionBuildLogFile.log installGuideBuildLogFile.log checksumBuildLogFile.log
+      packageBuildLogFile.log | tee -a buildErrors.log || true
+    - if [ -s buildErrors.log ] ; then echo "Found warnings during build"; cat buildErrors.log; exit 1; fi
+    - mv gromacs*tar.gz ..
+    - cd ..
+    # ugly hack begins here
+    - mkdir tempdir
+    - SOURCETARBALL=`ls gromacs*tar.gz`
+    - mv $SOURCETARBALL tempdir
+    - cd tempdir
+    - tar -xf $SOURCETARBALL
+    - rm -rf gromacs-*/$BUILD_DIR
+    - tar -c --gzip -f $SOURCETARBALL gromacs-*/
+    - mv $SOURCETARBALL ..
+    - cd ..
+    - rm -rf tempdir
+    # Hack ends here
+  artifacts:
+    when: always
+    expire_in: 1 week
+    paths:
+      - $BUILD_DIR/*log
+      - gromacs*tar.gz
+
 .build-archive:
   extends:
     - .build-extends-template
index d86d464b409069ec95cfff0e3bb5f1f8d0b48c13..92850e74e4fee69fe3cced38eeec4240be2a8486 100644 (file)
@@ -1,3 +1,76 @@
+
+.simple-build-template:
+  # Docker images are from dockerhub, user eriklindahl
+  stage: pre-build
+  image: biophysics/gcc-gromacs
+  variables:
+    KUBERNETES_CPU_LIMIT: 8
+    KUBERNETES_CPU_REQUEST: 4
+    KUBERNETES_MEMORY_LIMIT: 8Gi
+    CMAKE_COMPILER_SCRIPT: ""
+    CMAKE_EXTRA_OPTIONS: ""
+    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=None"
+    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
+    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
+    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
+    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
+    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
+
+  script:
+    - echo $CMAKE_COMPILER_SCRIPT
+    - echo $CMAKE_EXTRA_OPTIONS
+    - echo $CMAKE_SIMD_OPTIONS
+    - echo $CMAKE_GPU_OPTIONS
+    - echo $CMAKE_MPI_OPTIONS
+    - echo $CMAKE_PRECISION_OPTIONS
+    - echo $CMAKE_BUILD_TYPE_OPTIONS
+    - echo $CMAKE_GMXAPI_OPTIONS
+    - if [[ -d $BUILD_DIR ]] ; then
+      echo "Cleaning up build directory" ;
+      rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
+      else
+      echo "Preparing new build directory" ;
+      mkdir $BUILD_DIR ;
+      fi
+    - cd $BUILD_DIR
+    - cmake ..
+      -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+      $CMAKE_COMPILER_SCRIPT
+      $CMAKE_EXTRA_OPTIONS
+      $CMAKE_SIMD_OPTIONS
+      $CMAKE_MPI_OPTIONS
+      $CMAKE_PRECISION_OPTIONS
+      $CMAKE_BUILD_TYPE_OPTIONS
+      $CMAKE_GPU_OPTIONS
+      $CMAKE_GMXAPI_OPTIONS
+      -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
+      2>&1 | tee cmakeLog.log
+    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
+    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
+    - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
+    - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
+    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
+      | grep -v "CMake" | tee buildErrors.log || true
+    - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
+    - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
+    - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
+    - ctest -D ExperimentalTest --output-on-failure | tee ctestLog.log || true
+    - awk '/The following tests FAILED/,/^Errors while running CTest|^$/'
+      ctestLog.log | tee ctestErrors.log
+    - xsltproc scripts/CTest2JUnit.xsl Testing/`head -n 1 < Testing/TAG`/Test.xml > JUnitTestResults.xml
+    - if [ -s ctestErrors.log ] ; then
+      echo "Error during running ctest";
+      exit 1;
+      fi
+    - cd ..
+  artifacts:
+    reports:
+      junit: $BUILD_DIR/JUnitTestResults.xml
+    paths:
+      - $BUILD_DIR/*log
+    when: always
+    expire_in: 1 week
+
 # Initial build that always needs to pass before follow-up stages run
 simple-build:
   extends:
@@ -15,6 +88,151 @@ simple-build:
       - $GROMACS_RELEASE
 
 # Jobs running in first pre-build stage
+.configure-build-template:
+  # Docker image uploaded to dockerhub by user eriklindahl
+  # TODO: Get DockerFile for admin/dockerfiles
+  stage: configure-build
+  image: biophysics/gcc-gromacs
+  variables:
+    KUBERNETES_CPU_LIMIT: 1
+    KUBERNETES_CPU_REQUEST: 1
+    KUBERNETES_MEMORY_LIMIT: 2Gi
+    CMAKE_COMPILER_SCRIPT: ""
+    CMAKE_EXTRA_OPTIONS: ""
+    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
+    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
+    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
+    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug"
+    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
+    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
+
+  script:
+    - echo $CMAKE_COMPILER_SCRIPT
+    - echo $CMAKE_EXTRA_OPTIONS
+    - echo $CMAKE_SIMD_OPTIONS
+    - echo $CMAKE_GPU_OPTIONS
+    - echo $CMAKE_MPI_OPTIONS
+    - echo $CMAKE_PRECISION_OPTIONS
+    - echo $CMAKE_BUILD_TYPE_OPTIONS
+    - echo $CMAKE_GMXAPI_OPTIONS
+    - if [[ -d $BUILD_DIR ]] ; then
+      rm -rf $BUILD_DIR && mkdir $BUILD_DIR ;
+      else
+      echo "Preparing new build directory" ;
+      mkdir $BUILD_DIR ;
+      fi
+    - cd $BUILD_DIR
+    - cmake ..
+      -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+      $CMAKE_COMPILER_SCRIPT
+      $CMAKE_EXTRA_OPTIONS
+      $CMAKE_SIMD_OPTIONS
+      $CMAKE_MPI_OPTIONS
+      $CMAKE_PRECISION_OPTIONS
+      $CMAKE_BUILD_TYPE_OPTIONS
+      $CMAKE_GPU_OPTIONS
+      $CMAKE_GMXAPI_OPTIONS
+      -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
+      2>&1 | tee cmakeLog.log
+    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
+    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
+    - cd ..
+  artifacts:
+    when: always
+    paths:
+      - $BUILD_DIR
+
+.configure-build-release-template:
+  # Dockerfiles are from dockerhub, user eriklindahl
+  # image in admin/dockerimages/ci-docs-py27
+  stage: release-configure
+  image: biophysics/gcc-gromacs
+  variables:
+    KUBERNETES_CPU_LIMIT: 1
+    KUBERNETES_CPU_REQUEST: 1
+    KUBERNETES_MEMORY_LIMIT: 2Gi
+    CMAKE_COMPILER_SCRIPT: ""
+    CMAKE_EXTRA_OPTIONS: ""
+    CMAKE_SIMD_OPTIONS: "-DGMX_SIMD=AUTO"
+    CMAKE_MPI_OPTIONS: "-DGMX_THREAD_MPI=ON"
+    CMAKE_PRECISION_OPTIONS: "-DGMX_DOUBLE=OFF"
+    CMAKE_BUILD_TYPE_OPTIONS: "-DCMAKE_BUILD_TYPE=RelWithAssert"
+    CMAKE_GPU_OPTIONS: "-DGMX_GPU=OFF"
+    CMAKE_GMXAPI_OPTIONS: "-DGMX_PYTHON_PACKAGE=OFF"
+    RELEASE_BUILD_DIR: release-builds
+    RELEASE_SOURCE: release-source-from-tarball
+    RELEASE_REGRESSIONTESTS: release-regressiontests-from-tarball
+
+  only:
+    refs:
+      - web
+      - schedules
+      - triggers
+    variables:
+      - $GROMACS_RELEASE
+  script:
+    - VERSION=`cat version.json |
+      python3 -c "import json,sys; print(json.load(sys.stdin)['version'])"`
+    - if [[ $GROMACS_RELEASE != "true" ]] ; then
+      VERSION=$VERSION-dev ;
+      fi
+    - SOURCENAME=gromacs-$VERSION
+    - SOURCETARBALL=$SOURCENAME.tar.gz
+    - REGTESTNAME=regressiontests-$VERSION
+    - REGTESTTARBALL=$REGTESTNAME.tar.gz
+    - echo "$SOURCETARBALL"
+    - echo "$REGTESTTARBALL"
+    - RELEASE_TARBALLS=release-tarballs
+    - rm -rf $RELEASE_TARBALLS $RELEASE_SOURCE $RELEASE_REGRESSIONTESTS && mkdir $RELEASE_TARBALLS
+    - mv $SOURCETARBALL $RELEASE_TARBALLS
+    - mv $REGTESTTARBALL $RELEASE_TARBALLS
+    - cd $RELEASE_TARBALLS
+    # We rename the source and regressiontest directories
+    # to have names for them that don't change for different versions.
+    - tar -xf $SOURCETARBALL
+    - mv $SOURCENAME ../$RELEASE_SOURCE
+    - tar -xf $REGTESTTARBALL
+    - mv $REGTESTNAME ../$RELEASE_REGRESSIONTESTS
+    - rm $SOURCETARBALL $REGTESTTARBALL
+    - cd ..
+    - echo $CMAKE_COMPILER_SCRIPT
+    - echo $CMAKE_EXTRA_OPTIONS
+    - echo $CMAKE_SIMD_OPTIONS
+    - echo $CMAKE_GPU_OPTIONS
+    - echo $CMAKE_MPI_OPTIONS
+    - echo $CMAKE_PRECISION_OPTIONS
+    - echo $CMAKE_BUILD_TYPE_OPTIONS
+    - echo $CMAKE_GMXAPI_OPTIONS
+    - if [[ -d $RELEASE_BUILD_DIR ]] ; then
+      echo "Cleaning up build directory" ;
+      rm -rf $RELEASE_BUILD_DIR && mkdir $RELEASE_BUILD_DIR ;
+      else
+      echo "Preparing new build directory" ;
+      mkdir $RELEASE_BUILD_DIR ;
+      fi
+    - cd $RELEASE_BUILD_DIR
+    - cmake ../$RELEASE_SOURCE/
+      -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
+      $CMAKE_COMPILER_SCRIPT
+      $CMAKE_EXTRA_OPTIONS
+      $CMAKE_SIMD_OPTIONS
+      $CMAKE_MPI_OPTIONS
+      $CMAKE_PRECISION_OPTIONS
+      $CMAKE_BUILD_TYPE_OPTIONS
+      $CMAKE_GPU_OPTIONS
+      $CMAKE_GMXAPI_OPTIONS
+      "-DREGRESSIONTEST_PATH=../$RELEASE_REGRESSIONTESTS"
+      -DCMAKE_INSTALL_PREFIX=../$INSTALL_DIR -DGMX_COMPILER_WARNINGS=ON
+      2>&1 | tee cmakeLog.log
+    - awk '/CMake Warning/,/^--|^$/' cmakeLog.log | tee cmakeErrors.log
+    - if [ -s cmakeErrors.log  ] ; then echo "Found CMake warning while processing build"; cat cmakeErrors.log ; exit 1; fi
+    - cd ..
+  artifacts:
+    when: always
+    paths:
+      - $RELEASE_BUILD_DIR
+      - $RELEASE_REGRESSIONTESTS
+      - $RELEASE_SOURCE
 
 .configure-extends-template:
   extends:
@@ -339,6 +557,29 @@ configure-clang-8-release:
 
 # Jobs running during build stage
 
+.binary-build-template:
+  # Dockerfiles are from dockerhub, user eriklindahl
+  # image in admin/dockerimages/ci-docs-py27
+  stage: build
+  image: biophysics/gcc-gromacs
+  variables:
+
+  script:
+    - cd $BUILD_DIR
+    - cmake --build . -- -j8 2>&1 | tee buildLogFile.log
+    - cmake --build . --target tests -- -j8 2>&1 | tee testBuildLogFile.log
+    - awk '/warning/,/warning.*generated|^$/' buildLogFile.log testBuildLogFile.log
+      | grep -v "CMake" | tee buildErrors.log || true
+    - grep "cannot be built" buildLogFile.log testBuildLogFile.log | tee -a buildErrors.log || true
+    - cmake --build . --target install 2>&1 | tee installBuildLogFile.log
+    - if [ -s buildErrors.log ] ; then echo "Found compiler warning during build"; cat buildErrors.log; exit 1; fi
+    - cd ..
+  artifacts:
+    when: always
+    paths:
+      - $BUILD_DIR
+      - $INSTALL_DIR/
+
 .build-extends-template:
   extends:
     - .binary-build-template