Skip to content

massdriver-cloud/mass

Repository files navigation

Mass CLI

GitHub license GitHub issues GitHub release Go Report Card Go Reference

The Mass CLI is a command line tool to manage applications and infrastructure on Massdriver Cloud.

Official GitHub actions are also available.

Installation

Pre-built Binaries

Pre-built binaries for the Mass CLI are available in the Releases section of this repository.

Homebrew

brew install massdriver

Go

go install github.com/massdriver-cloud/mass

Usage

The mass command line tool provides a number of subcommands to interact with Massdriver Cloud. For detailed usage and examples, please see the official documentation.

Preview Environments

Initialize a Preview Environment Config File

The preview environment config file should be checked into your source repository. The preview.json file supports bash interpolation in the event you need to dynamically set values from your CI.

Examples:

mass preview init $yourProjectSlug

mass preview init ecomm

mass preview init ecomm --output path/to/my/preview.json

Preview Environment Config Files

The preview.json file serves two purposes in your preview environment:

  1. describes which clouds and the authentication to use
  2. sets the input parameters for each of your packages
{
  "credentials": {
    // Using an AWS IAM Role
    "massdriver/aws-iam-role": "00000000-0000-0000-0000-000000000000"
  },
  "packageParams": {
    "database": {
      "cpus": "1",
      "memory": "over9000GB"
    },
    "my-api": {
      "image": "evilcorp/api:$IMAGE_TAG"
    }
  }
}

Deploy Preview Environment

Deploys a preview environment in your project.

Preview environments can be deployed arbitrarily from the command line or from pull requests and your CI/CD pipeline.

A configuration file with credential details and package parameters is required.

Example:

Deploy a project named "ecomm" specifying a CI context (ci-context.json) and a preview.json file from mass preview init.

mass preview init --output=./preview.json
mass preview deploy ecomm -c ./ci-context.json -p ./preview.json
CI Context Push Events

GitHub and GitLab workflow events are officially support, but any CI Context file can be provided so long as it follows the format:

{
  "pull_request": {
    "title": "Your title",
    "number": 1337
  }
}

title which will be used as the description of the environment and a "PR" number which is used in the environment's name and slug.

Deploy applications on Massdriver.

This application must be published as a bundle to Massdriver first and be configured for a given environment (target).

Examples

You can deploy an application using the fully qualified name of the application or its slug.

The slug can be found by hovering over the application name in the Massdriver diagram.

Using the fully qualified name:

mass app deploy ecomm-prod-api

Using the slug:

mass app deploy ecomm-prod-api-x12g

For more info see deploying.

Contributing

If you'd like to contribute to the Mass CLI, please refer to the Contribution Guidelines.

License

The Mass CLI is open source software licensed under the MIT license.