blob: 2b1a4ba2f5d110839eb2baae882f821916f922cd [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 Nienhuys79118132017-10-01 09:50:46 +010020 echo STABLE_BUILD_$(echo $(basename $p)_LABEL|tr '[a-z]' '[A-Z]' ) $(rev $p || echo unknown)
David Ostrovsky40eb6e72016-10-29 11:57:46 +020021done