32 lines
627 B
Go
32 lines
627 B
Go
|
package agent
|
||
|
|
||
|
import (
|
||
|
"ocl/portainer-devtool/configs"
|
||
|
"ocl/portainer-devtool/tasks/common"
|
||
|
)
|
||
|
|
||
|
type MenuSubTask struct {
|
||
|
common.GeneralTask
|
||
|
}
|
||
|
|
||
|
func NewMenuSubTask(cfg *configs.Config) *MenuSubTask {
|
||
|
return &MenuSubTask{
|
||
|
GeneralTask: *common.NewGeneralTask(cfg),
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func (task *MenuSubTask) Execute() error {
|
||
|
subTaskItems := []common.Tasker{
|
||
|
NewBuildDockerImageSubTask(task.Config),
|
||
|
NewPushImageSubTask(task.Config),
|
||
|
}
|
||
|
|
||
|
common.ListCommandMenu(subTaskItems, "Which management commands do you want to choose:", false, task.ParentTasks)
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (task *MenuSubTask) String() string {
|
||
|
return "agent"
|
||
|
}
|