File: main.go

package info (click to toggle)
packer 0.10.2%2Bdfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,728 kB
  • ctags: 4,626
  • sloc: sh: 321; makefile: 73
file content (36 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// This is an example plugin. In packer 0.9.0 and up, core plugins are compiled
// into the main binary so these files are no longer necessary for the packer
// project.
//
// However, it is still possible to create a third-party plugin for packer that
// is distributed independently from the packer distribution. These continue to
// work in the same way. They will be loaded from the same directory as packer
// by looking for packer-[builder|provisioner|post-processor]-plugin-name. For
// example:
//
//    packer-builder-docker
//
// Look at command/plugin.go to see how the core plugins are loaded now, but the
// format below was used for packer <= 0.8.6 and is forward-compatible.
package main

import (
	"github.com/mitchellh/packer/builder/amazon/chroot"
	"github.com/mitchellh/packer/packer/plugin"
	"github.com/mitchellh/packer/post-processor/docker-push"
	"github.com/mitchellh/packer/provisioner/powershell"
)

func main() {
	server, err := plugin.Server()
	if err != nil {
		panic(err)
	}
	// Choose the appropriate type of plugin. You should only use one of these
	// at a time, which means you will have a separate plugin for each builder,
	// provisioner, or post-processor.
	server.RegisterBuilder(new(chroot.Builder))
	server.RegisterPostProcessor(new(dockerpush.PostProcessor))
	server.RegisterProvisioner(new(powershell.Provisioner))
	server.Serve()
}