Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
980841b6
Commit
980841b6
authored
Jul 15, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/instance: boilerplate
parent
7472bbb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
0 deletions
+52
-0
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+37
-0
builder/amazon/instance/builder_test.go
builder/amazon/instance/builder_test.go
+15
-0
No files found.
builder/amazon/instance/builder.go
0 → 100644
View file @
980841b6
// The instance package contains a packer.Builder implementation that builds
// AMIs for Amazon EC2 backed by instance storage, as opposed to EBS storage.
package
instance
import
(
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"log"
)
// The unique ID for this builder
const
BuilderId
=
"mitchellh.amazon.instance"
// Config is the configuration that is chained through the steps and
// settable from the template.
type
Config
struct
{
}
type
Builder
struct
{
config
Config
runner
multistep
.
Runner
}
func
(
b
*
Builder
)
Prepare
(
raws
...
interface
{})
error
{
return
nil
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
,
cache
packer
.
Cache
)
(
packer
.
Artifact
,
error
)
{
return
nil
,
nil
}
func
(
b
*
Builder
)
Cancel
()
{
if
b
.
runner
!=
nil
{
log
.
Println
(
"Cancelling the step runner..."
)
b
.
runner
.
Cancel
()
}
}
builder/amazon/instance/builder_test.go
0 → 100644
View file @
980841b6
package
instance
import
(
"github.com/mitchellh/packer/packer"
"testing"
)
func
TestBuilder_ImplementsBuilder
(
t
*
testing
.
T
)
{
var
raw
interface
{}
raw
=
&
Builder
{}
if
_
,
ok
:=
raw
.
(
packer
.
Builder
);
!
ok
{
t
.
Fatalf
(
"Builder should be a builder"
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment