X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=server%2Fpost-receive-hudson;h=f199d17dc76403acc2687396f8644c4b44e4a22a;hb=f14b5840d02ec82d7576a6c71137dfe537b85c6c;hp=23ccfbad9aa00a3f3cb14371660e275577c8f954;hpb=8b13ba49a056a922b349a3530b4d0499257552dd;p=git-central.git diff --git a/server/post-receive-hudson b/server/post-receive-hudson index 23ccfba..f199d17 100644 --- a/server/post-receive-hudson +++ b/server/post-receive-hudson @@ -2,8 +2,6 @@ . $(dirname $0)/functions -email="$USER@payflex.com" - while read oldrev newrev refname ; do case "$refname" in refs/tags/*) @@ -18,6 +16,11 @@ while read oldrev newrev refname ; do ;; esac + ignored=" $(git config hooks.post-receive-hudson.ignored) " + if [[ $ignored =~ " $short_refname " ]] ; then + exit 0 + fi + branch_config=$(wget -O - http://cbas1:8080/hudson/job/${short_refname}/config.xml 2>/dev/null) if [ $? -ne 0 ] ; then # Create the job @@ -29,12 +32,10 @@ while read oldrev newrev refname ; do branch_config="${stable_config/stable$short_refname<}" - if [ "${branch_config/$email/}" == "$branch_config" ] ; then - branch_config="${branch_config//$email }" + if [ "${branch_config/$USER_EMAIL/}" == "$branch_config" ] ; then + branch_config="${branch_config//$USER_EMAIL }" fi - echo "$branch_config" > branch_config.txt - # wget "http://cbas1:8080/hudson/createItem?name=${short_refname}&mode=copyJob&from=stable" > wget.txt wget --header "Content-Type: text/xml" --post-data="$branch_config" -O - "http://cbas1:8080/hudson/createItem?name=${short_refname}" >/dev/null 2>/dev/null if [ $? -ne 0 ] ; then @@ -43,12 +44,12 @@ while read oldrev newrev refname ; do fi else # Add email to recipients list - if [ "${branch_config/$email/}" == "$branch_config" ] ; then - branch_config="${branch_config//$email }" + if [ "${branch_config/$USER_EMAIL/}" == "$branch_config" ] ; then + branch_config="${branch_config//$USER_EMAIL }" wget --header "Content-Type: text/xml" --post-data="$branch_config" -O - "http://cbas1:8080/hudson/job/${short_refname}/config.xml" >/dev/null 2>/dev/null if [ $? -ne 0 ] ; then - display_error_message "Could not add $email to Hudson job ${short_refname}" + display_error_message "Could not add $USER_EMAIL to Hudson job ${short_refname}" exit 0 fi fi