# Prerequisites

**Ensure the following requirements are fulfilled before integrating CI CD Harness with Avo Assure.**

1. Harness Username&#x20;
2. Harness Password&#x20;
3. Ensure you have installed and configure Docker with infrastructures.
4. Ensure delegate have Cloud Avo Assure Client and it should be run as Custome delegate.
5. To trigger the Avo Assure Client as an image, the custom delegate must be installed, active, and connected within the Harness Project.

### Add Delegate to the Harness Project

#### &#x20;Step-by-step instructions to add Delegate to the Harness Project.

1. Navigate to **Harness** application.
2. Select **Account Settings** option from the right pane of the Harness home page.
3. Click **Delegates** option from the **Account-level** resources section.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FS9cNn3N1OWyIE1wglAsj%2Fimage.png?alt=media&#x26;token=1df3fa26-6186-490f-8812-6d8521857dd1" alt=""><figcaption></figcaption></figure>

4. Click **Install a Delegate** button to bring the **New Delegate** window.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FghZcZ6A23I8A2hkizRv3%2Fimage.png?alt=media&#x26;token=2ccf2e5d-a470-4f60-a646-1eba6286ae2e" alt=""><figcaption></figcaption></figure>

5. **To install Delegate in Harness we have two options.**
   1. Kubernetes
   2. Docker

#### **a. Docker**

#### Steps after selecting Docker as option.

1\. Enter the Name in the **Delegate Name** textbox.

2\. Click **Copy** icon to copy the command to install Delegate.

{% hint style="info" %}
**Note:** Past the copied command into the Notepad to use feather.
{% endhint %}

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FXGJaPpwNGwUuhS7Skeda%2Fimage.png?alt=media&#x26;token=d740bc32-5d46-4283-bbd0-cd61a923aad3" alt=""><figcaption></figcaption></figure>

3\. Open the **Command Prompt** in system and pull the Avo Assure Client Image in Command prompt and run it.

4\. Past the copied command to the Command prompt which is copied from the New Delegate window in Harness.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FxdLKti8eyZ8efpepYgOu%2Fimage.png?alt=media&#x26;token=c6c044a5-ae3d-4c9b-a1e3-787630c2d695" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Ones the delegate run successful in command prompt you can see the status in the **Account Resources: Delegates window.**
{% endhint %}

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2F2aw7czZLFnUP5joWZXtf%2Fimage.png?alt=media&#x26;token=1560d98c-aa26-4722-b0dc-b5a2b175cd7e" alt=""><figcaption></figcaption></figure>

## Integrate the Delegate as a step in Harness Pipeline

{% hint style="info" %}
**Note:** Most CI/CD tools support multiple scripting languages for pipeline execution (such as cURL, Javascript, Python, PowerShell- RestMethod, Shell- wget). In this documentation, we have provided an example using **ShellScript**. User can use other supported languages as needed.
{% endhint %}

**Step-by-step instructions to add Delegate as a step in Harness Pipeline.**

1\. Navigate to the projects section in Harness and select Project

2\. Navigate to the Pipeline that already has test steps, if not create a new pipeline to add Avo’s custom delegate with a shell script step.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FhoLOc9law22RS3rwuuGR%2Fimage.png?alt=media&#x26;token=b336303f-b42e-480a-88fb-d67ff7c479fb" alt=""><figcaption></figcaption></figure>

3\. Add Avo Assure as a pipeline step and select the running delegate in the Advance options Menu. This pipeline step has to run a shell script.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FBtZOBZfpK0T10PxCmSSV%2Fimage.png?alt=media&#x26;token=ec9cdc99-1833-4c8d-86a0-5e7f1e4c27ca" alt=""><figcaption></figcaption></figure>
