Browse Source

add REPO_NAME

 * Increase compatability with github
Oz N Tiram 9 years ago
parent
commit
d0bfdf14c2
2 changed files with 5 additions and 1 deletions
  1. 3 0
      hooks/post-update.conf
  2. 2 1
      hooks/post-update.sh

+ 3 - 0
hooks/post-update.conf

@@ -6,5 +6,8 @@ SUBMIT_HOST=127.0.0.1
 SUBMIT_PORT=8080
 
 GITURL="git@yourhost.domain:oz123/frank.git"
+# You can replace REPONAME with `basename GITURL`
+REPO_NAME="SHORT_NAME_OF_YOUR_REPO. THIS COULD BE THE DIRECTORY NAME FOR EXAMPLE"
+
 # GITHUB USES X-Hub-Secret, feel free to create your own key name
 SECRET_KEY_NAME=X-Secret

+ 2 - 1
hooks/post-update.sh

@@ -23,9 +23,10 @@ TO_SUBMIT="["
 for HEAD in $@; do  
 	# We love bash too, but there a really fancy basename 
 	BRANCH=`basename $HEAD`
-	REST_OF_JSON=$(git --no-pager log -n 1 --format='{"branch": "XXXBRANCHXXX", "giturl": "XXXGITURLXXX", "hashes":{"commit":"%H", "tree":"%T", "parents":"%P"},"author":{"date":"%ai","name":"%an","email":"%ae"},"committer":{"date":"%ci","name":"%cn","email":"%ce"}}')
+	REST_OF_JSON=$(git --no-pager log -n 1 --format='{"branch": "XXXBRANCHXXX", "giturl": "XXXGITURLXXX", "hashes":{"commit":"%H", "tree":"%T", "parents":"%P"},"author":{"date":"%ai","name":"%an","email":"%ae"},"committer":{"date":"%ci","name":"%cn","email":"%ce"},"repository":{"name":"XXXREPO_NAMEXXX"}}')
         REST_OF_JSON=${REST_OF_JSON/XXXBRANCHXXX/${BRANCH}}
         REST_OF_JSON=${REST_OF_JSON/XXXGITURLXXX/${GITURL}}
+        REST_OF_JSON=${REST_OF_JSON/XXXREPO_NAMEXXX/${REPO_NAME}}
 	JSON_TO_SUBMIT=$REST_OF_JSON
 	TO_SUBMIT=$TO_SUBMIT$JSON_TO_SUBMIT","
 	JSON_TO_SUBMIT=""