2017 © Pedro Peláez
 

project naut-cli

CLI client for SilverStripe deploynaut

image

guttmann/naut-cli

CLI client for SilverStripe deploynaut

  • Wednesday, November 29, 2017
  • by guttmann
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 0 % Grown

The README.md

naut-cli

A cli client for SilverStripe's deploynaut., (*1)

Install

Download the latest phar from the releases section of this repo and put it somewhere on your $PATH., (*2)

Or you can clone this repository and build the phar yourself by following the instructions in the Build section below., (*3)

Configuration

naut-cli can be configured in two ways., (*4)

  1. By creating a .naut.env file in the users home directory (generated with the naut-cli configure command)
  2. By setting the required environment variables before running any naut-cli commands

Required environment variables

If you are not going to use a .naut.env file in your home directory, these environment variables must be set:, (*5)

  • NAUT_URL: the URL of the deploynaut instances
  • NAUT_USERNAME: your deploynaut username
  • NAUT_TOKEN: your deploynaut API token

Usage

There are a few different commands that can be run., (*6)

Configure

naut-cli can be configured by placing a .naut.env file in your home directory., (*7)

You can create this file interactively by running:, (*8)

php naut-cli.phar configure

This will ask you for:, (*9)

  • The domain of deploynaut (e.g. https://deploy.test.com)
  • Your username (e.g. test@test.com)
  • Your deploynaut API token

And create a new file at ~/.naut.env that is only readable by the current user., (*10)

Deploy

Deploy the latest commit of a project to a specific environment with deploy:, (*11)

php naut-cli.phar deploy <project_id> <environment> <branch_name>

Where:, (*12)

  • <project_id> is the short text identifier of the project in deploynaut (also seen in the deploynaut URL at /naut/project/<project_id>)
  • <environment> is the name of the environment you want to deploy to (e.g. 'prod', 'uat', 'test1')
  • <branch_name> is the name of the git branch you would like to deploy

A few things will happen when you run this command:, (*13)

  1. Fetch latest changes from git
  2. Trigger deployment
  3. Stream the deployment log back to your terminal

Snapshots

List

You can see a list of snapshots for a specific stack with the command:, (*14)

php naut-cli.phar snapshot:list <stack_id>

This will display a table containing columns for: the snapshot id, source environment, mode, size, and created date/time., (*15)

Delete

You can delete a snapshot with the command:, (*16)

php naut-cli.phar snapshot:delete <stack_id> <snapshot_id>

Create

You can create a new snapshot for a specific stack/environment with the command:, (*17)

php naut-cli.phar snapshot:create <stack_id> <snapshot_id>

Optionally, you can include the --mode flag. This flag sets the type of snapshot to create., (*18)

Valid options are:, (*19)

  • all
  • db
  • assets

The default if the --mode flag is missing is all. Example usage: --mode=assets., (*20)

Download

You can download a snapshot with the command:, (*21)

php naut-cli.phar snapshot:download <stack_id> <snapshot_id>

By default, this command will save the snapshot to the current directory with the same name as it exists within the dashboard. It will also display a progress bar while downloading by default., (*22)

If you would like to save to a different location/filename then you can use he --to-stdout option, and run the command like:, (*23)

php naut-cli.phar snapshot:download <stack_id> <snapshot_id> --to-stdout > /path/to/your/file.sspak

When downloading this way the progress bar is not displayed., (*24)

Build phar from source

To build the naut-cli.phar file from source run the script bin/build-phar.sh., (*25)

This will create a fresh copy of the phar at dist/naut-cli.phar., (*26)

To do

  • Implement more of the deploynaut API

The Versions

29/11 2017

dev-master

9999999-dev

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

29/11 2017

2.2.1

2.2.1.0

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

29/11 2017

dev-sink-fix

dev-sink-fix

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

28/11 2017

2.2.0

2.2.0.0

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

28/11 2017

dev-download-command

dev-download-command

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

06/11 2017

2.1.0

2.1.0.0

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

26/10 2017

dev-guttmann-patch-1

dev-guttmann-patch-1

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires

07/07 2017

2.0.0

2.0.0.0

CLI client for SilverStripe deploynaut

  Sources   Download

MIT

The Requires

 

The Development Requires