Drone CI

How to integrate Drone CI with Cloudsmith

Drone is a Continuous Integration platform that allows automation of build, test, and release workflows using a powerful, cloud-native pipeline engine.

API Key Configuration

You need to add your Cloudsmith API Key within Drone CI. We recommend storing your Cloudsmith API Key as a per-repository or per-organization secret in the Drone Server and then injecting the CLOUDSMITH_API_KEY environment variable into your build jobs like:

    from_secret: CLOUDSMITH_API_KEY


In the following examples:

OWNERYour Cloudsmith account name or organisation name (namespace)
REPOSITORYYour Cloudsmith Repository name (also called "slug")
FORMATThe format of the package, i.e "deb", "maven", "npm" etc
PACKAGE_FILEThe filename of the package

Build Step Example

To push an artifact from a build step, you just need to add the commands to install the Cloudsmith CLI and use the cloudsmith push command:

  - pip install cloudsmith-cli 

Docker Pipeline Example

Drone supports different types of pipelines, each optimized for different use cases and runtime environments.

For example, you can use a Docker pipeline with your own Docker image that includes the Cloudsmith CLI, negating the need to install the CLI in a Build Step. The following example configuration specifies a Docker image from a Cloudsmith repository:

- name: Build and Push Package
  image: docker.cloudsmith.io/OWNER/REPOSITORY/IMAGE_NAME:latest
      from_secret: CLOUDSMITH_API_KEY
    - .......
    - .......
 - dockerconfigjson

As the Docker image used for the pipeline in this example is hosted in a private Cloudsmith repository, you need to authenticate to the repository to pull the image for use. You can add the authentication credentials as a per-repository or per-organization secret in Drone CI. You can obtain these credentials from your ~/.docker/.config.json file after you do a normal docker login to your Cloudsmith repository

You then use image_pull_secrets, with the name of the secrets file you created in Drone CI to enable your pipeline to authenticate to your Cloudsmith repository.



The push command will vary with the package format, an example of the push command for a debian package would look like:
cloudsmith push deb my-org/my-repo/ubuntu/xenial foo-1.0.deb

Please see the Cloudsmith CLI for full details of the push command for other formats and additional help.

Cloudsmith is the new standard in Package / Artifact Management and Software Distribution

With support for all major package formats, you can trust us to manage your software supply chain.

Start My Free Trial Now
Cookie Declaration (Manage Cookies)