From 2e9ed9027aa4ba94a20a4d4c0159148ecc17a42e Mon Sep 17 00:00:00 2001
From: Samuel Gaist <samuel.gaist@idiap.ch>
Date: Thu, 8 Mar 2018 14:11:15 +0100
Subject: [PATCH] [gitlab-ci] Do the cleanup in before_script

This separates more cleanly the goal of each part. At the same
time the prefix path file can be kept in the sources rather than
being in /tmp that could be altered during a run.
---
 .gitlab-ci.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dd50908b3..50bfcf966 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -3,7 +3,7 @@ stages:
 
 variables:
   PREFIX: /opt/beat.env.web/usr
-  TEST_PREFIX_PATH_FILE: '/tmp/test_prefix_$CI_JOB_ID.txt'
+  TEST_PREFIX_PATH_FILE: 'test_prefix_$CI_JOB_ID.txt'
 
 build:
   stage: build
@@ -12,10 +12,10 @@ build:
   before_script:
   - ${PREFIX}/bin/python --version
   - docker info
+  - git clean -ffdx
   - export BEAT_TEST_PREFIX=`mktemp -d --tmpdir=/var/tmp beat_test_prefix.XXXXXXXXX`
   - echo $BEAT_TEST_PREFIX > $TEST_PREFIX_PATH_FILE
   script:
-  - git clean -ffdx
   - ${PREFIX}/bin/python bootstrap-buildout.py
   - ./bin/buildout
   - export COVERAGE_FILE=.coverage.django
-- 
GitLab