From 26bc40a89a077339ee3f76ea1f88a49e194525bf Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Mon, 9 Dec 2013 10:36:39 -0800 Subject: [PATCH] Fixing git branch detection in Jenkins Branch detection did not work in Jenkins. I realized that it set GIT_BRANCH env variable to point to the current branch, so let's try using this for branch detection. --- build_tools/regression_build_test.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build_tools/regression_build_test.sh b/build_tools/regression_build_test.sh index eb89f6a9ea..b0140ef48f 100755 --- a/build_tools/regression_build_test.sh +++ b/build_tools/regression_build_test.sh @@ -26,11 +26,11 @@ function cleanup { } trap cleanup EXIT -git_branch=$(git rev-parse --abbrev-ref HEAD) -if [ $git_branch == "master" ]; then - git_branch="" +git_br=$(basename $GIT_BRANCH) +if [ $git_br == "master" ]; then + git_br="" else - git_branch="."$git_branch + git_br="."$git_br fi make clean @@ -156,7 +156,7 @@ function send_to_ods { echo >&2 "ERROR: Key $key doesn't have a value." return fi - curl -s "https://www.intern.facebook.com/intern/agent/ods_set.php?entity=rocksdb_build$git_branch&key=$key&value=$value" \ + curl -s "https://www.intern.facebook.com/intern/agent/ods_set.php?entity=rocksdb_build$git_br&key=$key&value=$value" \ --connect-timeout 60 }