8
0

update-stable-branches.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. # For licensing, see LICENSE.md.
  4. set -e
  5. read -p "Are you sure? " -n 1 -r
  6. echo ""
  7. if [[ $REPLY =~ ^[Yy]$ ]]
  8. then
  9. # Update the `stable` branch in the ckeditor5 repository.
  10. git checkout stable && git merge master && git checkout master
  11. # Add `stable` branches in all repos which don't have them yet.
  12. mgit exec 'git checkout -b stable 2> /dev/null && git push origin stable && git checkout master'
  13. # Update all `stable` branches in all packages.
  14. mgit exec 'git checkout stable && git pull origin stable && git merge master && git checkout master'
  15. # Make sure that `mgit.json` for `stable` and `master` branches is correct.
  16. # `stable` branch.
  17. git checkout stable && \
  18. node ./scripts/release/update-mgit-branches stable && \
  19. git commit -a -m "Internal: Use stable branches. [skip ci]"
  20. # `master` branch.
  21. git checkout master && \
  22. git merge stable && \
  23. node ./scripts/release/update-mgit-branches master && \
  24. git commit -a -m "Internal: Use master branches. [skip ci]"
  25. # Push the `stable` branches.
  26. git push origin stable master && \
  27. mgit exec 'git push origin stable'
  28. echo "Success! 🎂"
  29. fi