@convertkit/cloudkit
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,1 +0,1 @@ | ||
{"version":"0.0.1","commands":{"console":{"id":"console","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@convertkit/cloudkit","pluginType":"core","aliases":[],"flags":{"name":{"name":"name","type":"option","char":"n","description":"name to print"}},"args":[]},"migrate":{"id":"migrate","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@convertkit/cloudkit","pluginType":"core","aliases":[],"flags":{"name":{"name":"name","type":"option","char":"n","description":"name to print"}},"args":[]}}} | ||
{"version":"0.0.2","commands":{"console":{"id":"console","description":"\nStarts a remote Rails console.\n","pluginName":"@convertkit/cloudkit","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"environment","default":"production"}]},"migrate":{"id":"migrate","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@convertkit/cloudkit","pluginType":"core","aliases":[],"flags":{"name":{"name":"name","type":"option","char":"n","description":"name to print"}},"args":[]}}} |
{ | ||
"name": "@convertkit/cloudkit", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"author": "Brendan Carney @brendancarney", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -22,3 +22,3 @@ @convertkit/cloudkit | ||
$ cloudkit (-v|--version|version) | ||
@convertkit/cloudkit/0.0.1 darwin-x64 node-v11.9.0 | ||
@convertkit/cloudkit/0.0.2 darwin-x64 node-v11.9.0 | ||
$ cloudkit --help [COMMAND] | ||
@@ -32,23 +32,19 @@ USAGE | ||
<!-- commands --> | ||
* [`cloudkit console`](#cloudkit-console) | ||
* [`cloudkit console [ENVIRONMENT]`](#cloudkit-console-environment) | ||
* [`cloudkit help [COMMAND]`](#cloudkit-help-command) | ||
* [`cloudkit migrate`](#cloudkit-migrate) | ||
## `cloudkit console` | ||
## `cloudkit console [ENVIRONMENT]` | ||
Describe the command here | ||
Starts a remote Rails console. | ||
``` | ||
USAGE | ||
$ cloudkit console | ||
$ cloudkit console [ENVIRONMENT] | ||
OPTIONS | ||
-n, --name=name name to print | ||
DESCRIPTION | ||
... | ||
Extra documentation goes here | ||
Starts a remote Rails console. | ||
``` | ||
_See code: [src/commands/console.js](https://github.com/brendancarney/cloudkit-cli/blob/v0.0.1/src/commands/console.js)_ | ||
_See code: [src/commands/console.js](https://github.com/brendancarney/cloudkit-cli/blob/v0.0.2/src/commands/console.js)_ | ||
@@ -88,3 +84,3 @@ ## `cloudkit help [COMMAND]` | ||
_See code: [src/commands/migrate.js](https://github.com/brendancarney/cloudkit-cli/blob/v0.0.1/src/commands/migrate.js)_ | ||
_See code: [src/commands/migrate.js](https://github.com/brendancarney/cloudkit-cli/blob/v0.0.2/src/commands/migrate.js)_ | ||
<!-- commandsstop --> |
const { Command, flags } = require("@oclif/command"); | ||
const { cli } = require("cli-ux"); | ||
async function getIP() { | ||
async function getIP(environment) { | ||
const deployHost = | ||
environment == "production" ? "production-deploy" : "staging-deploy"; | ||
const rs = shell.exec( | ||
"ssh production-deploy -t 'cd convertkit-deploy; ansible all --list #production;'", | ||
`ssh ${deployHost} -t 'cd convertkit-deploy; ansible all --list --limit tag_CodeDeployApp_convertkit'`, | ||
{ silent: true } | ||
@@ -18,5 +21,6 @@ ); | ||
async run() { | ||
const ip = await getIP(this.log); | ||
const { args } = this.parse(ConsoleCommand); | ||
const ip = await getIP(args.environment); | ||
cli.action.start("Getting console"); | ||
this.log(`Getting ${args.environment} console`); | ||
@@ -36,11 +40,13 @@ const shell = spawn( | ||
ConsoleCommand.description = `Describe the command here | ||
... | ||
Extra documentation goes here | ||
ConsoleCommand.description = ` | ||
Starts a remote Rails console. | ||
`; | ||
ConsoleCommand.flags = { | ||
name: flags.string({ char: "n", description: "name to print" }) | ||
}; | ||
ConsoleCommand.args = [ | ||
{ | ||
name: "environment", | ||
default: "production" | ||
} | ||
]; | ||
module.exports = ConsoleCommand; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6095
76
84