feat: add compose exec and compose bash commands

Exec is new command scoped under compose. It allows sending commands
directly into appserver container. I will make this
customizable/controllable in the future.
This commit is contained in:
2023-06-15 19:57:02 +02:00
parent 7bf76d3ff2
commit b45cfd3e0a
5 changed files with 29 additions and 1 deletions

View File

@@ -11,6 +11,13 @@ pub fn down() -> Result<()> {
CommandBuilder::docker_compose().args("down").exec()
}
pub fn exec(rest: &[String]) -> Result<()> {
CommandBuilder::docker_compose()
.args("exec appserver")
.args(rest)
.exec()
}
/// Start containers via `docker compose start`. Optionally pass containers to be started.
/// ```
/// start(None);
@@ -31,6 +38,10 @@ pub fn up() -> Result<()> {
}
// shortcuts
pub fn bash() -> Result<()> {
exec(&["bash".to_string()])
}
pub fn rebuild() -> Result<()> {
stop()?;
build()?;