Awesome
rails-console-ecs
This is simple shell script for executing rails console in a ECS Task.
You can exec rails c
command from outside of ECS Cluster by executing only one command.
How it works
- Run a Task using a latest Task Definition in a specific ECS Cluster
- Get private IP by AWS CLI
- Get docker container ID via SSH
- Exec
rails c
command in the container via SSH - Stop the Task
Usage
Usage:
rails-console-ecs [options]
Options:
-v Version
-h Show help of this command
-c Ecs cluster which a task runs in. use RAILS_C_ECS_CLUSTER by default
-d Ecs task definition. use RAILS_C_TASK_DEFINITION by default
-e Rails env. use RAILS_C_ENV by default
-r Region. use RAILS_C_REGION by default
Installation
Requirement
Install rails-console-ecs
Linux
curl https://raw.githubusercontent.com/mnc/rails-console-ecs/master/rails-console-ecs | sudo tee /usr/bin/rails-console-ecs
sudo chmod +x /usr/bin/rails-console-ecs
Mac
curl https://raw.githubusercontent.com/mnc/rails-console-ecs/master/rails-console-ecs | sudo tee /usr/local/bin/rails-console-ecs
sudo chmod +x /usr/local/bin/rails-console-ecs
LICENSE
MIT