Provides a simple orchestration of a Ruby on Rails deployment on macOS.
I want to have a standarized simple way to manage infrastructure for Ruby on Rails apps.
Run this in your terminal:
sh <(curl -s https://raw.githubusercontent.com/chi-rb/chi-cloud/master/bin/cloud) install
ALL COMMANDS ARE DESIGNED TO BE EXECUTED FROM THE ROOT FOLDER OF THE RAILS APP.
cloud container deploy
cloud container log rails
cloud open
You can choose to remember this value for all command during a session:
export CLOUD_KEY=secret
export CLOUD_CONTEXT=remote
Or prefix each command individually:
CLOUD_KEY=secret CLOUD_CONTEXT=remote cloud ...
cloud image build
cloud image push
cloud container delete rails
cloud container deploy rails
Export again:
export CLOUD_CONTEXT=local
Or prefix new commands with it:
CLOUD_CONTEXT=local cloud ...
You can list all containers of the app with their status using:
cloud container
To protect a secret inside environments you can:
CLOUD_KEY=secret cloud encrypt "value"
To get back original value from the ENC(...) string:
CLOUD_KEY=secret cloud decrypt "ENC(...)"
To control the status of the server:
cloud server start/stop/restart
To control the status of one container:
cloud container start/stop/restart rails
You need to attach your terminal to the screen session of the main process of the Rails container.
SINCE IS A SCREEN SESSION, TO DON'T EXIT AND DON'T KILL THE PROCESS YOU NEED TO PRESS CTRL+A D
cloud container attach rails
To SSH into the server:
cloud server shell
To SSH into one of the containers
cloud container shell rails
Pass the name of the container and port to the "tunnel" cmd:
cloud tunnel start mysql 3306
This gem is funded and maintained by mmontossi.
With the sponsorship of:
It is free software, and may be redistributed under the terms specified in the LICENSE file.