> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/sast-and-sca/prezero/static-analysis-sast/workflows/gocd.md).

# GoCD

This article shows you how to integrate Qwiet AI by Harness into your GoCD workflow to provide automated code analysis.

## Prerequisites <a href="#prerequisites" id="prerequisites"></a>

This tutorial assumes that you have:

* [Installed GOCD](https://docs.gocd.org/current/installation/installing_go_server.html)
* [Set up Qwiet AI by Harness](broken://spaces/uPVBkglG6gsk2SsnsKgG/pages/fDfomI4jhzwCNFxmGSLc) onto your GoCD server

## Step 1: Create your environment variables <a href="#step-1-create-your-environment-variables" id="step-1-create-your-environment-variables"></a>

Log into your GoCD server using an account that has administrator privileges.

Create the following [environment variables](https://docs.gocd.org/current/faq/dev_use_current_revision_in_build.html#setting-variables-on-an-environment) containing authentication information for Qwiet:

| **Variable**             | **Value**         |
| ------------------------ | ----------------- |
| `SHIFTLEFT_ACCESS_TOKEN` | Your Access Token |

When running in a production environment, we recommend using a CI token as the access token. You can [create your CI token](/sast-and-sca/prezero/integrations/tokens.md) in the Qwiet Dashboard.

Please note that the presence of any set environment variables will override those in a configuration file.

## Step 2: Add Qwiet to the agent image <a href="#step-2-add-qwiet-to-the-agent-image" id="step-2-add-qwiet-to-the-agent-image"></a>

To provide instructions for running Qwiet to your GoCD agent image, navigate to the image you want to modify and use the editor to add the following shell script:

```
#!/bin/sh
/usr/local/bin/sl analyze
```

![](/files/DfHDmRpYn5HJOmhRtTva) ![](/files/P5vj8JOtHNJWVEvAqKym)

Be sure to check this shell file in your project's repository.

### Step 3: Configure your build <a href="#step-3-configure-your-build" id="step-3-configure-your-build"></a>

Once you've checked in the shell script you created in Step 2, you'll need to configure your build. To do so, pen up your project and go to the project's **Settings**.

Under the **Stages** tab, click **Add New Stage** and set the following parameters:

| **Parameter**     | **Value**                                  |
| ----------------- | ------------------------------------------ |
| Stage Name        | `SL Analyze`                               |
| Trigger Type      | **On Success**                             |
| Job Name          | `SL Analyze`                               |
| Task Type         | `More`                                     |
| Command           | `/bin/sh`                                  |
| Arguments         | `<path-to-checked-in-script>.sh`           |
| Working Directory | `<directory-to-built-project-packages>.sh` |

Click **Save**.
