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
56c3cbfb
Commit
56c3cbfb
authored
Jul 16, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/common: common config struct for Packer configs
parent
4878cec0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
12 deletions
+17
-12
builder/amazon/ebs/builder.go
builder/amazon/ebs/builder.go
+1
-2
builder/common/packer_config.go
builder/common/packer_config.go
+10
-0
builder/digitalocean/builder.go
builder/digitalocean/builder.go
+2
-2
builder/virtualbox/builder.go
builder/virtualbox/builder.go
+2
-4
builder/vmware/builder.go
builder/vmware/builder.go
+2
-4
No files found.
builder/amazon/ebs/builder.go
View file @
56c3cbfb
...
@@ -22,6 +22,7 @@ import (
...
@@ -22,6 +22,7 @@ import (
const
BuilderId
=
"mitchellh.amazonebs"
const
BuilderId
=
"mitchellh.amazonebs"
type
config
struct
{
type
config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
awscommon
.
AccessConfig
`mapstructure:",squash"`
awscommon
.
AccessConfig
`mapstructure:",squash"`
VpcId
string
`mapstructure:"vpc_id"`
VpcId
string
`mapstructure:"vpc_id"`
SubnetId
string
`mapstructure:"subnet_id"`
SubnetId
string
`mapstructure:"subnet_id"`
...
@@ -29,8 +30,6 @@ type config struct {
...
@@ -29,8 +30,6 @@ type config struct {
// Configuration of the resulting AMI
// Configuration of the resulting AMI
AMIName
string
`mapstructure:"ami_name"`
AMIName
string
`mapstructure:"ami_name"`
PackerDebug
bool
`mapstructure:"packer_debug"`
}
}
type
Builder
struct
{
type
Builder
struct
{
...
...
builder/common/packer_config.go
0 → 100644
View file @
56c3cbfb
package
common
// PackerConfig is a struct that contains the configuration keys that
// are sent by packer, properly tagged already so mapstructure can load
// them. Embed this structure into your configuration class to get it.
type
PackerConfig
struct
{
PackerBuildName
string
`mapstructure:"packer_build_name"`
PackerDebug
bool
`mapstructure:"packer_debug"`
PackerForce
bool
`mapstructure:"packer_force"`
}
builder/digitalocean/builder.go
View file @
56c3cbfb
...
@@ -28,6 +28,8 @@ type snapshotNameData struct {
...
@@ -28,6 +28,8 @@ type snapshotNameData struct {
// to use while communicating with DO and describes the image
// to use while communicating with DO and describes the image
// you are creating
// you are creating
type
config
struct
{
type
config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
ClientID
string
`mapstructure:"client_id"`
ClientID
string
`mapstructure:"client_id"`
APIKey
string
`mapstructure:"api_key"`
APIKey
string
`mapstructure:"api_key"`
RegionID
uint
`mapstructure:"region_id"`
RegionID
uint
`mapstructure:"region_id"`
...
@@ -38,8 +40,6 @@ type config struct {
...
@@ -38,8 +40,6 @@ type config struct {
SSHUsername
string
`mapstructure:"ssh_username"`
SSHUsername
string
`mapstructure:"ssh_username"`
SSHPort
uint
`mapstructure:"ssh_port"`
SSHPort
uint
`mapstructure:"ssh_port"`
PackerDebug
bool
`mapstructure:"packer_debug"`
RawSnapshotName
string
`mapstructure:"snapshot_name"`
RawSnapshotName
string
`mapstructure:"snapshot_name"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
RawSSHTimeout
string
`mapstructure:"ssh_timeout"`
RawEventDelay
string
`mapstructure:"event_delay"`
RawEventDelay
string
`mapstructure:"event_delay"`
...
...
builder/virtualbox/builder.go
View file @
56c3cbfb
...
@@ -24,6 +24,8 @@ type Builder struct {
...
@@ -24,6 +24,8 @@ type Builder struct {
}
}
type
config
struct
{
type
config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
BootCommand
[]
string
`mapstructure:"boot_command"`
BootCommand
[]
string
`mapstructure:"boot_command"`
DiskSize
uint
`mapstructure:"disk_size"`
DiskSize
uint
`mapstructure:"disk_size"`
FloppyFiles
[]
string
`mapstructure:"floppy_files"`
FloppyFiles
[]
string
`mapstructure:"floppy_files"`
...
@@ -49,10 +51,6 @@ type config struct {
...
@@ -49,10 +51,6 @@ type config struct {
VBoxManage
[][]
string
`mapstructure:"vboxmanage"`
VBoxManage
[][]
string
`mapstructure:"vboxmanage"`
VMName
string
`mapstructure:"vm_name"`
VMName
string
`mapstructure:"vm_name"`
PackerBuildName
string
`mapstructure:"packer_build_name"`
PackerDebug
bool
`mapstructure:"packer_debug"`
PackerForce
bool
`mapstructure:"packer_force"`
RawBootWait
string
`mapstructure:"boot_wait"`
RawBootWait
string
`mapstructure:"boot_wait"`
RawShutdownTimeout
string
`mapstructure:"shutdown_timeout"`
RawShutdownTimeout
string
`mapstructure:"shutdown_timeout"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
...
...
builder/vmware/builder.go
View file @
56c3cbfb
...
@@ -25,6 +25,8 @@ type Builder struct {
...
@@ -25,6 +25,8 @@ type Builder struct {
}
}
type
config
struct
{
type
config
struct
{
common
.
PackerConfig
`mapstructure:",squash"`
DiskName
string
`mapstructure:"vmdk_name"`
DiskName
string
`mapstructure:"vmdk_name"`
DiskSize
uint
`mapstructure:"disk_size"`
DiskSize
uint
`mapstructure:"disk_size"`
FloppyFiles
[]
string
`mapstructure:"floppy_files"`
FloppyFiles
[]
string
`mapstructure:"floppy_files"`
...
@@ -50,10 +52,6 @@ type config struct {
...
@@ -50,10 +52,6 @@ type config struct {
VNCPortMin
uint
`mapstructure:"vnc_port_min"`
VNCPortMin
uint
`mapstructure:"vnc_port_min"`
VNCPortMax
uint
`mapstructure:"vnc_port_max"`
VNCPortMax
uint
`mapstructure:"vnc_port_max"`
PackerBuildName
string
`mapstructure:"packer_build_name"`
PackerDebug
bool
`mapstructure:"packer_debug"`
PackerForce
bool
`mapstructure:"packer_force"`
RawBootWait
string
`mapstructure:"boot_wait"`
RawBootWait
string
`mapstructure:"boot_wait"`
RawShutdownTimeout
string
`mapstructure:"shutdown_timeout"`
RawShutdownTimeout
string
`mapstructure:"shutdown_timeout"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
RawSSHWaitTimeout
string
`mapstructure:"ssh_wait_timeout"`
...
...
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