Dan McGregor | feaee26 | 2016-11-29 07:41:27 -0600 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Han-Wen Nienhuys | dc25512 | 2016-10-24 13:03:32 +0200 | [diff] [blame] | 2 | |
| 3 | # This script will be run by bazel when the build process starts to |
| 4 | # generate key-value information that represents the status of the |
| 5 | # workspace. The output should be like |
| 6 | # |
| 7 | # KEY1 VALUE1 |
| 8 | # KEY2 VALUE2 |
| 9 | # |
| 10 | # If the script exits with non-zero code, it's considered as a failure |
| 11 | # and the output will be discarded. |
| 12 | |
David Ostrovsky | 40eb6e7 | 2016-10-29 11:57:46 +0200 | [diff] [blame] | 13 | function rev() { |
| 14 | cd $1; git describe --always --match "v[0-9].*" --dirty |
| 15 | } |
Han-Wen Nienhuys | dc25512 | 2016-10-24 13:03:32 +0200 | [diff] [blame] | 16 | |
David Ostrovsky | 40eb6e7 | 2016-10-29 11:57:46 +0200 | [diff] [blame] | 17 | echo STABLE_BUILD_GERRIT_LABEL $(rev .) |
| 18 | for p in plugins/* ; do |
| 19 | test -d "$p" || continue |
Han-Wen Nienhuys | 97c8fb0 | 2017-01-12 16:44:03 +0100 | [diff] [blame] | 20 | echo STABLE_BUILD_$(echo $(basename $p)_LABEL|tr '[a-z]' '[A-Z]' ) $(rev $p) |
David Ostrovsky | 40eb6e7 | 2016-10-29 11:57:46 +0200 | [diff] [blame] | 21 | done |
Han-Wen Nienhuys | e6c7e62 | 2016-10-27 15:43:10 +0200 | [diff] [blame] | 22 | echo "STABLE_WORKSPACE_ROOT ${PWD}" |