cargo-sls-distribution

Crates.iocargo-sls-distribution
lib.rscargo-sls-distribution
version0.4.5
sourcesrc
created_at2017-01-04 07:00:33.072177
updated_at2017-08-25 03:55:03.76077
descriptionA Cargo subcommand which packages a binary crate into a distribution archive
homepage
repositoryhttps://github.com/sfackler/cargo-sls-distribution
max_upload_size
id7915
size40,070
cargo publish (github:servo:cargo-publish)

documentation

README

cargo-sls-distribution

CircleCI

A Cargo subcommand which packages binary crates in a format compatible with the SLS specification for easy distribution and execution. The package layout is designed to split immutable files from mutable state and configuration.

The crate is packaged with a simple daemonizing script, a manifest describing the content of the package, and other user-defined content:

[service-name]-[service-version]/
    deployment/
        manifest.yml                      # simple package manifest
    service/
        bin/
            [service-name]                # crate executable
            init.sh                       # daemonizing script
        monitoring/
            bin/
                check.sh                  # monitoring script
    var/                                  # application configuration and data

Packages are produced as a gzipped tarball named [service-name]-[service-version].sls.tgz.

Usage

Install via Cargo and run as a subcommand:

$ cargo install cargo-sls-distribution
    ...
$ cargo sls-distribution

The path of the created package will be printed to standard out.

Configuration

Configuration is specified in the package.metadata.sls-distribution section of your Cargo.toml.

[package.metadata.sls-distribution]
# A Maven-style group name for the distribution.
# Required.
product-group = "com.foobar"

# A list of command line arguments to supply to the crate when running it.
# Defaults to an empty list.
args = ["server", "var/conf/server.yml"]

# A list of command line arguments to supply to the crate when checking its status.
# If not provided, no monitoring script will be generated.
check-args = ["check", "var/conf/server.yml"]

# If set, the service version will be derived from `git describe` rather than the Cargo package version.
# Defaults to false.
git-version = true

# A map of extended manifest attributes.
# Defaults to an empty map.
manifest-extensions = { key = "value" }

# An array of information about services that this depends on.
[[package.metadata.sls-distribution.product-dependencies]]
product-group = "com.foobar"
product-name = "my-service"
minimum-version = "1.1.0"

The contents of the deployment, service, and var directories will be added to the archive if present, though this can be controlled as you would for cargo package, via the standard package.include and package.exclude fields as well as .gitignore files:

[package]
exclude = ["var/data/*"]
Commit count: 93

cargo fmt