Cloudsmith Documentation Hub

Welcome to the Cloudsmith Documentation Hub. You'll find comprehensive guides and documentation to help you start working with Cloudsmith as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Semaphore CI

How to integrate Semaphore CI with Cloudsmith

Semaphore is a hosted continuous integration and deployment service used for testing and deploying software projects hosted on GitHub and BitBucket.

You can create your workflow and pipelines by writing YAML configuration files and committing them along with your source code, or using the intuitive Visual Builder that Semaphore includes.

No Code Uploading

The Cloudsmith CLI gives you full control when connecting to any CI/CD process; allowing you to upload any of our support formats or query your repositories. Just configure your API Key, install the CLI, and you'll be all set.

In the following examples:

Identifier

Description

OWNER

Your Cloudsmith account name or organisation name (namespace)

REPOSITORY

Your Cloudsmith Repository name (also called "slug")

FORMAT

The format of the package, i.e "deb", "maven", "npm" etc

PACKAGE_FILE

The filename of the package

API Key Configuration

You need to add your Cloudsmith API Key in order to authenticate to Cloudsmith for pushing packages. We recommend storing your Cloudsmith API Key as a secret in Semaphore. Secrets in Semaphore are organization-level objects that can contain environment variables or files which you can then access in your build jobs.

You can add a secret using the Semaphore CLI or the UI:

Adding a Secret using the Semaphore UIAdding a Secret using the Semaphore UI

Adding a Secret using the Semaphore UI

Push Package Example

To Push a package to Cloudsmith from a Semaphore CI Pipeline, you just need to add your Cloudsmith API Key secret and the cloudsmith push CLI command to one of the blocks in your pipeline

For example:

  - name: Push Package
    task:
      secrets:
        - name: Cloudsmith-API
      jobs:
        - name: Push
          commands:
            - cache restore package
            - cloudsmith push FORMAT OWNER/REPOSITORY/ PACKAGE_FILE
      prologue:
        commands:
          - sem-version python 3.7
          - pip install cloudsmith-cli

πŸ“˜

Note

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).

In the above example, we use the command executed during the block prologue to install the Cloudsmith CLI, so that the cloudsmith push command is available.

In addition, we also use the cache restore command to retrieve the package file that was built in a previous block. Please see the Semaphore Cache documentation for more detail on storing and retrieving artifacts using the Semaphore cache

πŸ“˜

Note

Where supported, you can also use native publishing commands like docker push or npm publish instead of using the Cloudsmith CLI, provided you have installed the necessary tooling as part of your pipeline block setup.

Updated 4 months ago


Semaphore CI


How to integrate Semaphore CI with Cloudsmith

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.


Cloudsmith is the new standard in Package 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)