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
43fbd26d
Commit
43fbd26d
authored
May 21, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
template: copy some description and min vesrion
parent
839784b0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
0 deletions
+26
-0
template/parse.go
template/parse.go
+4
-0
template/parse_test.go
template/parse_test.go
+16
-0
template/test-fixtures/parse-description.json
template/test-fixtures/parse-description.json
+3
-0
template/test-fixtures/parse-min-version.json
template/test-fixtures/parse-min-version.json
+3
-0
No files found.
template/parse.go
View file @
43fbd26d
...
...
@@ -30,6 +30,10 @@ func (r *rawTemplate) Template() (*Template, error) {
var
result
Template
var
errs
error
// Copy some literals
result
.
Description
=
r
.
Description
result
.
MinVersion
=
r
.
MinVersion
// Gather the variables
if
len
(
r
.
Variables
)
>
0
{
result
.
Variables
=
make
(
map
[
string
]
*
Variable
,
len
(
r
.
Variables
))
...
...
template/parse_test.go
View file @
43fbd26d
...
...
@@ -243,6 +243,22 @@ func TestParse(t *testing.T) {
nil
,
true
,
},
{
"parse-description.json"
,
&
Template
{
Description
:
"foo"
,
},
false
,
},
{
"parse-min-version.json"
,
&
Template
{
MinVersion
:
"1.2"
,
},
false
,
},
}
for
_
,
tc
:=
range
cases
{
...
...
template/test-fixtures/parse-description.json
0 → 100644
View file @
43fbd26d
{
"description"
:
"foo"
}
template/test-fixtures/parse-min-version.json
0 → 100644
View file @
43fbd26d
{
"min_packer_version"
:
"1.2"
}
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