trying to avoid conflicts when updating master and development, only one pipeline at the same time

This commit is contained in:
Martin Diehl 2017-04-12 23:30:33 +02:00
parent f166ba4c9a
commit 4bcefa992b
1 changed files with 23 additions and 10 deletions

View File

@ -16,6 +16,7 @@ stages:
- example - example
- updateMaster - updateMaster
- createDocumentation - createDocumentation
- clean
################################################################################################### ###################################################################################################
before_script: before_script:
@ -78,11 +79,14 @@ variables:
checkout: checkout:
stage: prepareAll stage: prepareAll
before_script: before_script:
- echo 'Do nothing' - $HOME/wait.sh
- echo $CI_PIPELINE_ID > $HOME/GitLabCI.lock
script: script:
- mkdir -p $DAMASKROOT - mkdir -p $DAMASKROOT
- git clone -b GitLabRunner git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT - git clone git@magit1.mpie.de:damask/DAMASK.git $DAMASKROOT
- git clone git@magit1.mpie.de:damask/PRIVATE.git $DAMASKROOT/PRIVATE - 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' - eval 'source $DAMASKROOT/DAMASK_env.sh'
- make -C $DAMASKROOT install - make -C $DAMASKROOT install
@ -304,15 +308,16 @@ mergeIntoMaster:
only: only:
- development - development
script: script:
- eval 'cd $DAMASKROOT' - cd $DAMASKROOT
- export DEVREV=$(git describe) - export TESTEDREV=$(git describe) # might be detached from development branch
- git commit VERSION -m "[skip ci] updated version information after successful test of $DEVREV" - 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 checkout master
- git merge development - git merge $UPDATEDREV
- git status - git push origin master # master is now tested version and has updated VERSION file
- git push origin master
- git checkout development - 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: AbaqusExp:
@ -338,3 +343,11 @@ Spectral:
script: script:
- module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen - module load $IntelCompiler $MPICH_Intel $PETSc_MPICH_Intel $Doxygen
- $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral - $DAMASKROOT/PRIVATE/documenting/runDoxygen.sh $DAMASKROOT spectral
###################################################################################################
removeLock:
stage: clean
before_script:
- echo 'Do nothing'
when: always
script: rm $HOME/GitLabCI.lock