The Mass CLI is a command line tool to manage applications and infrastructure on Massdriver Cloud.
Official GitHub actions are also available.
Pre-built binaries for the Mass CLI are available in the Releases section of this repository.
brew install massdriver
go install github.com/massdriver-cloud/mass
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.
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
The preview.json
file serves two purposes in your preview environment:
- describes which clouds and the authentication to use
- 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"
}
}
}
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
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
.
This application must be published as a bundle to Massdriver first and be configured for a given environment (target).
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.
If you'd like to contribute to the Mass CLI, please refer to the Contribution Guidelines.
The Mass CLI is open source software licensed under the MIT license.