https://github.com/mnc/rails-console-ecs
Simple shell script for executing rails console in a ECS Task.
https://github.com/mnc/rails-console-ecs
Last synced: 9 months ago
JSON representation
Simple shell script for executing rails console in a ECS Task.
- Host: GitHub
- URL: https://github.com/mnc/rails-console-ecs
- Owner: mnc
- License: mit
- Created: 2018-07-25T02:28:41.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-03T03:23:30.000Z (almost 8 years ago)
- Last Synced: 2024-06-14T21:41:19.599Z (about 2 years ago)
- Language: Shell
- Homepage:
- Size: 5.86 KB
- Stars: 14
- Watchers: 1
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-ecs - Accessing Rails console inside of an ECS task
README
# 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
1. Run a Task using a latest Task Definition in a specific ECS Cluster
2. Get private IP by AWS CLI
3. Get docker container ID via SSH
4. Exec `rails c` command in the container via SSH
5. 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
- [aws-cli](https://github.com/aws/aws-cli)
- [jq](https://github.com/stedolan/jq)
### Install rails-console-ecs
#### Linux
```shell
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
```shell
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