-
-
Notifications
You must be signed in to change notification settings - Fork 835
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from adnanh/development
webhook 2.5.0
- Loading branch information
Showing
6 changed files
with
56 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
OS = darwin freebsd linux openbsd windows | ||
ARCHS = 386 arm amd64 arm64 | ||
|
||
all: build release | ||
|
||
build: deps | ||
go build | ||
|
||
release: clean deps | ||
@for arch in $(ARCHS);\ | ||
do \ | ||
for os in $(OS);\ | ||
do \ | ||
echo "Building $$os-$$arch"; \ | ||
mkdir -p build/webhook-$$os-$$arch/; \ | ||
GOOS=$$os GOARCH=$$arch go build -o build/webhook-$$os-$$arch/webhook; \ | ||
tar cz -C build -f build/webhook-$$os-$$arch.tar.gz webhook-$$os-$$arch; \ | ||
done \ | ||
done | ||
|
||
test: deps | ||
go test ./... | ||
|
||
deps: | ||
go get -d -v -t ./... | ||
|
||
clean: | ||
rm -rf build | ||
rm -f webhook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,7 +372,9 @@ var hookHandlerTests = []struct { | |
}`, | ||
false, | ||
http.StatusOK, | ||
`{"output":"arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected]\nenv: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00\n"}`, | ||
`arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected] | ||
env: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00 | ||
`, | ||
}, | ||
{ | ||
"bitbucket", // bitbucket sends their payload using uriencoded params. | ||
|
@@ -381,7 +383,7 @@ var hookHandlerTests = []struct { | |
`payload={"canon_url": "https://bitbucket.org","commits": [{"author": "marcus","branch": "master","files": [{"file": "somefile.py","type": "modified"}],"message": "Added some more things to somefile.py\n","node": "620ade18607a","parents": ["702c70160afc"],"raw_author": "Marcus Bertrand <[email protected]>","raw_node": "620ade18607ac42d872b568bb92acaa9a28620e9","revision": null,"size": -1,"timestamp": "2012-05-30 05:58:56","utctimestamp": "2014-11-07 15:19:02+00:00"}],"repository": {"absolute_url": "/webhook/testing/","fork": false,"is_private": true,"name": "Project X","owner": "marcus","scm": "git","slug": "project-x","website": "https://atlassian.com/"},"user": "marcus"}`, | ||
true, | ||
http.StatusOK, | ||
`{"message":"success"}`, | ||
`success`, | ||
}, | ||
{ | ||
"gitlab", | ||
|
@@ -431,7 +433,8 @@ var hookHandlerTests = []struct { | |
}`, | ||
false, | ||
http.StatusOK, | ||
`{"message":"success","output":"arg: b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327 John Smith [email protected]\n"}`, | ||
`arg: b6568db1bc1dcd7f8b4d5a946b0b91f9dacd7327 John Smith [email protected] | ||
`, | ||
}, | ||
|
||
{ | ||
|
@@ -469,7 +472,9 @@ var hookHandlerTests = []struct { | |
}`, | ||
false, | ||
http.StatusOK, | ||
`{"output":"arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected]\nenv: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00\n"}`, | ||
`arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected] | ||
env: HOOK_head_commit.timestamp=2013-03-12T08:14:29-07:00 | ||
`, | ||
}, | ||
|
||
{ | ||
|
@@ -506,7 +511,8 @@ var hookHandlerTests = []struct { | |
}`, | ||
false, | ||
http.StatusOK, | ||
`{"output":"arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected]\n"}`, | ||
`arg: 1481a2de7b2a7d02428ad93446ab166be7793fbb [email protected] | ||
`, | ||
}, | ||
|
||
{"empty payload", "github", nil, `{}`, false, http.StatusOK, `Hook rules were not satisfied.`}, | ||
|