README.md in contexto-0.3.1 vs README.md in contexto-0.4.0
- old
+ new
@@ -10,114 +10,63 @@
$ gem install contexto
```
## Usage
-Run the binary to check on the status of a cluster or service.
+Run the binary to connect to a container in a specific cluster and
+service.
-### Cluster
-
```shell
-$ contexto -c sandbox
+$ contexto
- ** Contexto Contextualizes **
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
+ ** Contexto Contextualizes **
-Cluster sandbox
+Clusters :
+1. production
+2. sandbox
+3. nah
+Please choose a cluster? 1
-┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
-┃ Name ┃ Status ┃ Instances ┃ Services ┃ RunningTasks ┃ PendingTasks ┃
-┣━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━┫
-┃ sandbox ┃ ACTIVE ┃ 4 ┃ 3 ┃ 3 ┃ 0 ┃
-┗━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛
-```
+Services :
+1. backend-app
+2. starter-site
+3. backend-authn
+4. logspout
+5. wombat
+6. nah
+Please choose a service? 1
-### Service
-
-```shell
-$ contexto -c sandbox -s backend-app
-
- ** Contexto Contextualizes **
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Cluster sandbox
-
-┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
-┃ Name ┃ Status ┃ Instances ┃ Services ┃ RunningTasks ┃ PendingTasks ┃
-┣━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━┫
-┃ sandbox ┃ ACTIVE ┃ 4 ┃ 3 ┃ 3 ┃ 0 ┃
-┗━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛
-
-Service backend-app
-
-┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
-┃ Name ┃ Status ┃ Desired ┃ Running ┃ Pending ┃
-┣━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━┫
-┃ backend-app ┃ ACTIVE ┃ 1 ┃ 1 ┃ 0 ┃
-┗━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛
-
Containers
+┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
+┃ Container ┃ Status ┃ IP ┃
+┣━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━┫
+┃ sidekiq ┃ RUNNING ┃ 10.1.2.25 ┃
+┣━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━━┫
+┃ app ┃ RUNNING ┃ 10.1.2.25 ┃
+┗━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━┛
-┏━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┓
-┃ Container ┃ Status ┃ IP ┃
-┣━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━┫
-┃ sidekiq ┃ RUNNING ┃ 10.2.1.218 ┃
-┣━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━╊━━━━━━━━━━━━━━┫
-┃ app ┃ RUNNING ┃ 10.2.1.218 ┃
-┗━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━┛
-```
+Containers :
+1. sidekiq
+2. app
+3. nah
+Please choose a container? 1
-### SSH
-
-You can also get Contexto to connect via SSH to a Bash shell, or a Rails console.
-
-#### Bash shell on container
-
-To connect to a Bash shell in a specific container, specify the cluster, service and container and the `--type` flag.
-
-```shell
-$ contexto -c sandbox -s backend-app -v app -t=bash
-
- ** Contexto Contextualizes **
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-circleci@4e65666c9414:/usr/src/app$
+Do you want to connect to container sidekiq? :
+1. console
+2. bash
+3. ssh
+4. nah
+Please choose a connection type?
```
-#### Rails console
+You can get Contexto to connect via SSH to a Bash shell, or a Rails console.
-To connect to a Rails console, specify the cluster, service and container and the `--type` flag.
+You can also specify a cluster and service to take a shortcut to a
+specific set of containers.
-```shell
-$ contexto -c sandbox -s backend-app -v app --type=console
-
- ** Contexto Contextualizes **
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-I, [2017-03-28T22:36:35.555604 #181] INFO -- sentry: ** [Raven] Raven 2.4.0 ready to catch errors
-Loading sandbox environment (Rails 5.0.1)
-irb(main):001:0>
-```
-
-#### Shell on Docker host
-
-You can get an SSH shell on the Docker host too using the `--type` task.
-
-```shell
-$ contexto -c sandbox -s backend-app -v sidekiq --t=ssh
-
- ** Contexto Contextualizes **
-━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
-
-Last login: Sat Apr 1 18:58:38 2017 from ip-172-31-12-234.ec2.internal
-
- __| __| __|
- _| ( \__ \ Amazon ECS-Optimized Amazon Linux AMI 2016.09.f
- ____|\___|____/
-
-For documentation visit, http://aws.amazon.com/documentation/ecs
-9 package(s) needed for security, out of 19 available
-Run "sudo yum update" to apply all updates.
-[ec2-user@ip-10-2-1-221 ~]$
+```bash
+$ contexto -c production -s backend-app
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.