Skip to content
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

Add a better warning about branch names #2403

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions docs/cloud/rahti2/tutorials/webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

Webhooks are URLs that allow triggering actions in a system. Rahti 2 supports webhooks to trigger rebuilds. This means that each BuildConfig is listening to a particular URL that includes a secret (more about that later), and that when this URL is called, a build will be triggered for a default branch.

!!! info "Default branch name"

In Rahti 2 the default branch name is `master`. Branches named otherwise (e.g. GitHub's default value `main`) will be ignored, so make sure that both sides use the same branch name.

There are few types of formats supported: Generic, GitHub, GitLab and Bitbucket. This means that if the source code of the application is in Gitlab, the Gitlab URL type must be selected.

![Triggers](../../img/trigger.drawio.svg)
Expand All @@ -30,6 +26,16 @@ When the `BuildConfig` is configured, you can get the URL via the webinterface.

![Copy URL with Secret](../../img/webhooks.png)

!!! Warning "Default branch names do not match"

You need to make sure that the branch names match between Rahti 2 and GitHub. In Rahti 2, the default branch name is `master`, but in GitHub, the default branch name is `main`. This means that—by default—any change in a GitHub branch named `main` will be ignored by Rahti 2.

If you want changes in `main` to be picked up by Rahti 2, you need to:

1. Edit the **BuildConfig**
1. Expand **Show advanced Git options** under **Source**
1. Add the correct branch name (in this case `master`) under **Git reference**.

## GitHub

Once you got the URL and the secret, go to <https://github.com>. There you should go to the repository where the code is, and in **Settings -> Webhooks**, click in "Add webhook".
Expand Down