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.
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.
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
$ export CLOUDSMITH_REPOSITORY_IS_PRIVATE=yes/no
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
CLOUDSMITH_REPOSITORY_IS_PRIVATE=yes/no
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
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.
This quality product was brought to you by Cloudsmith and the fine folks who have contributed.