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
82735652
Commit
82735652
authored
May 22, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better comments for TODO
parent
fc0c1a72
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
builder/amazonebs/builder.go
builder/amazonebs/builder.go
+9
-1
packer/template.go
packer/template.go
+7
-1
No files found.
builder/amazonebs/builder.go
View file @
82735652
...
...
@@ -44,7 +44,15 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
log
.
Printf
(
"Config: %+v"
,
b
.
config
)
// TODO: Validate the configuration
// TODO: config validation and asking for fields:
// * access key
// * secret key
// * region
// * source ami
// * instance type
// * SSH username
// * SSH port? (or default to 22?)
return
}
...
...
packer/template.go
View file @
82735652
...
...
@@ -35,7 +35,10 @@ type rawBuilderConfig struct {
}
// ParseTemplate takes a byte slice and parses a Template from it, returning
// the template and possibly errors while loading the template.
// the template and possibly errors while loading the template. The error
// could potentially be a MultiError, representing multiple errors. Knowing
// and checking for this can be useful, if you wish to format it in a certain
// way.
func
ParseTemplate
(
data
[]
byte
)
(
t
*
Template
,
err
error
)
{
var
rawTpl
rawTemplate
err
=
json
.
Unmarshal
(
data
,
&
rawTpl
)
...
...
@@ -49,6 +52,8 @@ func ParseTemplate(data []byte) (t *Template, err error) {
t
.
Hooks
=
rawTpl
.
Hooks
errors
:=
make
([]
error
,
0
)
// Gather all the builders
for
i
,
v
:=
range
rawTpl
.
Builders
{
rawType
,
ok
:=
v
[
"type"
]
if
!
ok
{
...
...
@@ -86,6 +91,7 @@ func ParseTemplate(data []byte) (t *Template, err error) {
t
.
Builders
[
name
]
=
rawBuilderConfig
{
typeName
,
v
}
}
// If there were errors, we put it into a MultiError and return
if
len
(
errors
)
>
0
{
err
=
&
MultiError
{
errors
}
return
...
...
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