From cb7ac67b4685b030e90baef2974002c0e3152934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lorenz=20H=C3=BCdepohl?= <lorenz.huedepohl@rzg.mpg.de>
Date: Wed, 29 Jun 2016 10:44:47 +0200
Subject: [PATCH] Fix error in gitlab CI file

Piping the output of the module command prevents the commands effect to
propagate to the currently running shell as it is then run in a subshell
---
 .gitlab-ci.yml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b5614ecf..a7a54aa6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,10 +1,12 @@
 before_script:
   - export LANG=C
-  - module load impi/5.1.3 intel/16.0 gcc/4.9 mkl/11.3 autotools pkg-config 2>&1 | grep "ERROR" && exit 1 || true
+  - errorlog=$(mktemp)
+  - module load impi/5.1.3 intel/16.0 gcc/4.9 mkl/11.3 autotools pkg-config 2>$errorlog
+  - if grep "ERROR" $errorlog ; then rm $errorlog; exit 1; else rm $errorlog; fi
   - module list
   - export LD_LIBRARY_PATH=$MKL_HOME/lib/intel64:$LD_LIBRARY_PATH
   - export PATH=/home/elpa/python-3.6/bin:$PATH
-  - env
+  - env | sort
 
 # define two stages, that way coverage only runs after all other
 # tests have been done.
-- 
GitLab