]> git.droids-corp.org - git-central.git/commitdiff
Rely on USER_EMAIL instead of hardcoding payflex.com.
authorStephen Haberman <stephen@exigencecorp.com>
Tue, 21 Oct 2008 21:17:53 +0000 (16:17 -0500)
committerStephen Haberman <stephen@exigencecorp.com>
Tue, 21 Oct 2008 21:17:53 +0000 (16:17 -0500)
server/post-receive-email
server/post-receive-hudson

index 7bc974e7e6305f3da15ca0bedeb00ce4fd2630c4..3cf8d17e3f00f4947b4bca61f1536cb922b3aa1a 100755 (executable)
@@ -139,7 +139,7 @@ generate_email_header()
        # --- Email (all stdout will be the email)
        # Generate header
        cat <<-EOF
-       From: ${USER}@payflex.com
+       From: $USER_EMAIL
        To: $recipients
        Subject: ${emailprefix} $short_refname $refname_type ${change_type}d. $describe
        X-Git-Refname: $refname
index 23ccfbad9aa00a3f3cb14371660e275577c8f954..161568ba551e097fd618369d79a706d26d43b16b 100644 (file)
@@ -2,8 +2,6 @@
 
 . $(dirname $0)/functions
 
-email="$USER@payflex.com"
-
 while read oldrev newrev refname ; do
        case "$refname" in
                refs/tags/*)
@@ -29,8 +27,8 @@ while read oldrev newrev refname ; do
 
                branch_config="${stable_config/<branch>stable</<branch>$short_refname<}"
 
-               if [ "${branch_config/$email/}" == "$branch_config" ] ; then
-                       branch_config="${branch_config/<recipients>/<recipients>$email }"
+               if [ "${branch_config/$USER_EMAIL/}" == "$branch_config" ] ; then
+                       branch_config="${branch_config/<recipients>/<recipients>$USER_EMAIL }"
                fi
 
                echo "$branch_config" > branch_config.txt
@@ -43,12 +41,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/<recipients>/<recipients>$email }"
+               if [ "${branch_config/$USER_EMAIL/}" == "$branch_config" ] ; then
+                       branch_config="${branch_config/<recipients>/<recipients>$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