Skip to content

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

Merged
merged 1 commit into from
Apr 3, 2017
Merged

Documented new GitLab and Bitbucket webhooks #4043

merged 1 commit into from
Apr 3, 2017

Conversation

oatmealraisin
Copy link

@ahardin-rh @gabemontero ptal? Does this content warrant a different place to display the info?

Copy link
Contributor

@gabemontero gabemontero left a 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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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/

@oatmealraisin
Copy link
Author

@gabemontero I've implemented your suggestions

Copy link
Contributor

@gabemontero gabemontero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IGTM

@gabemontero
Copy link
Contributor

@bparees fyi / ptal

Copy link
Contributor

@bparees bparees left a 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],
Copy link
Contributor

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
Copy link

@php-coder php-coder Mar 30, 2017

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

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

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.

@oatmealraisin
Copy link
Author

@php-coder @bparees I've implemented your changes!

@bparees
Copy link
Contributor

bparees commented Mar 30, 2017

@openshift/team-documentation ptal. @oatmealraisin please link the PR that implements this feature so the docs team knows when they can merge it.

@oatmealraisin
Copy link
Author

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],
Copy link
Contributor

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]
Copy link
Contributor

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]
Copy link
Contributor

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]
Copy link
Contributor

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>
----
Copy link
Contributor

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]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

link:

@ahardin-rh
Copy link
Contributor

@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! 🍻

@ahardin-rh
Copy link
Contributor

@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 ahardin-rh changed the title Documented new GitLab and Bitbucket webhooks [Do not merge] Documented new GitLab and Bitbucket webhooks Mar 30, 2017
@oatmealraisin
Copy link
Author

@ahardin-rh I've implemented your changes!

@ahardin-rh
Copy link
Contributor

@oatmealraisin LGTM!

@oatmealraisin
Copy link
Author

@ahardin-rh The source PR was merged, could we merge this PR?

@ahardin-rh ahardin-rh changed the title [Do not merge] Documented new GitLab and Bitbucket webhooks Documented new GitLab and Bitbucket webhooks Apr 3, 2017
@vikram-redhat vikram-redhat modified the milestones: Future Release, Staging, OCP 3.6 GA Aug 8, 2017
@vikram-redhat vikram-redhat modified the milestones: OCP 3.6 GA, Staging, TEMP Sep 7, 2017
@vikram-redhat vikram-redhat modified the milestones: OCP 3.6 GA, Staging, TEMP Sep 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants