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
fd2d44c2
Commit
fd2d44c2
authored
Jun 30, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
helper/config: copy buildname/buildtype properly
parent
8fd673ff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
helper/config/decode.go
helper/config/decode.go
+2
-0
template/interpolate/funcs.go
template/interpolate/funcs.go
+1
-1
No files found.
helper/config/decode.go
View file @
fd2d44c2
...
@@ -42,6 +42,8 @@ func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error {
...
@@ -42,6 +42,8 @@ func Decode(target interface{}, config *DecodeOpts, raws ...interface{}) error {
if
config
.
InterpolateContext
==
nil
{
if
config
.
InterpolateContext
==
nil
{
config
.
InterpolateContext
=
ctx
config
.
InterpolateContext
=
ctx
}
else
{
}
else
{
config
.
InterpolateContext
.
BuildName
=
ctx
.
BuildName
config
.
InterpolateContext
.
BuildType
=
ctx
.
BuildType
config
.
InterpolateContext
.
TemplatePath
=
ctx
.
TemplatePath
config
.
InterpolateContext
.
TemplatePath
=
ctx
.
TemplatePath
config
.
InterpolateContext
.
UserVariables
=
ctx
.
UserVariables
config
.
InterpolateContext
.
UserVariables
=
ctx
.
UserVariables
}
}
...
...
template/interpolate/funcs.go
View file @
fd2d44c2
...
@@ -71,7 +71,7 @@ func funcGenBuildName(ctx *Context) interface{} {
...
@@ -71,7 +71,7 @@ func funcGenBuildName(ctx *Context) interface{} {
func
funcGenBuildType
(
ctx
*
Context
)
interface
{}
{
func
funcGenBuildType
(
ctx
*
Context
)
interface
{}
{
return
func
()
(
string
,
error
)
{
return
func
()
(
string
,
error
)
{
if
ctx
==
nil
||
ctx
.
BuildType
==
""
{
if
ctx
==
nil
||
ctx
.
BuildType
==
""
{
return
""
,
errors
.
New
(
"build_
nam
e not available"
)
return
""
,
errors
.
New
(
"build_
typ
e not available"
)
}
}
return
ctx
.
BuildType
,
nil
return
ctx
.
BuildType
,
nil
...
...
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