From 6324ffcb9e9d2abe11764f4c98f4b7ba5302ccd5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Fri, 14 Jan 2022 15:51:02 +0100 Subject: [PATCH] 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 --- .gitlab-ci.yml | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1bf5cf8b1..c27c90bce 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -172,6 +172,10 @@ Marc: ################################################################################################### grid_runtime: stage: performance + before_script: + - ${LOCAL_HOME}/bin/queue ${CI_JOB_ID} --blocking + - source env/DAMASK.sh + - echo Job start:" $(date)" script: - module load ${COMPILER_INTEL} ${MPI_INTEL} ${PETSC_INTEL} - cd $(mktemp -d) @@ -186,10 +190,6 @@ grid_runtime: --output_dir ./ --tag ${CI_COMMIT_SHA} - 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: - cd $(mktemp -d) - git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - - git checkout ${CI_COMMIT_SHA} - - export VERSION=$(git describe) + - git pull + - export VERSION=$(git describe ${CI_COMMIT_SHA}) - echo ${VERSION} > python/damask/VERSION - - git add python/damask/VERSION - - git commit -m "[skip ci] updated version information after successful test of $VERSION" - - 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 + - git commit python/damask/VERSION -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 only: - development