-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Documented new GitLab and Bitbucket webhooks #4043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documented new GitLab and Bitbucket webhooks #4043
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On correction and then a couple of minor suggestions.
(see xref:describe-buildconfig[Displaying Webhook URLs]), and is structured as follows: | ||
|
||
---- | ||
http://<openshift_api_host:port>/oapi/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/bitbucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
says bitbucket
at the end ... should say gitlab
secret: "secret101" | ||
---- | ||
|
||
The payload URL is returned as the GitLab Webhook URL by the `describe` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps clarify that describe
is a command off of our CLI ... i.e. the oc
executable.
secret: "secret101" | ||
---- | ||
|
||
The payload URL is returned as the Bitbucket Webhook URL by the `describe` command |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same suggestion to clarify that describe
is an option on the CLI, oc
executable, etc.
[[generic-webhooks]] | ||
=== Generic Webhooks | ||
|
||
Generic webhooks are invoked from any system capable of making a web request. | ||
As with a GitHub webhook, you must specify a secret, which will be part of | ||
As with other webhooks, you must specify a secret, which will be part of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/As with other webhooks/As with the other webhooks/
@gabemontero I've implemented your suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IGTM
@bparees fyi / ptal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit and lgtm
@@ -27,7 +27,10 @@ triggers are available: | |||
|
|||
Webhook triggers allow you to trigger a new build by sending a request to the | |||
{product-title} API endpoint. You can define these triggers using | |||
https://developer.github.com/webhooks/[GitHub webhooks] or Generic webhooks. | |||
https://developer.github.com/webhooks/[GitHub webhooks], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/GitHub webhooks/GitHub/
. Follow the https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#webhooks[GitLab setup instructions] | ||
to paste the webhook URL into your GitLab repository settings. | ||
|
||
Given a file containing a valid JSON payload, you can manually trigger the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command below is expecting a file with particular name. I suggest to specify file name here explicitly.
webhook via `curl`: | ||
|
||
---- | ||
$ curl -H "X-GitLab-Event: Push Hook" -H "Content-Type: application/json" -k -X POST --data-binary @gitlub_payload_file.json https://<openshift_api_host:port>/oapi/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/gitlab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/gitlub_payload_file/gitlab_payload_file/
webhook via `curl`: | ||
|
||
---- | ||
$ curl -H "X-Event-Key: repo:push" -H "Content-Type: application/json" -k -X POST --data-binary @gitlub_payload_file.json https://<openshift_api_host:port>/oapi/v1/namespaces/<namespace>/buildconfigs/<name>/webhooks/<secret>/bitbucket |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/gitlub_payload_file/bitbucket_payload_file/
Or even better -- we can use similar payload_file.json
name in all examples.
@php-coder @bparees I've implemented your changes! |
@openshift/team-documentation ptal. @oatmealraisin please link the PR that implements this feature so the docs team knows when they can merge it. |
Related Origin PR, thanks @bparees! |
@@ -27,7 +27,10 @@ triggers are available: | |||
|
|||
Webhook triggers allow you to trigger a new build by sending a request to the | |||
{product-title} API endpoint. You can define these triggers using | |||
https://developer.github.com/webhooks/[GitHub webhooks] or Generic webhooks. | |||
https://developer.github.com/webhooks/[GitHub], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to add link: in front of all links to external websites per our doc guidelines for example:
link:https://developer.github.com/webhooks/[GitHub]
[[gitlab-webhooks]] | ||
=== GitLab Webhooks | ||
|
||
https://docs.gitlab.com/ce/user/project/integrations/webhooks.html[GitLab webhooks] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link:https://docs.gitlab.com/ce/user/project/integrations/webhooks.html[GitLab webhooks]
$ oc describe bc <name> | ||
---- | ||
. Copy the webhook URL. | ||
. Follow the https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#webhooks[GitLab setup instructions] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link:https://docs.gitlab.com/ce/user/project/integrations/webhooks.html#webhooks[GitLab setup instructions]
[[bitbucket-webhooks]] | ||
=== Bitbucket Webhooks | ||
|
||
https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html[Bitbucket webhooks] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link:https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html[Bitbucket webhooks]
+ | ||
---- | ||
$ oc describe bc <name> | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a new line between the code block and the next step
$ oc describe bc <name> | ||
---- | ||
. Copy the webhook URL. | ||
. Follow the https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html[Bitbucket setup instructions] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
link:
@oatmealraisin Overall, looks good! Just a few minor comments from me. I will mark this [do not merge] to prevent premature merging on the docs end. Thanks so much! 🍻 |
@oatmealraisin Also, to answer your original question, placement of the information LGTM right now. If this topic continues to expand, we may choose to chunk it up later. |
@ahardin-rh I've implemented your changes! |
@oatmealraisin LGTM! |
@ahardin-rh The source PR was merged, could we merge this PR? |
@ahardin-rh @gabemontero ptal? Does this content warrant a different place to display the info?