Amazon builder
This commit is contained in:
parent
41f77eb38f
commit
817822abab
|
@ -1 +1,2 @@
|
||||||
/bin
|
/bin
|
||||||
|
/packer
|
||||||
|
|
4
Makefile
4
Makefile
|
@ -1,6 +1,6 @@
|
||||||
all:
|
all:
|
||||||
@mkdir -p bin/
|
@mkdir -p bin/
|
||||||
go get
|
go get -a
|
||||||
go build -o bin/packer
|
go build -a -o bin/packer
|
||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
package amazon
|
||||||
|
|
||||||
|
type config struct {
|
||||||
|
AccessKey string
|
||||||
|
Region string
|
||||||
|
SecretKey string
|
||||||
|
SourceAmi string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Builder struct {
|
||||||
|
config config
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Builder) Prepare() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Builder) Build() {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*Builder) Destroy() {
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
name = "my-custom-image"
|
||||||
|
|
||||||
|
[builder.amazon-ebs]
|
||||||
|
region = "us-east-1"
|
||||||
|
source = "ami-de0d9eb7"
|
||||||
|
|
||||||
|
[provision]
|
||||||
|
|
||||||
|
[provision.shell]
|
||||||
|
type = "shell"
|
||||||
|
path = "script.sh"
|
||||||
|
|
||||||
|
[output]
|
||||||
|
|
||||||
|
[output.vagrant]
|
25
packer.go
25
packer.go
|
@ -1,6 +1,8 @@
|
||||||
// This is the main package for the `packer` application.
|
// This is the main package for the `packer` application.
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
import "github.com/mitchellh/packer/builder/amazon"
|
||||||
|
|
||||||
// A command is a runnable sub-command of the `packer` application.
|
// A command is a runnable sub-command of the `packer` application.
|
||||||
// When `packer` is called with the proper subcommand, this will be
|
// When `packer` is called with the proper subcommand, this will be
|
||||||
// called.
|
// called.
|
||||||
|
@ -22,10 +24,21 @@ type Environment struct {
|
||||||
commands map[string]Command
|
commands map[string]Command
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
type Template struct {
|
||||||
env := Environment {
|
Name string
|
||||||
commands: map[string]Command {
|
Builders map[string]interface{} `toml:"builder"`
|
||||||
""
|
Provisioners map[string]interface{} `toml:"provision"`
|
||||||
},
|
Outputs map[string]interface{} `toml:"output"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Builder interface {
|
||||||
|
Prepare()
|
||||||
|
Build()
|
||||||
|
Destroy()
|
||||||
|
}
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
var builder Builder
|
||||||
|
builder = &amazon.Builder{}
|
||||||
|
builder.Build()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue