buildbot-try.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #! /bin/bash
  2. #
  3. # Submits a "buildbot try" message to the Dolphin buildbot with all the
  4. # required options.
  5. opt_file=$HOME/.buildbot/options
  6. if ! [ -f "$opt_file" ]; then
  7. echo >&2 "error: no .buildbot/options configuration file found"
  8. echo >&2 "Read the docs: http://code.google.com/p/dolphin-emu/wiki/BuildbotTry"
  9. exit 1
  10. fi
  11. if ! which buildbot >/dev/null 2>&1; then
  12. echo >&2 "error: buildbot is not installed"
  13. echo >&2 "Install it from your package manager, or use 'pip install buildbot'"
  14. exit 1
  15. fi
  16. if ! git branch | grep -q '^* '; then
  17. echo "Unable to determine the current Git branch. Input the Git branch name:"
  18. read branchname
  19. else
  20. branchname=$(git branch | grep '^* ' | cut -d ' ' -f 2-)
  21. fi
  22. shortrev=$(git describe --always --long --dirty=+ | sed 's/-g[0-9a-f]*\(+*\)$/\1/')
  23. author=$(grep try_username "$opt_file" | cut -d "'" -f 2)
  24. echo "Branch name: $branchname"
  25. echo "Change author: $author"
  26. echo "Short rev: $shortrev"
  27. buildbot try --properties=branchname=$branchname,author=$author,shortrev=$shortrev $*