more robust update of VERSION file

update version only if no push to development has occured in the
meantime.

Less error prone.  Very small change for race condition remains
This commit is contained in:
Martin Diehl 2022-01-14 15:51:02 +01:00
parent 6da3f0fa51
commit 6324ffcb9e
1 changed files with 8 additions and 17 deletions

View File

@ -172,6 +172,10 @@ Marc:
################################################################################################### ###################################################################################################
grid_runtime: grid_runtime:
stage: performance stage: performance
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} --blocking
- source env/DAMASK.sh
- echo Job start:" $(date)"
script: script:
- module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL} - module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL}
- cd $(mktemp -d) - cd $(mktemp -d)
@ -186,10 +190,6 @@ grid_runtime:
--output_dir ./ --output_dir ./
--tag ${CI_COMMIT_SHA} --tag ${CI_COMMIT_SHA}
- if [ ${CI_COMMIT_BRANCH} == development ]; then git commit -am ${CI_PIPELINE_ID}_${CI_COMMIT_SHA}; git push; fi - if [ ${CI_COMMIT_BRANCH} == development ]; then git commit -am ${CI_PIPELINE_ID}_${CI_COMMIT_SHA}; git push; fi
before_script:
- ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} --blocking
- source env/DAMASK.sh
- echo Job start:" $(date)"
################################################################################################### ###################################################################################################
@ -209,19 +209,10 @@ update_revision:
script: script:
- cd $(mktemp -d) - cd $(mktemp -d)
- git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - git clone -q git@git.damask.mpie.de:damask/DAMASK.git .
- git checkout ${CI_COMMIT_SHA} - git pull
- export VERSION=$(git describe) - export VERSION=$(git describe ${CI_COMMIT_SHA})
- echo ${VERSION} > python/damask/VERSION - echo ${VERSION} > python/damask/VERSION
- git add python/damask/VERSION - git commit python/damask/VERSION -m "[skip ci] updated version information after successful test of $VERSION"
- git commit -m "[skip ci] updated version information after successful test of $VERSION" - if [ ${CI_COMMIT_SHA} == $(git rev-parse HEAD^) ]; then git push origin HEAD:master HEAD:development; fi
- export UPDATEDREV=$(git describe) # tested state + 1 commit
- git checkout master
- git pull
- git merge $UPDATEDREV -s recursive -X ours # conflicts occur only for inconsistent state
- git push
- git checkout development
- git pull
- git merge master -s recursive -X ours -m "[skip ci] Merge branch 'master' into development" # 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
only: only:
- development - development