From 90692eb76fc5d814b684a4a331b464febb07d8c2 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 25 Sep 2014 14:11:37 +0200 Subject: [PATCH] Adapt the script for integration-4.5 --- .../bin/create_release | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release index a5c68b1473e..71ac78ddeec 100755 --- a/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release +++ b/Maintenance/infrastructure/cgal.geometryfactory.com/bin/create_release @@ -6,22 +6,36 @@ export LC_ALL # Returns an error once a command returns an error set -e +DRY_RUN= +QUIET=--quiet + +if [ "x$1" = "x--dry-run" -o "x$1" = "x-n" ]; then + DRY_RUN=--dry-run + shift +fi + +if [ -n "DRY_RUN" ]; then + QUIET= +fi + if [ -d "$1/.git" ]; then pushd "$1" > /dev/null branch=`git rev-parse --abbrev-ref HEAD` # echo "Git repository, in branch '$branch'" - git fetch --quiet - git reset --quiet --hard origin/$branch - git clean --quiet -f + git fetch $DRY_RUN $QUIET + [ -z "$DRY_RUN" ] && git reset $QUIET --hard origin/$branch + git clean $DRY_RUN $QUIET -f ln -s -n -f "$1" $HOME/latest-internal-release-branch # Hard-reset integration "every day", if today's "$branch" is integration # and create testsuite-Monday, testsuite-Tuesday, and so on... if [ x"$branch" = "xintegration" ]; then - git push --quiet -f origin origin/$branch:refs/heads/`date '+testsuite-%A'` origin/master:integration + git push $DRY_RUN $QUIET -f origin origin/$branch:refs/heads/`date '+testsuite-%A'` origin/master:integration + elif [ x"$branch" = "xintegration-4.5" ]; then + git push $DRY_RUN $QUIET -f origin origin/$branch:refs/heads/`date '+testsuite-%A'` origin/releases/CGAL-4.5-branch:integration-4.5 else - git push --quiet -f origin origin/$branch:refs/heads/`date '+testsuite-%A'` + git push $DRY_RUN $QUIET -f origin origin/$branch:refs/heads/`date '+testsuite-%A'` fi popd > /dev/null @@ -62,5 +76,5 @@ ln -s "$1" "$HOME/CGAL/last-release-branch" # "$HOME/bin/update_manual_tools" # Launch create_new_release, from the branch itself -exec "$HOME/CGAL/last-release-branch/Scripts/developer_scripts/create_new_release" --no-scm-update "$@" +[ -z "$DRY_RUN" ] && exec "$HOME/CGAL/last-release-branch/Scripts/developer_scripts/create_new_release" --no-scm-update "$@" # --no-scm-update because branches have already been updated