terra-ops / terra-cli

The Terra Command Line Interface
http://terra.readthedocs.org
GNU General Public License v2.0
48 stars 17 forks source link

Remove necessity of SSH #98

Closed frankcarey closed 8 years ago

frankcarey commented 8 years ago

SSHd is kind of a messy thing that most of the docker community has been adamant about almost always being unnecessary, and now docker makes it easy to enter a container using docker-compose run [name] bash

That said, SSH is required to run drush commands using drush remote aliases, which terra creates for you when you add a terra environment.

We could use the "drude/dsh" methodology of having something like terra drush some-drush-command, which effectively runs drush the "docker-y" way using docker-compose run [name] drush some-drush-command under the hood.

Example reading: https://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/

frankcarey commented 8 years ago

OK, I've got something working actually - you can now run ANY command within the containers without having to ssh into them. So far, you "simply" call terra run <app> <environment> <service> <commands> you can also get a shell within the container with terra run <app> <environment><service> bash and run a series of commands more simply.

Here's a quick demo of that, let me know what you all think. I'll get a PR up shortly.

screen shot 2015-09-19 at 2 31 32 am
frankcarey commented 8 years ago

And while we're at it, let's create a terra drush command. Normally you don't need the quotes, but if the drush command has a flag then you need to wrap the whole command with quotes so symfony console doesn't get confused and think the flags were for terra. Looks like another alternative is to use a double dash to separate them.. terra drush <app> <env> -- wd-show --count=1

screen shot 2015-09-19 at 3 21 30 am
frankcarey commented 8 years ago

Pull Request: https://github.com/terra-ops/terra-cli/issues/100