> 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/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/run-a-drone-plugin-in-ci.md).

# Use Drone plugins

Drone plugins are Docker containers that perform predefined tasks.

Drone plugins are Docker containers that perform predefined tasks. You can use the **Plugin** step to run plugins from the [Drone Plugins Marketplace](https://plugins.drone.io/) in your [Harness CI pipelines](/continuous-integration/use-harness-ci/use-harness-ci/prep-ci-pipeline-components.md). You can also [write your own custom plugins](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/custom_plugins.md). Go to [Explore plugins](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) for plugins.

<details>

<summary>About Drone</summary>

[Drone](https://docs.drone.io/) was acquired by Harness in 2020 and is part of Harness CI.

Go to the following blog posts for the acquisition of Drone:

* [Harness Acquires CI Pioneer Drone.io and Commits to Open Source](https://harness.io/blog/featured/harness-acquires-ci-pioneer-drone-io-and-commits-to-open-source/)
* [Lavasoft Reduces Developer Toil by 94% Using Drone and Harness](https://harness.io/customers/case-studies/reduce-developer-toil/)

</details>

## Add a plugin to a Harness CI pipeline <a href="#add-a-plugin-to-a-harness-ci-pipeline" id="add-a-plugin-to-a-harness-ci-pipeline"></a>

To demonstrate how to add a Drone plugin to a Harness CI pipeline, these steps use the [Download plugin](https://plugins.drone.io/plugins/download) as an example. This plugin downloads an archive to the [stage workspace](/continuous-integration/use-harness-ci/use-harness-ci/caching-ci-data/share-ci-data-across-steps-and-stages.md#share-data-between-steps-in-a-stage).

{% tabs %}
{% tab title="Visual" %}
Add the **Plugin** step to the **Build** stage of your CI pipeline, and configure the settings as follows:

* **Name:** Enter a name for the step.
* **Description:** Optional description.
* **Container Registry:** Select a [Docker connector](/harness-platform/use-harness-platform/connectors/artifact-repositories/add-a-docker-registry-connector/docker-registry-connector-settings-reference.md).
* **Image:** Enter the plugin's Docker image, such as `plugins/download`. You can find this on the plugin's page on the [Drone Plugins Marketplace](https://plugins.drone.io/).
* **Settings:** Enter key-value pairs representing plugin settings. You can find this on the plugin's page on the [Drone Plugins Marketplace](https://plugins.drone.io/) or in the plugin's README.
* Go to the [Plugin step settings reference](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md) for other settings.

The following screenshot shows a **Plugin** step configured for the [Download plugin](https://plugins.drone.io/plugins/download).

![](https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-e81214c09a9398d1bf29b6b9897bc42d816c7ba0%2Frun-a-drone-plugin-in-ci-00.png?alt=media)
{% endtab %}

{% tab title="YAML" %}
Add the `Plugin` step to your `CI` stage with the following settings:

* `type: Plugin`
* `name:` A name for the step
* `connectorRef:` The ID of a [Docker connector](/harness-platform/use-harness-platform/connectors/artifact-repositories/add-a-docker-registry-connector/docker-registry-connector-settings-reference.md).
* `image:` The plugin's Docker image, such as `plugins/download`. You can find this on the plugin's page on the [Drone Plugins Marketplace](https://plugins.drone.io/).
* `settings:` A mapping of key-value pairs representing plugin settings. You can find this on the plugin's page on the [Drone Plugins Marketplace](https://plugins.drone.io/) or in the plugin's README.
* Go to the [Plugin step settings reference](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md) for other settings.

The following examples show the YAML definition for a `Plugin` step configured for the [Download plugin](https://plugins.drone.io/plugins/download).

{% tabs %}
{% tab title="Download Drone tarball" %}
This example downloads the Drone Linux amd64 tarball. It provides a username and password for authentication to GitHub.

```yaml
              - step:
                  type: Plugin
                  name: drone plugin
                  identifier: drone_plugin
                  spec:
                    connectorRef: account.docker
                    image: plugins/download
                    settings:
                      source: https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz ## Target to download
                      username: my-username ## Username for authentication to the source
                      password: `<+secrets.getValue("mygithubpersonalaccesstoken")>` ## Password for authentication to the source
```

{% endtab %}

{% tab title="Download AWS CLI" %}
This example downloads the AWS CLI for Linux and saves it to the default stage workspace directory under the name `awscli.zip`. Because the target is publicly accessible, authentication settings are not required.

```yaml
              - step:
                  type: Plugin
                  name: drone plugin
                  identifier: drone_plugin
                  spec:
                    connectorRef: account.docker
                    image: plugins/download
                    settings:
                      source: https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip ## Target to download
                      destination: awscli.zip ## File name to assign the downloaded file.
```

Expanding on this example, you could use the following commands in a subsequent [Run step](/continuous-integration/use-harness-ci/use-harness-ci/run-step-settings.md) to unzip and install this tool:

```bash
unzip awscli.zip
sudo ./aws/install
```

You could also [write a custom plugin](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/custom_plugins.md) that downloads, unzips, and installs the AWS CLI in one step.
{% endtab %}
{% endtabs %}
{% endtab %}
{% endtabs %}

{% hint style="info" %}
**TIPS**

You can use variable expressions for **Settings** values. For example, `credentials: <+stage.variables.[TOKEN_SECRET]>` uses a [stage variable](/harness-platform/use-harness-platform/pipelines/add-a-stage.md#stage-variables).

Create [text secrets](/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md) for sensitive information, such as passwords and tokens, required by the plugin.

When you run the pipeline, [check the log output](/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md) to verify that the plugin works as intended.
{% endhint %}

### Plugin settings <a href="#plugin-settings" id="plugin-settings"></a>

Go to the plugin's page on the [Drone Plugins Marketplace](http://plugins.drone.io/) for a plugin's settings. In addition to the settings described on a plugin's Marketplace page, each plugin has a README where you can read about the plugin's settings in detail. The README can include additional or uncommon settings that are not described on the Marketplace page or the Harness CI documentation. You can find README links at the top of each plugin's Marketplace page.

<figure><img src="https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-8a356aebb65e672274f456eeb2b46defde4988b1%2Fplugin-marketplace-readme-link.png?alt=media" alt=""><figcaption><p>The README link is at the top of each plugin's Drone Plugin Marketplace page.</p></figcaption></figure>

**Output variables**

Go to [Plugin step settings: Output variables](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md#output-variables) for output variables produced by plugins.

**Environment variables**

Harness CI supports `DRONE_` environment variables. Go to the [CI environment variables reference](/continuous-integration/troubleshooting-and-resources/troubleshoot-harness-ci/ci-env-var.md) to see the full list.

### Plugin configuration examples <a href="#plugin-configuration-examples" id="plugin-configuration-examples"></a>

Here are some YAML examples and additional information about specific Drone plugins.

<details>

<summary>Artifact Metadata Publisher plugin</summary>

Use the [artifact-metadata-publisher plugin](https://github.com/drone-plugins/artifact-metadata-publisher) to publish a URL of an artifact file to the [Artifacts tab](/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md).

An example of the **Plugin** step configuration is provided below; however, your pipeline must also include steps to upload the file that you want to link to on the **Artifacts** tab, as demonstrated in [Publish to the Artifacts tab](/continuous-integration/use-harness-ci/use-harness-ci/build-and-upload-artifacts/artifacts-tab.md).

```yaml
               - step:
                  type: Plugin
                  name: metadata publisher plugin
                  identifier: metadata_publisher_plugin
                  spec:
                    connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR 
                    image: plugins/artifact-metadata-publisher
                    settings:
                      file_urls: https://storage.googleapis.com/mybucket/index.html ## Provide a URL to the artifact you want to show on the artifact tab. You can provide a list of multiple URLs to show multiple links on the Artifacts tab.
                      artifact_file: artifact.txt ## Provide any '.txt' file name, such as 'artifact.txt' or 'url.txt'. This is a required setting that Harness uses to store the artifact URL and display it on the Artifacts tab. This value is not the name of your uploaded artifact, and it has no relationship to the artifact object itself.
```

Go to [Build and push artifacts and images](/continuous-integration/use-harness-ci/use-harness-ci/build-and-upload-artifacts.md) for uploading and publishing artifacts.

</details>

<details>

<summary>GitHub Actions plugin</summary>

* With Harness Cloud build infrastructure, use the [GitHub Action step](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/ci-github-action-step.md).
* With other build infrastructures, use the [GitHub Actions Drone plugin in a Plugin step](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/run-a-git-hub-action-in-cie.md).

</details>

<details>

<summary>Jira plugin</summary>

Go to [Integrate Jira in a CI pipeline](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/ci-jira-int-plugin.md).

</details>

<details>

<summary>Slack plugin</summary>

Harness has built-in [notifications](/harness-platform/use-harness-platform/notifications-alerts-and-banners.md) for email, Microsoft Teams, and Slack.

</details>

## Convert Drone YAML to Harness YAML <a href="#convert-drone-yaml-to-harness-yaml" id="convert-drone-yaml-to-harness-yaml"></a>

The YAML examples in the [Drone Plugins Marketplace](https://plugins.drone.io/) can help you configure `settings` for a **Plugin** step in Harness CI. Many plugins offer both Harness and standalone Drone YAML samples, as indicated by the **Drone/Harness** toggle in the **Example** section.

<figure><img src="https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-d8ea604b8d7dee0ac4396c777b1bf79f0ed621dd%2Fdrone_marketplace_toggle_yaml.png?alt=media" alt=""><figcaption><p>You can switch between Drone YAML and Harness YAML in the Drone Plugins Marketplace.</p></figcaption></figure>

Because Drone plugins can be used outside Harness CI, there are some differences, as explained below, in the YAML format when using Drone plugins in Harness CI versus outside Harness CI. This information focuses on the `step` YAML definition.

### Step structure <a href="#step-structure" id="step-structure"></a>

The following examples compare the YAML structure for a step when a Drone plugin is used in a Drone pipeline and a Harness CI pipeline.

{% tabs %}
{% tab title="Drone YAML" %}

```yaml
steps:
- name: download ## Step name
  image: plugins/download ## Plugin's Docker image
  settings: ## Plugin settings
    source: https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz
```

{% endtab %}

{% tab title="Harness YAML" %}

```yaml
            steps:
              - step:
                  type: Plugin ## Indicates that this is a Plugin step.
                  name: drone plugin ## Step name
                  identifier: drone_plugin ## Step ID
                  spec:
                    connectorRef: YOUR_IMAGE_REGISTRY_CONNECTOR 
                    image: plugins/download ## Plugin's Docker image
                    settings: ## Plugin settings
                      source: https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz
```

{% endtab %}
{% endtabs %}

### Listed and nested settings <a href="#listed-and-nested-settings" id="listed-and-nested-settings"></a>

To convert list-formatted settings from Drone Plugin YAML to Harness CI YAML, merge them with comma separation.

{% tabs %}
{% tab title="Drone YAML" %}

```yaml
Settings:
  tags:
    - latest
	- '1.0.1'
	- '1.0'
```

{% endtab %}

{% tab title="Harness YAML" %}

```yaml
settings:
  tags: latest,1.0.1,1.0
```

{% endtab %}
{% endtabs %}

For nested settings, maintain key-value pair definitions, as shown in the following Harness CI YAML example:

```yaml
settings:
  mynestedsetting:
    nextlevel:
      varname: 100
  mylistsetting:
   - itemone
   - itemtwo
```

It is often easier to define complex settings in the Harness Pipeline Studio's YAML editor, rather than the Visual editor.

<figure><img src="https://4226796345-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKtVmwAGTfGQS1MVC97G%2Fuploads%2Fgit-blob-fe038603e67f912631abc42f726f2d9bb933b6d1%2Frun-a-drone-plugin-in-ci-02.png?alt=media" alt=""><figcaption><p>Using the Visual editor to configure Plugin settings.</p></figcaption></figure>

### Text secrets <a href="#text-secrets" id="text-secrets"></a>

The following snippets illustrate the different ways that Drone and Harness CI handle [text secrets](/harness-platform/use-harness-platform/secrets/add-use-text-secrets.md).

{% tabs %}
{% tab title="Drone YAML" %}

```yaml
steps:
    - name: download
	  image: plugins/download
	  settings:
	    username:
		    from_secret: username
		password:
			from_secret: password
		source: https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz
```

{% endtab %}

{% tab title="Harness YAML" %}

```yaml
  - step:
    type: Plugin
	name: download-drone
	identifier: downloaddrone
	spec:
	    connectorRef: mygithubconnector
		image: plugins/download
		privileged: false
		settings:
		    username: <+secrets.getValue("myusernamesecret")>
			password: <+secrets.getValue("mypasswordsecret")>
			source: https://github.com/drone/drone-cli/releases/download/v0.8.5/drone_linux_amd64.tar.gz
```

{% endtab %}
{% endtabs %}

## Next steps

* Go to [Plugin step settings reference](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/plugin-step-settings-reference.md) to configure other Plugin step settings.
* Go to [Explore plugins](/continuous-integration/use-harness-ci/use-harness-ci/use-drone-plugins/explore-ci-plugins.md) to find other pre-built plugins.

{% @harness-feedback/feedback %}
