@sepior/sepport-cli

Cli for sepport

Usage no npm install needed!

<script type="module">
  import sepiorSepportCli from 'https://cdn.skypack.dev/@sepior/sepport-cli';
</script>

README

node-sepport-cli

Greenkeeper badge

Use this CLI for contacting Sepport.

Install

Install this CLI with NPM

npm install -g @sepior/sepport-cli

Usage

The CLI has the following commands

Logging in to Sepport

sepport login -u <user-id> -t <token>

this creates a configuration file in the current directory if success.

Create user

This command creates a password user on the cluste .

sepport create-user -u <username> -p <password> [-r <role>, ...]

this must be called from the same directory as the login and start command, because it uses the generated configuration file.

Add -r option for each role the user should have. If omitted a standard password user is created.

Cluster management

Start a cluster

sepport start
        [-o <sepport-host>]
        [-n <cluster-name>]
        [-s <servers-json>]
        [-a <tags-json>]
        [-m <vm-version>]
        [-e <expiration>]

this updates the configuration file in the current directory if successful.

Notice <servers-json> has the format


[
      { "type": "do", "modus_operandi": "keyserver" },
      { "type": "aws", "modus_operandi": "keyserver" },
      { "type": "do", "modus_operandi": "fuaproxy" }
]

where the default value is

[
      { "type": "do", "modus_operandi": "keyserver" },
      { "type": "do", "modus_operandi": "keyserver" },
      { "type": "do", "modus_operandi": "keyserver" }
]

Tags <tags-json> has the format


{"some-image": "image-tag"}

where the default value is

{}

Vm version <vm-version> is the version of the virtual machine and <expiration> is the time at which the cluster may be stopped by sepport. This can either be an integer value representing the number of milliseconds since 1 January 1970 00:00:00 UTC, with leap seconds ignored (Unix Epoch; but consider that most Unix time stamp functions count in seconds), or a string value representing a date. The string should be in a format recognized by the Date.parse() method (IETF-compliant RFC 2822 timestamps and also a version of ISO8601).

Claiming a cluster

This searches for a cluster with given tags or name. If such is found the cluster is returned and thus a new cluster is not started. If not, a new cluster is started.

sepport claim
        [-a <tags-json>]
        [-n <cluster-name>]

This will update the configuration file with the started cluster.

Stopping a cluster

This is done with

sepport stop

this must be called from the same directory as the login and start command, because it uses the generated configuration file.

This will not stop claimed clusters.

Build configuration

This command outputs a configuration to stdout

sepport build-config [-u <username>] [-r <role>] > small-config.json

this must be called from the same directory as the login and start command, because it uses the generated configuration file.

The outputted configuration has the following format


{
    "userId": "Some test user id",
    "password": "Some test user password",
    "keyServerUris": [ "https://host1", "https://host2", "https://host3" ],
    "applicationId": "Some application id"
}

Development

Node version 6 is required. Install using:

nvm use 6

Setup dependencies using npm:

npm install

Install the CLI locally using:

npm link

Release

To release version x.y.z:

  1. Update CHANGELOG.md and project.json.
  2. Make sure the above commits are merged to master.
  3. Pull master and check out the above commit.
  4. Tag this commit git tag -a x.y.z -m "Release x.y.z"
  5. Push tag with: git push --tags