# From Harbor events

WebhooksSuppose users want to trigger a pipeline or release on Pushing an artifact on Harbor, they can create a webhook using the webhook type as **Harbor**.

### **Steps to create a Harbor Webhook for release** <a href="#steps-to-create-a-harbor-webhook-for-release" id="steps-to-create-a-harbor-webhook-for-release"></a>

**Pre-requisites:**

* An active Harbor account with registries needs to have the username, password, and the instance URL
* An Active cluster
* A Release that has been created from the Release Templates section

**Steps**

1. On click of the **create webhook** button, a modal window appears in which we can enter the details for webhook creation

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FnNPLy7h6xUcjtJQYUldY%2Fimage-20240418-102801.png?alt=media&#x26;token=8d2375e4-6203-40f5-a9ea-30fc33e04194" alt=""><figcaption></figcaption></figure>

2. Now we need to select the Webhook Type as Harbor from the **Webhook Type** dropdown

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2Fpd1jFHdbpzHL4yS6sJIn%2Fimage-20240418-102843%20(1).png?alt=media&#x26;token=f04bf389-4911-48be-a0df-e09372f76c5e" alt=""><figcaption></figcaption></figure>

3. After selecting the Webhook type as **Harbor**, an option will be shown to select the registries

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FCaFZVHCLYRhqTsGp9WtC%2Fimage-20240418-103027.png?alt=media&#x26;token=bac2fc50-252d-4c8f-bbc0-1c579dbbe931" alt=""><figcaption></figcaption></figure>

4. Once the Registry has been selected users need to select the **Action type**, for Harbor there is only 1 action type which is to **Push Artifact,** whenever an artifact is pushed to a registry the pipeline or release will be triggered

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FkgP1ol9ForIsjkdeKqOM%2Fimage-20240418-103153.png?alt=media&#x26;token=b884ceb0-837b-46ae-9b9a-b1ca280985e6" alt=""><figcaption></figcaption></figure>

5. Once the Action type has been selected, users can select what they want to be triggered **pipeline or release**

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F2JK0i9vjfbgo9ru1xKow%2Fimage-20240418-103252%20(1).png?alt=media&#x26;token=d6d44aa2-2282-4ad5-b7f7-dcd9ec55fff6" alt=""><figcaption></figcaption></figure>

Here we will select the trigger type as the release\
\
6\. After this users can select the release which they want to be triggered

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F0TlED7y3oDx696YcOv4n%2Fimage-20240418-103349%20(1).png?alt=media&#x26;token=a6049ef8-8262-40ab-b9b9-a9e221c99285" alt=""><figcaption></figcaption></figure>

7. Once every option has been selected the **map parameters** option will be enabled and users can click on it to move to the next step

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FeT2QFLsMUzfAl91GNOQM%2Fimage-20240418-103432.png?alt=media&#x26;token=083a237f-8899-4405-bd93-488993600772" alt=""><figcaption></figcaption></figure>

8. After going to the second step users can choose the **input run parameters**, once all these options have been selected, users can click on the save button to create the webhook

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2F4ndK7ry8VmFlfnmIos3f%2Fimage-20240418-103525.png?alt=media&#x26;token=33d2921a-cf0a-47cb-b5ca-99f945df6db2" alt=""><figcaption></figcaption></figure>

This is how webhooks are created for a Harbor registry for a release\ <br>

**Steps to create Harbor webhook for pipeline**

**Pre-requisites:**

* An Active cluster
* A microservice

Follow the same steps until **Step 4** of Creating Webhooks for release

1. Once the registry and the action type have been selected, select the release type as the pipeline

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FR0sMxHXhxDdkwJo2k0yO%2Fimage-20240418-103843.png?alt=media&#x26;token=b9d41b40-e761-4b5c-ba22-2482eeb6b2ef" alt=""><figcaption></figcaption></figure>

2. Once the Trigger type has been selected, now select the pipeline that needs to be triggered

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FOQzYZvMWgUBU3eZclsCU%2Fimage-20240418-103947.png?alt=media&#x26;token=2c7d3d50-ae37-446d-8085-62e305a457a9" alt=""><figcaption></figcaption></figure>

3. After selecting the pipeline, select the environment in which the webhook needs to be created\
   **Remember to select the environment the same in which the cluster has been created**

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FkaioMh9U1EotPHDUrwRo%2Fimage-20240418-104010.png?alt=media&#x26;token=efa4c64b-e699-45fe-bb5c-c6985c000858" alt=""><figcaption></figcaption></figure>

4. After selecting the environment, users will be shown an option to select the cluster<br>

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FJFw6yjiC9qDKEdKjYXsB%2Fimage-20240418-104042.png?alt=media&#x26;token=c347f014-0b9b-4938-9ebc-0448cfbd4299" alt=""><figcaption></figcaption></figure>

5. Once the cluster has been selected, select the microservice

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FXbVKJYzywozhHWhKT2iX%2Fimage-20240418-104103.png?alt=media&#x26;token=be4967dd-a5d8-4bda-a328-0af210518326" alt=""><figcaption></figcaption></figure>

6. After selecting the microservice, users can move to the **Map parameters** step, to select the run parameters for the pipeline

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FIa1YGaunjC2qpAdxo0hP%2Fimage-20240418-104153.png?alt=media&#x26;token=9111b828-78d6-49ae-b593-297fde4cf79c" alt=""><figcaption></figcaption></figure>

7. In **Map parameters,** users can select all the options as they desire

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FCMuAj5qYmhI4PQrVYAmN%2Fimage-20240418-104219.png?alt=media&#x26;token=8b816377-4924-49a5-be0a-f1ce4d65e0bf" alt=""><figcaption></figcaption></figure>

8. Once all this is done, users can click on the **Save** button to create the webhook for the pipeline.

<figure><img src="https://3829750647-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAObcOkMb6sCSnSdcUOTm%2Fuploads%2FWxW1dQ7we1xSX798NHyX%2Fimage-20240418-104256.png?alt=media&#x26;token=24ef725f-1158-4e15-81d5-5ba36cb4e581" alt=""><figcaption></figcaption></figure>

This is how Harbor webhooks are created for releases and pipelines.
