Closed frankcarey closed 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.
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
Pull Request: https://github.com/terra-ops/terra-cli/issues/100
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 usingdocker-compose run [name] drush some-drush-command
under the hood.Example reading: https://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/