Quick commands over
rancher-compose and Rancher API interface helping me in devops
Profile is a combination of API endpoint, environment, access keys with a symbolic name. Use
rancher profile [profile_name] for quick switching profiles
Every profile is stored in
~/.rancher file. CLI will search this file in a working directory and in the home one.
Compose files are separated with
Project is written in NodeJS, so you have to install NodeJS first.
npm -g i rancher-cli
Then create your first profile:
$ rancher init
I am using
rancher-cli container to process deploy operations to many environments from CI side. Every project has different
compose@[qa|staging|production|local].yml files in VCS.
.rancher file is mounted from a CI agent container.
.rancher file in a user home directory
Getting last 200 lines and follow.
rancher logs [regex] -l 200 -f
Start or stop multiple services using regexp to match stack/service
rancher stop/start [regex]
If service is not created - trigger launch, otherwise
upgrade command will be used.
List services and stacks in environment
Similar to my ssh2ec2 project. Will launch ssh to EC2 instance where service container is running and then be forwarded to the container.