https://github.com/massdriver-cloud/mass
Massdriver CLI
https://github.com/massdriver-cloud/mass
Last synced: 2 months ago
JSON representation
Massdriver CLI
- Host: GitHub
- URL: https://github.com/massdriver-cloud/mass
- Owner: massdriver-cloud
- License: apache-2.0
- Created: 2022-11-23T18:10:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T02:50:07.000Z (7 months ago)
- Last Synced: 2025-03-29T15:07:35.541Z (3 months ago)
- Language: Go
- Homepage: https://massdriver.cloud
- Size: 913 KB
- Stars: 108
- Watchers: 7
- Forks: 13
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Mass CLI
[](https://github.com/massdriver-cloud/mass/blob/main/LICENSE)
[](https://github.com/massdriver-cloud/mass/issues)
[](https://GitHub.com/massdriver-cloud/mass/releases/)
[](https://goreportcard.com/report/github.com/massdriver-cloud/mass)
[](https://pkg.go.dev/github.commassdriver-cloud/mass)The Mass CLI is a command line tool to manage applications and infrastructure on [Massdriver Cloud](https://massdriver.cloud).
Official [GitHub actions](https://github.com/massdriver-cloud/actions) are also available.
## Installation
### Pre-built Binaries
Pre-built binaries for the Mass CLI are available in the [Releases](https://github.com/massdriver-cloud/mass/releases) section of this repository.
### Homebrew
```sh
brew install massdriver
```### Go
```sh
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](https://docs.massdriver.cloud/cli/overview).
### 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```js
{
"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`.
```shell
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:
```json
{
"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`.
* [GitHub](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push)
* [GitLab](https://docs.gitlab.com/ee/user/project/integrations/webhook_events.html#push-events)### Deploy applications on Massdriver.
This application must be published as a [bundle](https://docs.massdriver.cloud/applications) 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**:
```shell
mass app deploy ecomm-prod-api
```**Using the slug**:
```shell
mass app deploy ecomm-prod-api-x12g
```For more info see [deploying](https://docs.massdriver.cloud/applications/deploying-application).
## Contributing
If you'd like to contribute to the Mass CLI, please refer to the [Contribution Guidelines](https://github.com/massdriver-cloud/mass/blob/main/CONTRIBUTING.md).
## License
The Mass CLI is open source software licensed under the [MIT license](https://github.com/massdriver-cloud/mass/blob/main/LICENSE).