Fix commands.
Add username to config struct, if present execute `sudo -E -u username` in command
This commit is contained in:
@ -7,7 +7,8 @@ import (
|
||||
)
|
||||
|
||||
var CmdComposeBuild = cli.Command{
|
||||
Name: "pull",
|
||||
Name: "build",
|
||||
Aliases: []string{"b"},
|
||||
Usage: "build docker image",
|
||||
Description: `Build all docker images`,
|
||||
Action: RunComposeBuild,
|
||||
|
@ -8,14 +8,19 @@ import (
|
||||
|
||||
var CmdComposeRun = cli.Command{
|
||||
Name: "run",
|
||||
Aliases: []string{"r"},
|
||||
Usage: "run cmd in main container",
|
||||
Description: `Run command in main container`,
|
||||
ArgsUsage: "[<cmd>]",
|
||||
Action: RunComposeRun,
|
||||
}
|
||||
|
||||
func RunComposeRun(cmd *cli.Context) error {
|
||||
ctx := context.InitCommand(cmd)
|
||||
compose.ExecComposerRun(ctx)
|
||||
if cmd.Args().Len() >= 1 {
|
||||
compose.ExecComposerRun(ctx, cmd.Args())
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@ import (
|
||||
|
||||
var CmdComposeShell = cli.Command{
|
||||
Name: "shell",
|
||||
Aliases: []string{"sh"},
|
||||
Usage: "run shell from main service",
|
||||
Description: `Execute shell cmd in main service`,
|
||||
Action: RunComposeShell,
|
||||
|
@ -10,7 +10,7 @@ var CmdComposeStop = cli.Command{
|
||||
Name: "stop",
|
||||
Usage: "stop containers",
|
||||
Description: `Stop all containers defined in docker-compose stack mode`,
|
||||
Action: RunComposePull,
|
||||
Action: RunComposeStop,
|
||||
}
|
||||
|
||||
func RunComposeStop(cmd *cli.Context) error {
|
||||
|
Reference in New Issue
Block a user