From a07ebec30c13d358d1f9da87a547c3719aa4380b Mon Sep 17 00:00:00 2001 From: Michael Gray Date: Tue, 3 Jun 2014 10:09:49 -0700 Subject: [PATCH] Created Autobuilding from Atlassian Stash (rdoc) --- Autobuilding-from-Atlassian-Stash.rdoc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Autobuilding-from-Atlassian-Stash.rdoc diff --git a/Autobuilding-from-Atlassian-Stash.rdoc b/Autobuilding-from-Atlassian-Stash.rdoc new file mode 100644 index 0000000..0f27495 --- /dev/null +++ b/Autobuilding-from-Atlassian-Stash.rdoc @@ -0,0 +1,11 @@ +It is possible to use Stashes External Post Receive Hooks. +Create a post_receive.sh script with execution rights. +Have the EPRH execute the shell script with a positional parameter of your PHPCI build id. + + PROJECT_ID=$1 + PHPCI_URL="http://ci.site.com" + while read from_ref to_ref ref_name; do + BRANCH=$(git rev-parse --symbolic --abbrev-ref $ref_name) + echo "Sending webhook" + curl "$PHPCI_URL/webhook/git/$PROJECT_ID?branch=$BRANCH&commit=$to_ref" + done \ No newline at end of file