Open mattwwarren opened 7 years ago
Glad you like the webhook, however it sounds to me that you would be much better off by using the proper Jenkins plugin for the described task, expose the Jenkins directly and avoid webhook altogether.
There is a way to pass the payload, query and headers, it's documented in the wiki under the Special cases.
As for the webhook based solution, solving #152 would be the proper way to handle this case, but I just don't have the time to do that :-(
Sorry, I should have been more clear in point 2. entire-payload
works for my case but the issue remains in how to pass that in a command. I think I can use curl https://jenkins/jenkins/
but then I have to add part of the URI as constructed by Bitbucket (e.g. job/my-tests/build
)
What are your thoughts on allowing regex matching in id
s? I understand that all things take time but I am willing to learn/help to get up to speed on go, which is increasing in use at $WORK
Are you using the curl directly as a command for webhook? If so, you should try using a shell script to do the preprocessing, construction and invocation of the proper curl $ENDPOINT command based on the payload. If you could provide sample payload and resulting endpoints that should be invoked, maybe I can help you with the writing of the "wrapper" script.
In that case you would have only one hook.
I was thinking curl was the easiest way to do the passthrough. But that still doesn't solve the problem of bitbucket requesting https://webhook/jenkins/job/my-tests/build
I cannot seem to create a rule with:
"id": "jenkins/job/my-tests/build",
And a rule like:
"id": "jenkins",
would not match the request. Is this right?
Correct. Is there no way to tell bitbucket to hit another url?
I am attempting to use webhook as a public interface to our services hosted on a private network. Currently, I am running into an issue where I cannot create jenkins webhooks from Bitbucket for a few reasons.
The URL used by the bitbucket webhook varies based on which jenkins job we wish to trigger This causes a few issues on the webhook side:
id
id
sThere is no easy (or documented way) to pass the exact input from a request to webhook on to a backend service
If I workaround 2 by using a straight up proxy, there are other documented issues with placing a proxy in front of webhook
Sadly, my go skills are as near to nothing as makes no odds but I am willing to attempt tackling some of these points with some guidance.