Build two independent plugins

This commit is contained in:
Michael Kuzmin 2018-01-24 21:01:04 +03:00
parent df40ffbe8d
commit 230bfa774c
5 changed files with 25 additions and 12 deletions

3
.gitignore vendored
View File

@ -1,8 +1,7 @@
.idea/
.glide/
vendor/
packer-builder-vsphere
packer-builder-vsphere.exe
packer-builder-vsphere*
bin/
test*.json
crash.log

View File

@ -2,16 +2,16 @@
set -eux
glide install -v
# glide install -v
export CGO_ENABLED=0
export GOARCH=amd64
mkdir -p bin
rm -f bin/*
GOOS=darwin go build -o bin/packer-builder-vsphere-clone.macos ./clone
GOOS=linux go build -o bin/packer-builder-vsphere-clone.linux ./clone
GOOS=windows go build -o bin/packer-builder-vsphere-clone.exe ./clone
GOOS=darwin go build -o bin/packer-builder-vsphere.macos ./cmd/clone
GOOS=linux go build -o bin/packer-builder-vsphere.linux ./cmd/clone
GOOS=windows go build -o bin/packer-builder-vsphere.exe ./cmd/clone
GOOS=darwin go build -o bin/packer-builder-vsphere-iso.macos ./iso
GOOS=linux go build -o bin/packer-builder-vsphere-iso.linux ./iso
GOOS=windows go build -o bin/packer-builder-vsphere-iso.exe ./iso
GOOS=darwin go build -o bin/packer-builder-vsphere-iso.macos ./cmd/iso
GOOS=linux go build -o bin/packer-builder-vsphere-iso.linux ./cmd/iso
GOOS=windows go build -o bin/packer-builder-vsphere-iso.exe ./cmd/iso

13
cmd/clone/main.go Normal file
View File

@ -0,0 +1,13 @@
package main
import "github.com/hashicorp/packer/packer/plugin"
import "github.com/jetbrains-infra/packer-builder-vsphere/clone"
func main() {
server, err := plugin.Server()
if err != nil {
panic(err)
}
server.RegisterBuilder(new(clone.Builder))
server.Serve()
}

View File

@ -1,12 +1,13 @@
package clone
package main
import "github.com/hashicorp/packer/packer/plugin"
import "github.com/jetbrains-infra/packer-builder-vsphere/iso"
func main() {
server, err := plugin.Server()
if err != nil {
panic(err)
}
server.RegisterBuilder(new(Builder))
server.RegisterBuilder(new(iso.Builder))
server.Serve()
}

View File

@ -1,5 +1,5 @@
build:
image: jetbrainsinfra/golang:1.8.3
image: jetbrainsinfra/golang:1.9.2
volumes:
- .:/go/src/github.com/jetbrains-infra/packer-builder-vsphere
working_dir: /go/src/github.com/jetbrains-infra/packer-builder-vsphere