portainer-devtool/go/repositories/agent/build_docker_image.go

34 lines
675 B
Go
Raw Permalink Normal View History

package agent
import (
"ocl/portainer-devtool/configs"
"ocl/portainer-devtool/tasks/common"
"ocl/portainer-devtool/utils"
)
type BuildDockerImageSubTask struct {
common.GeneralTask
}
func NewBuildDockerImageSubTask(cfg *configs.Config) *BuildDockerImageSubTask {
return &BuildDockerImageSubTask{
GeneralTask: *common.NewGeneralTask(cfg),
}
}
func (task *BuildDockerImageSubTask) Execute() error {
utils.SuccessPrint(`
./dev.sh compile
./dev.sh build
----
./dev.sh compile
docker build -t "portainerci/agent:oscar-alpine" -f build/linux/alpine.Dockerfile .
`)
return nil
}
func (task *BuildDockerImageSubTask) String() string {
return "Build Docker Image"
}