blob: 4c8b7f6dcb5b5d469675b37c52bf213f8d12deff [file] [log] [blame]
Dan McGregorfeaee262016-11-29 07:41:27 -06001#!/usr/bin/env bash
Han-Wen Nienhuysdc255122016-10-24 13:03:32 +02002
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 Ostrovsky40eb6e72016-10-29 11:57:46 +020013function rev() {
14 cd $1; git describe --always --match "v[0-9].*" --dirty
15}
Han-Wen Nienhuysdc255122016-10-24 13:03:32 +020016
David Ostrovsky40eb6e72016-10-29 11:57:46 +020017echo STABLE_BUILD_GERRIT_LABEL $(rev .)
18for p in plugins/* ; do
19 test -d "$p" || continue
Han-Wen Nienhuys97c8fb02017-01-12 16:44:03 +010020 echo STABLE_BUILD_$(echo $(basename $p)_LABEL|tr '[a-z]' '[A-Z]' ) $(rev $p)
David Ostrovsky40eb6e72016-10-29 11:57:46 +020021done
Han-Wen Nienhuyse6c7e622016-10-27 15:43:10 +020022echo "STABLE_WORKSPACE_ROOT ${PWD}"