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
107e47fe
Commit
107e47fe
authored
Dec 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update commands to new user var syntax
parent
43962ca3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
command/build/command.go
command/build/command.go
+2
-2
command/inspect/command.go
command/inspect/command.go
+1
-1
command/validate/command.go
command/validate/command.go
+2
-2
common/command/template_test.go
common/command/template_test.go
+1
-1
No files found.
command/build/command.go
View file @
107e47fe
...
...
@@ -57,7 +57,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Read the file into a byte array so that we can parse the template
log
.
Printf
(
"Reading template: %s"
,
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
]
,
userVars
)
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to parse template: %s"
,
err
))
return
1
...
...
@@ -114,7 +114,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
b
.
SetDebug
(
cfgDebug
)
b
.
SetForce
(
cfgForce
)
warnings
,
err
:=
b
.
Prepare
(
userVars
)
warnings
,
err
:=
b
.
Prepare
()
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
err
.
Error
())
return
1
...
...
command/inspect/command.go
View file @
107e47fe
...
...
@@ -34,7 +34,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Read the file into a byte array so that we can parse the template
log
.
Printf
(
"Reading template: %#v"
,
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
]
,
nil
)
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to parse template: %s"
,
err
))
return
1
...
...
command/validate/command.go
View file @
107e47fe
...
...
@@ -50,7 +50,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Parse the template into a machine-usable format
log
.
Printf
(
"Reading template: %s"
,
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
])
tpl
,
err
:=
packer
.
ParseTemplateFile
(
args
[
0
]
,
userVars
)
if
err
!=
nil
{
env
.
Ui
()
.
Error
(
fmt
.
Sprintf
(
"Failed to parse template: %s"
,
err
))
return
1
...
...
@@ -82,7 +82,7 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Check the configuration of all builds
for
_
,
b
:=
range
builds
{
log
.
Printf
(
"Preparing build: %s"
,
b
.
Name
())
warns
,
err
:=
b
.
Prepare
(
userVars
)
warns
,
err
:=
b
.
Prepare
()
if
len
(
warns
)
>
0
{
warnings
[
b
.
Name
()]
=
warns
}
...
...
common/command/template_test.go
View file @
107e47fe
...
...
@@ -17,7 +17,7 @@ func testTemplate() (*packer.Template, *packer.ComponentFinder) {
]
}`
tpl
,
err
:=
packer
.
ParseTemplate
([]
byte
(
tplData
))
tpl
,
err
:=
packer
.
ParseTemplate
([]
byte
(
tplData
)
,
nil
)
if
err
!=
nil
{
panic
(
err
)
}
...
...
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