Skip to content
Example Projects for Cloudsmith Integration
Branch: master
Clone or download
Latest commit 956460b May 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
bin
examples Merge pull request #27 from cloudsmith-io/example-install-npm May 3, 2019
.gitignore Fix all examples and make structure more consistent across formats Mar 15, 2019
CONTRIBUTING.md Initial commit Jan 31, 2018
CONTRIBUTORS.md Updated contributors Apr 3, 2019
LICENSE
README.md Add install/usage example for Alpine/APK Apr 29, 2019

README.md

Cloudsmith Examples

CircleCI

Be Awesome. Automate Everything.

This repository provides example projects for most of the packaging formats supported by Cloudsmith. It demonstrates how to automate build and upload for each package format using both the Cloudsmith CLI and native tooling (where available).

The artifacts generated by this repository will be uploaded automatically to the public Cloudsmith examples repository by CI.

Usage

Dependencies

To run the examples locally you'll need to install a few dependencies:

You'll need to create a Cloudsmith repository to store the generated artifacts.

Configuration

The examples are configured using environment variables. You can set these manually in your terminal:

$ export CLOUDSMITH_API_KEY=YOUR_API_KEY_HERE
$ export CLOUDSMITH_REPOSITORY=your-name-or-org/your-repository

Or use a tool like forego (forego run ...) to load them from a .env file in the root of the examples repository:

CLOUDSMITH_API_KEY=YOUR_API_KEY_HERE
CLOUDSMITH_REPOSITORY=your-name-or-org/your-repository

Running the examples

To run a single example invoke the run-example script, passing the name of the example:

$ ./bin/run-example python-native

To run all examples use the run-examples script, passing no arguments:

$ ./bin/run-examples

Structure

All example projects live in the examples/ directory, one per folder.

Inside each example directory is a consistent structure:

  • src/: Source code for the example package in each format.
  • prepare.sh: A script which performs any setup or initialisation required to build and publish the example package.
  • build.sh: A script which builds the example package into an artifact that can be published to Cloudsmith.
  • deploy.sh: A script that publishes the built artifact(s) to Cloudsmith.
  • install.sh: A script which sets up a new environment and installs the recently published package from Cloudsmith.

The scripts prepare.sh and deploy.sh are optional. If not present they will be skipped.

Example packages are purposefully as minimal as possible to show the minimum configuration required to integrate with Cloudsmith.

EOF

This quality product was brought to you by Cloudsmith and the fine folks who have contributed.

You can’t perform that action at this time.