Skip to content

Commit

Permalink
Retrying force-with-lease merge strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanhay committed Aug 23, 2017
1 parent 8fa1e15 commit 35e41d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
6 changes: 2 additions & 4 deletions script/travis-documentation
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ HTML
git add $BRANCH/index.html
git commit -m "$BRANCH index build $BUILD_NUMBER"

until git push --quiet "https://${TOKEN}@${ref}" || (( retries++ >= 5 )); do
until git push --force-with-lease --quiet "https://${TOKEN}@${ref}" || (( retries++ >= 5 )); do
echo "Retrying git push ..."
git pull --force-with-lease origin gh-pages
git add $BRANCH/index.html
git commit -m "$BRANCH index build $BUILD_NUMBER"
git pull --force origin gh-pages
done
15 changes: 7 additions & 8 deletions script/travis-lifecycle-script
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ echo "Copying built documentation to $output/$BRANCH"
cp -R $root/$LIBRARY-* $BRANCH/

echo "Committing + pushing to $ref"
git add $BRANCH
git commit -m "$BRANCH/$LIBRARY build $BUILD_NUMBER"

until git push --quiet "https://${TOKEN}@${ref}" || (( retries++ >= 5 )); do
echo "Retrying git push ..."
git pull --force-with-lease origin gh-pages
git add $BRANCH
if git add $BRANCH/$LIBRARY-*; then
git commit -m "$BRANCH/$LIBRARY build $BUILD_NUMBER"
done

until git push --force-with-lease --quiet "https://${TOKEN}@${ref}" || (( retries++ >= 5 )); do
echo "Retrying git push ..."
git pull origin gh-pages
done
fi

0 comments on commit 35e41d3

Please sign in to comment.