forked from Ivasoft/drone-docker
HACK always as a plugin
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -287,6 +287,7 @@ func main() {
|
||||
cli.StringFlag{
|
||||
Name: "plugin-config",
|
||||
Usage: "path to the plugin config.json. Defaults to config.json",
|
||||
Value: "config.json",
|
||||
EnvVar: "PLUGIN_PLUGIN_CONFIG",
|
||||
},
|
||||
}
|
||||
@@ -334,7 +335,7 @@ func run(c *cli.Context) error {
|
||||
Quiet: c.Bool("quiet"),
|
||||
Platform: c.String("platform"),
|
||||
SSHAgentKey: c.String("ssh-agent-key"),
|
||||
IsPlugin: c.Bool("is-plugin"),
|
||||
IsPlugin: true, //c.Bool("is-plugin"),
|
||||
PluginConfig: c.String("plugin-config"),
|
||||
},
|
||||
Daemon: docker.Daemon{
|
||||
|
||||
@@ -199,11 +199,7 @@ func (p Plugin) Exec() error {
|
||||
cmds = append(cmds, exec.Command(dockerExe, "save", "-o", "tmp.tar", p.Build.Name))
|
||||
cmds = append(cmds, exec.Command(dockerExe, "image", "rm", p.Build.Name))
|
||||
cmds = append(cmds, exec.Command("tar", "x", "-C", "plugin/rootfs", "-f", "tmp.tar"))
|
||||
var pluginConfig string = p.Build.PluginConfig
|
||||
if len(pluginConfig) == 0 {
|
||||
pluginConfig = "config.json"
|
||||
}
|
||||
cmds = append(cmds, exec.Command("cp", pluginConfig, "plugin/config.json"))
|
||||
cmds = append(cmds, exec.Command("cp", p.Build.PluginConfig, "plugin/config.json"))
|
||||
cmds = append(cmds, exec.Command(dockerExe, "plugin", "create", p.Build.Repo, "plugin"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user