From 4bcefa992bf8dbf0077b24b6293b9c7b310e208b Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 12 Apr 2017 23:30:33 +0200 Subject: [PATCH] trying to avoid conflicts when updating master and development, only one pipeline at the same time --- .gitlab-ci.yml | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bcd694974..7ee1d6884 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -16,6 +16,7 @@ stages: - example - updateMaster - createDocumentation + - clean ################################################################################################### before_script: @@ -78,11 +79,14 @@ variables: checkout: stage: prepareAll before_script: - - echo 'Do nothing' + - $HOME/wait.sh + - echo $CI_PIPELINE_ID > $HOME/GitLabCI.lock script: - mkdir -p $DAMASKROOT - - git clone -b GitLabRunner git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT - - git clone git@magit1.mpie.de:damask/PRIVATE.git $DAMASKROOT/PRIVATE + - git clone git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT + - cd $DAMASKROOT + - git checkout $CI_COMMIT_SHA git@magit1.mpie.de:damask/DAMASK.git + - git clone git@magit1.mpie.de:damask/PRIVATE.git - eval 'source $DAMASKROOT/DAMASK_env.sh' - make -C $DAMASKROOT install @@ -304,15 +308,16 @@ mergeIntoMaster: only: - development script: - - eval 'cd $DAMASKROOT' - - export DEVREV=$(git describe) - - git commit VERSION -m "[skip ci] updated version information after successful test of $DEVREV" + - cd $DAMASKROOT + - export TESTEDREV=$(git describe) # might be detached from development branch + - git commit VERSION -m "[skip ci] updated version information after successful test of $TESTEDREV" + - export UPDATEDREV=$(git describe) # tested state + 1 commit - git checkout master - - git merge development - - git status - - git push origin master + - git merge $UPDATEDREV + - git push origin master # master is now tested version and has updated VERSION file - git checkout development - - git push origin development + - git merge master -s ours # only possible conflict is in VERSION file + - git push origin development # development is unchanged (as master is based on it) but has updated VERSION file ################################################################################################### AbaqusExp: @@ -338,3 +343,11 @@ Spectral: script: - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral + +################################################################################################### +removeLock: + stage: clean + before_script: + - echo 'Do nothing' + when: always + script: rm $HOME/GitLabCI.lock