2023-01-09 10:05:32 +11:00
|
|
|
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
|
2023-01-13 12:08:59 +11:00
|
|
|
----
|
|
|
|
./dev.sh compile
|
|
|
|
docker build -t "portainerci/agent:oscar-alpine" -f build/linux/alpine.Dockerfile .
|
2023-01-09 10:05:32 +11:00
|
|
|
`)
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (task *BuildDockerImageSubTask) String() string {
|
|
|
|
return "Build Docker Image"
|
|
|
|
}
|