Skip to content

Commit

Permalink
Merge pull request #565 from zebrunner/develop
Browse files Browse the repository at this point in the history
2.4
  • Loading branch information
vdelendik authored Aug 15, 2023
2 parents e38c663 + c997209 commit 59c8656
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 24 deletions.
25 changes: 5 additions & 20 deletions docs/integration/scm.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,50 +8,35 @@

### Configure required credentials

After you register a repository a jenkins credential is generated with the format of `orgName-scmType-webhook-token`, this credential needs to be updated with a personal access token generated in your repository scm.
After you register a repository a jenkins credential is generated with the format of `orgName-scmType-webhook-token`, these credentials must be updated with the `new-token`.
> Note: this jenkins credentials are globally used for each repository of an organization registered in zebrunner.
#### Github access token

* Follow steps 1-9 [here](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token) to create your GitHub personal access token.
* Grant access for the following permissions: **repo and admin:repo_hook**.

#### Gitlab access token
* Follow steps 1-7 [here](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token) to create your Gitlab personal access token.
* In step **5** select the **api, read_repository, write_repository** scopes.


#### BitBucket Cloud token
* Open your terminal and run the following command ```echo -n username:password | base64``` where username and password are your BitBucket credentials, this will return a token encoded in base64.

> Note: make sure to copy your token as your are going to need it in the **Configure Webhooks** and **Update Jenkins Credentials** sections.
#### Update Jenkins Credentials

* Go to **Jenkins > Manage Jenkins > Manage credentials**.
* Find your `orgName-scmType-webhook-token` credential and click on the ID.
* Update the **Secret text** with your correspondent scm token.
* Update the **Secret text** with your `new-token`.
* Click save.

### Configure Webhooks

#### GitHub: Configure Webhook for Pushes and Pull Requests
* Go to your **GitHub repository page > Settings > Webhooks > Add webhook**.
* Add `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=github-token-here` into "Payload URL" field.
* Add `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=<new-token>` into "Payload URL" field.
* Select application/json in "Content Type" field.
* Click **Let me select individual events** and select **Pushes, Pull Requests**.
* Click **Add webhook**.

#### Gitlab: Configure Webhook for Pushes and Pull Requests
* Go to your **Gitlab repository page > Settings > Webhooks**.
* Add `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=gitlab-token-here` into "Payload URL" field.
* Add `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=<new-token>` into "Payload URL" field.
* "Secret Token" is empty field.
* Select **Push and Merge Requests events**.
* Click **Add webhook**.

#### BitBucket Cloud: Configure Webhook for Pushes
* Go to your **BitBucket repository page > Repository Settings > Webhooks > add webhook**.
* Enter `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=bitbucket-token-here` into **URL** field.
* Enter `http://your-zebrunner-domain.com/jenkins/generic-webhook-trigger/invoke?token=<new-token>` into **URL** field.
* Check that **Repository push** is selected.
* Click **Save**.

Expand Down
2 changes: 1 addition & 1 deletion jenkins
2 changes: 1 addition & 1 deletion mcloud
2 changes: 1 addition & 1 deletion reporting
Submodule reporting updated 1 files
+1 −1 .env.original
2 changes: 1 addition & 1 deletion selenoid

0 comments on commit 59c8656

Please sign in to comment.