Megan Marsh
14bdb9516c
move Artifact and artifact mock to the sdk
2020-11-30 14:29:52 -08:00
Megan Marsh
001886670d
move Ui definition into the packer plugin sdk.
2020-11-30 14:26:54 -08:00
Adrien Delorme
73b7499811
HCL2: version block: test validation & document version/availability ( #10298 )
...
* HCL2: Test that the packer block passes in packer validate
* HCL2: Test invalid packer blocks are invalid
* docs: state from which version the packer block is available
2020-11-23 10:27:26 -05:00
Megan Marsh
6a1a22151c
move the various flag packages from helper to command, since command is the only package that uses them.
2020-11-16 14:23:35 -08:00
Megan Marsh
efe11da4a3
Merge pull request #10254 from hashicorp/plugin-sdk-2
...
Plugin sdk 2
2020-11-16 11:29:20 -08:00
Megan Marsh
3e54e9ea80
Merge pull request #10235 from hashicorp/refactor_version_code
...
Refactor version code
2020-11-16 11:12:59 -08:00
Megan Marsh
6402362018
create packer-plugin-sdk directory and begin moving the relevant folders into it.
2020-11-13 10:47:36 -08:00
Adrien Delorme
f44e912072
Update hcl2upgrade command to update env calls + tests ( #10244 )
2020-11-11 14:54:22 -05:00
Wilken Rivera
acabc1c1aa
Add packer fmt command ( #10225 )
...
* Add packer fmt command
This change adds a new command that allows users to format one or more
HCL2 Packer configuration template files.
Related to: #9174
* command/fmt: Add check flag
Packer's fmt command now supports a check flag that will output the name
of any file that would be changed by the HCL2 formatting engine. The
check flag is mutually exclusive with the write flag and will only check
if formatting is needed.
The update write flag will now overwrite the source files with the newly
formatted HCL2 source unless the `-write=false` or `-check` is passed at
the command line.
* Returns a diagnostic error if Format is unable to show a diff - equivalent to `terraform fmt`
* Updates testing to run against #Format and not the private methods of the HCL2Formatter; fixes ShowDiff test failure on Windows
* Updates comments for exported functions
* Add docs for fmt command
2020-11-11 11:49:39 -05:00
Adrien Delorme
deba1484ff
HCL2: allow calling env as input var default value ( #10240 )
...
* HCL2: allow to use env in default value of input variables
2020-11-11 11:27:32 +01:00
Adrien Delorme
17ec88246f
hcl2_upgrade update ( #10221 )
...
* handle template_dir, pwd funcs, handle min_packer_version
* gotpl packer_version becomes hcl2 packer.version
* uuid becomes hcl2 uuidv4
* test code with emojis
* handle all cases were we cannot guess what the argument was
* handle clean_resource_name cases
* up docs
2020-11-10 10:46:20 +01:00
Megan Marsh
bc85854a53
refactor packer version out of hcltemplate code.
2020-11-09 12:29:53 -08:00
Adrien Delorme
6dd06fad14
add command/ tests
2020-11-02 15:50:38 +01:00
Adrien Delorme
4bc16455b4
HCL2: add a packer block with a required_version input setting ( #10149 )
...
* add the possibility to set the packer.required_version field; to make sure the template file works with that version of Packer
* add tests
* add documentation on packer.required_version
Example:
packer {
required_version = ">= 1.2.0, < 2.0.0"
}
2020-10-27 10:03:36 +01:00
Megan Marsh
fc619dc977
Merge pull request #9626 from featheredtoast/add-proxmox-vm-clone
...
builder/proxmox FEATURE: split Proxmox into proxmox-iso and proxmox-clone
2020-10-23 13:36:45 -07:00
Megan Marsh
66b81d9bee
add build.name to hcl code ( #10114 )
2020-10-16 10:57:42 +02:00
Megan Marsh
2cdc052d7c
Merge pull request #10097 from hashicorp/more_hcl_docs
...
Update HCL docs with a local resource-free example to empower users t…
2020-10-14 13:34:54 -07:00
Megan Marsh
00cc425b84
docs tweaks
2020-10-14 12:58:04 -07:00
Peter Willis
f1b57b1e66
Fix typos
2020-10-14 15:04:18 -04:00
Peter Willis
a81811663a
Fix typos
2020-10-14 14:52:17 -04:00
Jeff Wong
0f12414126
Merge branch 'master' into add-proxmox-vm-clone
2020-10-12 10:48:15 -07:00
James Cradock
153d4111fa
Fix typo in build argument description ( #10066 )
2020-10-08 14:58:22 +02:00
Jeff Wong
a140c13943
[proxmox] add proxmox builder alias
...
Adds an alias for `proxmox` that points to proxmox-iso builder for
backwards compatibility
2020-10-07 23:43:12 -07:00
Adrien Delorme
3e0633fc20
scripts/generate-plugins.go: ignore "common" packages
2020-10-07 11:43:15 +02:00
Adrien Delorme
b2be255057
Merge remote-tracking branch 'origin/master' into pr/featheredtoast/9626-1
2020-10-06 11:11:04 +02:00
Adrien Delorme
fcf16315a3
add tests
2020-10-02 10:49:21 +02:00
Adrien Delorme
3d7ab9ea43
add an hcl2-json test
2020-09-18 16:38:04 +02:00
Calle Pettersson
905869308d
Split proxmox builder into a common part and iso/clone builders
...
Clone builder is still just a stub. Proof-of-concept for #9626
Signed-off-by: Calle Pettersson <calle@cape.nu>
2020-09-04 23:53:09 +02:00
Adrien Delorme
efd69aea2a
console: allow to use console when there are untyped vars ( #9864 )
...
* the var will simply be "unknown"
* add a test
2020-09-02 17:19:56 +02:00
Adrien Delorme
a70164f489
HCL2: when the type of a variable is not known evaluate setting as a litteral. ( #9863 )
...
* tests
* docs
2020-09-02 16:26:50 +02:00
Adrien Delorme
a25f057984
add tests for unknown values
2020-09-01 15:28:16 +02:00
Adrien Delorme
161879b98a
test unknown variables and locals
2020-09-01 11:59:07 +02:00
Adrien Delorme
652878059c
inspect command: ignore init errors as some value can be unset
2020-09-01 11:59:07 +02:00
Adrien Delorme
91c5a4613c
HCL2 inspect remove debug values
2020-09-01 11:59:07 +02:00
Wilken Rivera
67cd123d1c
Merge pull request #9834 from hashicorp/azr-fix-hcl2_upgrade_random_generate
...
hcl2_upgrade: fix a case where the generated type is wrong
2020-08-27 13:03:34 -04:00
Wilken Rivera
0e2a3e1058
command/hcl2_upgrade: Update description text for command
...
Before change
```
Usage: packer [--version] [--help] <command> [<args>]
Available commands are:
build build image(s) from template
console creates a console for testing variable interpolation
fix fixes templates from old versions of packer
hcl2_upgrade build image(s) from template
inspect see components of a template
validate check that a template is valid
version Prints the Packer version
```
After change
```
Usage: packer [--version] [--help] <command> [<args>]
Available commands are:
build build image(s) from template
console creates a console for testing variable interpolation
fix fixes templates from old versions of packer
hcl2_upgrade transform a JSON template into a HCL2 configuration
inspect see components of a template
validate check that a template is valid
version Prints the Packer version
```
2020-08-27 11:52:09 -04:00
Adrien Delorme
0f00709fb6
hcl2_upgrade: fix a case where the generated type is wrong
...
when it encounters map[string]interface{} or []interface{} types, hcl2_upgrade now takes the 'most complex' entry from those in order to tell wether this is going to be a body `body {}` or an attribute `attribute = {}`. Before that the hcl2_upgrade command could be a bit random there.
A way better ( but may be somewhat hard ) way to do this would be to use the actual plugins structs in order to generate the HCL2.
2020-08-27 16:47:14 +02:00
Adrien Delorme
5ba134ac5b
JSON to HCL2 (minimal best-effort) transpiler ( #9659 )
...
hcl2_upgrade transforms a JSON build-file in a HCL2 build-file.
This starts a validated Packer core and from that core we generate an HCL 'block' per plugin/configuration. So for a builder, a provisioner, a post-processor or a variable. The contents of each block is just transformed as is and basically all fields are HCL2-ified.
A generated field can be valid in JSON but invalid on HCL2; for example JSON templating (in mapstructure) allows to set arrays of strings - like `x = ["a", "b"]` - with single strings - like `x="a"` -, HCL does not allow this.
Since JSON does not make the distinction between variables and locals, everything will be a variable. So variables that use other variables will not work.
hcl2_upgrade tries to transform go templating interpolation calls to HCL2 calls when possible, leaving the go templating calls like they are in case it cannot.
Work:
* transpiler
* tests
* update hcl v2 library so that output looks great.
* update docs
2020-08-25 10:51:43 +02:00
sylviamoss
39a8dee4ea
add tests and update override example
2020-08-14 11:22:51 +02:00
Chris Gilmer
6e918c4bd3
Update test for builder output
2020-08-11 15:25:33 -07:00
Chris Gilmer
04f952a2f4
Pretty print build durations
2020-08-11 15:04:42 -07:00
Adrien Delorme
c7b35dd6bc
HCL2: add post-processors block to run multiple post-processor after a build ( #9638 )
...
added `post-processors` block to run chained post-processors after a build.
Before this, defining multiple `post-processor` blocks after
provisioning steps would run them sequentially, now doing this makes them start
from the build's artifact. To queue post-processors you now have to define them
in a `post-processors` block.
This is a breaking change.
2020-07-28 10:02:37 +02:00
Adrien Delorme
44616d3bff
refactor initialization out from packer configs + tests ( #9627 )
...
The initialization of packer core in JSON also validates that `null` variables were set, except in the case of `packer validate --syntax-only` , but after the refactor to allow to have all commands work with HCL2 and JSON this subtlety was lost.
This refactors the initialisation of the core in order to allow to have `packer validate --syntax-only` not error in case a variable is not set. Since these calls are refactored this works for HCL2 too.
fix #9478
2020-07-24 10:58:03 +02:00
Adrien Delorme
125178d943
core: Decode: when in HCL2 decoding mode; reset the whole struct before preparing it. ( #9622 )
...
* core: Decode when in HCL2 decoding mode; reset the whole struct before preparing it.
* HCL2: add path variables + docs & tests
Co-authored-by: Megan Marsh <megan@hashicorp.com>
2020-07-23 09:25:07 +02:00
Gennady Lipenkov
553d203e68
Add yandex-import post-processor
2020-07-08 22:01:52 +03:00
Adrien Delorme
b0238e6f4a
Update build_windows_test.go
2020-07-07 12:00:36 +02:00
Adrien Delorme
d84d956e36
add language coment !
2020-07-07 11:43:13 +02:00
Adrien Delorme
a15ad19411
test builds can be 'excepted'
2020-07-07 11:41:24 +02:00
Adrien Delorme
c1c8b8d22a
complete -> recipes
2020-07-07 11:31:19 +02:00
Adrien Delorme
10e5d952ac
unquote 'cooking...'
2020-07-06 18:08:51 +02:00
Adrien Delorme
0475b0529d
tests: fix line endings in windows
2020-07-06 17:58:22 +02:00
Adrien Delorme
0deaa5d2a5
add a complete tests for builder variables + only/except
2020-07-06 17:01:55 +02:00
Adrien Delorme
7969b690de
Revert "Share build info with Provisioner and Post-Processor via HCL2 variables ( #9444 )"
...
This reverts commit 99046c9178 .
2020-07-02 15:07:29 +02:00
Adrien Delorme
3d371a2d5d
Add complete HCL2 examples + allow to name a singular build.source blocks ( #9490 )
...
* in the examples/hcl folder
* add possibility to name singular build.source blocks to differentiate their output and to filter on them
2020-07-02 11:07:59 +02:00
Sylvia Moss
99046c9178
Share build info with Provisioner and Post-Processor via HCL2 variables ( #9444 )
2020-06-29 13:44:57 +02:00
Adrien Delorme
6f4d79799b
add thorough test
2020-06-23 15:40:54 +02:00
Adrien Delorme
dabcc866e5
add another inspect test
2020-06-23 15:17:49 +02:00
Adrien Delorme
f98576b19e
add a basic test for the inspect command
2020-06-23 15:13:53 +02:00
Adrien Delorme
51d02f8c2d
hcl2: inspect command
2020-06-23 11:58:57 +02:00
Adrien Delorme
fb337f8867
hcl work on only/except ( #9454 )
...
* HCL2: allow to skip a named build block too
* test that excepting a build block works
* test only on a named build block
* add/update docs
2020-06-23 10:53:16 +02:00
Megan Marsh
42e98f15ae
make sure the no-op progress bar gets used for machine readable uis
2020-06-17 11:57:12 -07:00
Moss
4f26534072
add on-error flag option to run cleanup provisioner
2020-06-16 15:34:00 +02:00
Moss
daaeccd8b0
Skip consecutives post-processors
2020-06-09 17:35:53 +02:00
Moss
bfb9df0039
fix except flag for JSON and HCL2
2020-06-09 15:26:45 +02:00
Wilken Rivera
f672f5bd9b
command/validate: Add support for HCL2 configuration files
...
* Update validate command to use FixConfig for checking against known
fixers
* Update validation command flag docs
* Add ConfigFixer method to PackerHandler Interface
* Implement ConfigFixer interface in PackerConfig
* Remove all stdout messaging (i.e calls to c.Ui.Say) in the validate
command. The command will only display hcl.Diagnotic messaging when there is an error or warning.
HCL2 Configs
```
⇶ packer validate docker_centos_shell_provisioner.pkr.hcl
```
JSON Configs
```
⇶ packer validate vmware-iso_ubuntu_minimal/vmware-iso_ubuntu_minimal.json
Error: Failed to prepare build: "vmware-iso"
1 error occurred:
* Deprecated configuration key: 'iso_checksum_type'. Please call `packer fix`
against your template to update your template to be compatable with the current
version of Packer. Visit https://www.packer.io/docs/commands/fix/ for more
detail.
Warning: Fixable configuration found.
You may need to run `packer fix` to get your build to run correctly.
See debug log for more information.
map[string]interface{}{
"builders": []interface{}{
map[string]interface{}{
... // 3 identical entries
"guest_os_type": string("ubuntu-64"),
"http_directory": string("http"),
- "iso_checksum":
string("946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
+ "iso_checksum":
string("sha256:946a6077af6f5f95a51f82fdc44051c7aa19f9cfc5f737954845a6050543d7c2"),
- "iso_checksum_type": string("sha256"),
"iso_url":
string("http://old-releases.ubuntu.com/releases/14.04.1/ubuntu-14.04.1-server-amd64.iso "),
"shutdown_command": string("echo 'vagrant' | sudo -S shutdown -P now"),
... // 4 identical entries
},
},
}
```
2020-06-05 14:24:39 -04:00
Adrien Delorme
bac9c74447
packer console for HCL2 ( #9359 )
2020-06-05 17:23:54 +02:00
Megan Marsh
3dc4ba2d68
Json vs HCL2 parity refactor ( #9301 )
...
* refactor so that json and hcl2 templates are both prepared in the same place in the build call, to make code easier to reason about. Remove overly verbose error output which isn't useful in vast majority of cases
* fix tests
* check err msg
* hcl2template.PackerConfig.GetBuilds: raise a diagnostic in case the packer core build perpare call errors
Co-authored-by: Adrien Delorme <adrien.delorme@icloud.com>
2020-05-28 10:43:58 +02:00
Megan Marsh
ee5635722b
enable force, debug, and on-error for hcl2 builds
2020-05-14 16:22:51 -07:00
Megan Marsh
533fbc1381
Merge pull request #9139 from hashicorp/hcl2_commands_refactor
...
Hcl2 commands refactor
2020-05-14 11:16:12 -07:00
Adrien Delorme
2f26168adc
ConsoleCommand.ParseArgs: don't fail if no buildfile was passed
2020-05-14 12:21:42 +02:00
Adrien Delorme
52b2151b21
go generate ./packer
2020-05-12 16:19:26 +02:00
Adrien Delorme
466358a13e
Delete command.go
2020-05-12 12:17:00 +02:00
Adrien Delorme
7ca0a80a86
remove Ui from command.MetaArgs
2020-05-12 12:14:30 +02:00
Adrien Delorme
77297e49e9
Update cli.go
2020-05-12 12:07:02 +02:00
Adrien Delorme
49c2a8cb17
update fix command with new synthax
2020-05-12 11:33:44 +02:00
Adrien Delorme
14f18f4236
dont catch signals in console, as it seems unecessary for now
2020-05-12 11:29:09 +02:00
Adrien Delorme
22a36ef97a
Move vars from Meta to cla args; this forces us to use it in GetConfigFromJSON which in turn forces us into updating console and validate
2020-05-12 11:24:22 +02:00
Adrien Delorme
534e98c4ef
pass Meta command line arguments around
2020-05-11 17:56:14 +02:00
Adrien Delorme
b35ec44d06
Update build.go
2020-05-08 18:01:34 +02:00
Adrien Delorme
e6aac8cd6f
Update build_test.go
2020-05-08 17:50:48 +02:00
Adrien Delorme
efcc6af06c
fix tests
2020-05-08 17:46:33 +02:00
Adrien Delorme
a93a45e4d3
more fixes to refactor
2020-05-08 17:15:00 +02:00
Adrien Delorme
42a05e1e80
more refactoring
2020-05-08 16:41:47 +02:00
Adrien Delorme
2ef758763f
Update build_cancellation_test.go
2020-05-08 12:06:41 +02:00
Adrien Delorme
2f63e4e79d
refactor term interrupts & have RunContext take a conf struct now
2020-05-08 12:05:14 +02:00
Adrien Delorme
532a69c968
Update command.go
2020-05-08 12:00:06 +02:00
Adrien Delorme
5290beb23e
Update cli.go
2020-05-08 11:59:10 +02:00
Adrien Delorme
a5ab87ca44
add scaffolding for the new packer command layout
2020-05-07 17:52:49 +02:00
Megan Marsh
6a682aca2e
Merge pull request #9124 from GennadySpb/yandex-export-post-processor
...
[WIP] Yandex export post processor
2020-05-05 11:01:13 -07:00
nqb
be08eddd8d
remove useless comment
...
-var-file allow an HCL file
2020-05-01 11:18:47 +02:00
Adrien Delorme
4047113746
Update build.go
2020-04-30 16:40:16 +02:00
Adrien Delorme
2c556ed8c0
remove clarified comment
2020-04-30 16:37:23 +02:00
Adrien Delorme
c71a792186
simplify/refactor core for build & validate
2020-04-30 16:36:01 +02:00
Adrien Delorme
7aaee62970
command/build: don't reset error code in case an error hapened
2020-04-30 12:10:13 +02:00
Adrien Delorme
5c2b8da63b
get builds from PackerConfig instead of parser
...
to allow just reading the config and to not start anything. This will allow to later on run `validate --syntax-only`.
Note that none of the builder/provisioner/post-processor config will be read but simply ignored. HCL2 still needs the body to be properly formatted and it should detect most syntax errors.
2020-04-29 16:36:40 +02:00
Tom Dyas
c0a6623ea2
teach HCL mode builds to honor -only and -except options ( #8947 )
2020-04-28 15:03:24 +02:00
Gennady Lipenkov
d5a6781fb7
Add new 'yandex-export' post-processor
2020-04-27 02:20:30 +03:00
Megan Marsh
217dcbb97f
golang 1.14 doesn't like calling NewFile on existing files. Port solution over from Terraform
2020-04-09 14:38:17 -07:00
Adrien Delorme
2af40c762b
HCL2: pass on builder type and name ( #8956 )
...
* sets `packer_build_name` and `packer_builder_type` variables for builder provisioners and post-processors in HCL2
* allows to use the new `${source.type}` and `${source.name}` variables in HCL2
* fixes #8932
Note that the common.PackerConfig is used everywhere and was not set for HCL2, this had some implications:
For #8923 you can see the issue here:
dde74232f2/builder/lxd/config.go (L61-L63)
More random examples of where this could cause an issue :
0785c2f6fc/provisioner/ansible-local/provisioner.go (L380-L381)
b4efd13a4d/builder/amazon/ebs/builder.go (L232-L236)
* [All references to PackerConfig.PackerBuildName](https://sourcegraph.com/github.com/hashicorp/packer@ff6a039d5bb45e34ff761d9c52e8b98972288447/-/blob/common/packer_config.go#L7:2&tab=references )
* [All references to PackerConfig.PackerBuilderType](https://sourcegraph.com/github.com/hashicorp/packer@ff6a039d5bb45e34ff761d9c52e8b98972288447/-/blob/common/packer_config.go#L8:2&tab=references )
2020-04-09 11:14:37 +02:00
Jeff Escalante
9165be87da
packer.io prefix removal, html extension remove for in-code errors
2020-04-07 17:53:22 -04:00
Vaijanath Angadihiremath
fd21b669db
Fixing the linting errors now required for merging
2020-04-02 17:22:16 -07:00
Vaijanath Angadihiremath
c815a5df67
Fixing the Make Ci errors
2020-04-02 17:18:41 -07:00
Vaijanath Angadihiremath
645cdf1a59
Updating the modules to include update to autorest 12.4
2020-04-02 17:13:36 -07:00
Megan Marsh
f5c98a7601
make sure cli vars supercede var files ( #8964 )
2020-03-30 10:31:59 +02:00
Adrien Delorme
d068430abf
make sure locals are evaluated only once variables are + test this ( #8918 )
...
fix #8898
2020-03-19 15:30:34 +01:00
Adrien Delorme
ad8dafa3bd
HCL: add tests and fixes around var-file and var args ( #8914 )
2020-03-19 13:57:22 +01:00
Adrien Delorme
88297c796d
Merge branch 'master' into hcl2_singular_blocks
2020-03-17 14:47:17 +01:00
Adrien Delorme
94a1f0bcb6
go fmt
2020-03-17 12:05:37 +01:00
Adrien Delorme
0a46bb9525
more precise docs
2020-03-17 11:50:16 +01:00
Adrien Delorme
b5e8750f5f
Change key/value to name/value to remain consistent with Terraform
2020-03-17 11:23:11 +01:00
Adrien Delorme
c8300b620a
allow to use hcl files as var files in HCL mode
...
fix #8781
2020-03-12 15:41:40 +01:00
Adrien Delorme
d2964d59e9
document that the -var-file option still expects JSON files for now
2020-03-03 17:19:51 +01:00
Wilken Rivera
9ec8b67392
Add golangci-lint to project ( #8686 )
...
* Add golangci-lint as linting tool
* Disable failing staticchecks to start; GitHub issue to handle coming soon
* Run `goimports -w` to repair all source files that have improperly
formatted imports
* makefile: Add ci-lint target to run on travis
This change adds a new make target for running golangci-lint on newly
added Go files only. This target is expected to run during Packer ci builds.
* .github/contributing: Add code linting instructions
* travis: Update job configuration to run parallel builds
2020-02-14 11:42:29 -05:00
Sylvia Moss
23fa3107a3
Render variables one time on prepare method ( #8727 )
2020-02-13 17:35:23 +01:00
Adrien Delorme
193dad46e6
Hcl2 input variables, local variables and functions ( #8588 )
...
Mainly redefine or reused what Terraform did.
* allow to used `variables`, `variable` and `local` blocks
* import the following functions and their docs from Terraform: abs, abspath, basename, base64decode, base64encode, bcrypt, can, ceil, chomp, chunklist, cidrhost, cidrnetmask, cidrsubnet, cidrsubnets, coalesce, coalescelist, compact, concat, contains, convert, csvdecode, dirname, distinct, element, file, fileexists, fileset, flatten, floor, format, formatdate, formatlist, indent, index, join, jsondecode, jsonencode, keys, length, log, lookup, lower, max, md5, merge, min, parseint, pathexpand, pow, range, reverse, rsadecrypt, setintersection, setproduct, setunion, sha1, sha256, sha512, signum, slice, sort, split, strrev, substr, timestamp, timeadd, title, trim, trimprefix, trimspace, trimsuffix, try, upper, urlencode, uuidv4, uuidv5, values, yamldecode, yamlencode, zipmap.
2020-02-06 11:49:21 +01:00
Megan Marsh
073eda76aa
remove extraneous files from when vsphere builder was a plugin, and move README into packer website as separated docs for vsphere-clone and vsphere-iso. Move option descriptions into struct code, and generate documentation directly from those structs as we do inside of the other builders
2020-01-07 16:59:31 -08:00
Megan Marsh
5bacd37014
fix pps
2019-12-17 16:13:21 -08:00
Megan Marsh
dca2c03cdb
Merge pull request #7866 from hashicorp/sharing_info
...
Add new struct to Provision() method signature, allowing us to share connection and credential info generated at build time with provisioners.
2019-12-17 14:55:20 -08:00
nywilken
3d56f8ac80
command/build: Fix URL to HCL2 syntax guide
...
* small typo fixes
2019-12-17 15:36:04 -05:00
Adrien Delorme
4b7132c87c
Merge remote-tracking branch 'origin/master' into sharing_info
2019-12-17 11:57:09 +01:00
Adrien Delorme
0785c2f6fc
build using HCL2 ( #8423 )
...
This follows #8232 which added the code to generate the code required to parse
HCL files for each packer component.
All old config files of packer will keep on working the same. Packer takes one
argument. When a directory is passed, all files in the folder with a name
ending with “.pkr.hcl” or “.pkr.json” will be parsed using the HCL2 format.
When a file ending with “.pkr.hcl” or “.pkr.json” is passed it will be parsed
using the HCL2 format. For every other case; the old packer style will be used.
## 1. the hcl2template pkg can create a packer.Build from a set of HCL (v2) files
I had to make the packer.coreBuild (which is our one and only packer.Build ) a public struct with public fields
## 2. Components interfaces get a new ConfigSpec Method to read a file from an HCL file.
This is a breaking change for packer plugins.
a packer component can be a: builder/provisioner/post-processor
each component interface now gets a `ConfigSpec() hcldec.ObjectSpec`
which allows packer to tell what is the layout of the hcl2 config meant
to configure that specific component.
This ObjectSpec is sent through the wire (RPC) and a cty.Value is now
sent through the already existing configuration entrypoints:
Provisioner.Prepare(raws ...interface{}) error
Builder.Prepare(raws ...interface{}) ([]string, error)
PostProcessor.Configure(raws ...interface{}) error
close #1768
Example hcl files:
```hcl
// file amazon-ebs-kms-key/run.pkr.hcl
build {
sources = [
"source.amazon-ebs.first",
]
provisioner "shell" {
inline = [
"sleep 5"
]
}
post-processor "shell-local" {
inline = [
"sleep 5"
]
}
}
// amazon-ebs-kms-key/source.pkr.hcl
source "amazon-ebs" "first" {
ami_name = "hcl2-test"
region = "us-east-1"
instance_type = "t2.micro"
kms_key_id = "c729958f-c6ba-44cd-ab39-35ab68ce0a6c"
encrypt_boot = true
source_ami_filter {
filters {
virtualization-type = "hvm"
name = "amzn-ami-hvm-????.??.?.????????-x86_64-gp2"
root-device-type = "ebs"
}
most_recent = true
owners = ["amazon"]
}
launch_block_device_mappings {
device_name = "/dev/xvda"
volume_size = 20
volume_type = "gp2"
delete_on_termination = "true"
}
launch_block_device_mappings {
device_name = "/dev/xvdf"
volume_size = 500
volume_type = "gp2"
delete_on_termination = true
encrypted = true
}
ami_regions = ["eu-central-1"]
run_tags {
Name = "packer-solr-something"
stack-name = "DevOps Tools"
}
communicator = "ssh"
ssh_pty = true
ssh_username = "ec2-user"
associate_public_ip_address = true
}
```
2019-12-17 11:25:56 +01:00
Megan Marsh
0f6d1beccf
add an extra string array to the Prepare() return values in the builder interfaces; this sets up the ability for builders to give the provisioners custom user-accessible build-time variables.
2019-12-16 21:23:05 -08:00
Moss
a0329ef196
Simplify testing template
2019-12-10 18:59:56 +01:00
Moss
7466c4fdca
Return exit code 1 when builder type is not found
2019-12-10 18:55:18 +01:00
mingsheng.su
2c513fce64
update ucloud packer
2019-10-29 16:11:43 -07:00
mingsheng.su
61f9d3a9fe
add ucloud import
2019-10-29 16:11:43 -07:00
Paul Meyer
7297d74c98
Add azure-chroot builder plugin
2019-10-15 21:13:37 +00:00
Megan Marsh
59efa0faee
rename option to error-cleanup-privisoner, which I think is clearer
2019-09-25 13:43:29 -07:00
Megan Marsh
0683bc409b
add test for error-cleanup provisioner, and fix tests by fixing null builder to use an actual none communicator instead of skipping communicator generation altogether
2019-09-25 13:39:09 -07:00
Megan Marsh
6688f436dd
Merge pull request #7960 from guidodobboletta/master
...
Fix console help text
2019-08-12 16:32:29 -07:00
xiaohan.liang
f4fc9dd09a
Rewrite all files, remove sensitive information
2019-08-09 15:00:23 +08:00
Guido Dobboletta
e79d62d006
Fix text
2019-08-08 13:22:59 -05:00
Thomas Meckel
d3202497ae
First working version of virtualbox/vm builder
2019-07-26 12:29:44 +02:00
Thomas Meckel
2a531f8ad6
Merged changes from local branch
2019-07-26 12:29:44 +02:00
Brendan Devenney
2b16b5cae4
Move fixer test to fix package
...
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
2019-07-24 18:04:17 +01:00
Brendan Devenney
6520814a6c
Ensure help output is consistently formatted
...
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
2019-07-24 17:41:57 +01:00
Brendan Devenney
75d8d7fce5
Update and futureproof fix command usage
...
* Dynamically generate the fixer documentation (in order) from
FixerOrder
* Update fixers which used linebreaks in their Synopsis
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
2019-07-24 17:18:07 +01:00
Brendan Devenney
91b7d8c572
Add test to ensure all fixers are enabled
...
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
2019-07-24 16:52:07 +01:00
Brendan Devenney
9f0bc29db5
Test that Fixers and FixerOrder are equal length
...
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
2019-07-24 16:51:39 +01:00
Marin Salinas
80dadaf3f1
feature: add bsuvolume builder and acceptance test
2019-07-18 09:39:08 -07:00
Marin Salinas
0c47ee55e6
feature: add chroot builder structure
2019-07-18 09:39:07 -07:00
Marin Salinas
c4e69d3169
wip: add bsu plugin acc testing
2019-07-18 09:39:07 -07:00
Marin Salinas
1281f28f6d
add prevalidate step
2019-07-18 09:39:07 -07:00
Marc Falzon
00c2df24df
Add Exoscale Import post-processor
...
This change adds a new `exoscale-import` post-processor allowing users
to create Private Templates on Exoscale.
2019-07-01 08:40:26 +02:00
mingsheng.su
6109ad79a3
Merge branch 'master' into feature/ucloud_builder
2019-06-26 10:09:28 +08:00
Adrien Delorme
5efab58ed8
allow to have timestamped colorless ui messages
2019-06-19 15:04:13 +02:00
mingsheng.su
d1b9ad90c8
Merge remote-tracking branch 'origin' into feature/ucloud_builder
2019-06-18 18:17:19 +08:00
mingsheng.su
c8bab9b382
add ucloud packer
2019-06-13 15:16:49 +08:00
Megan Marsh
f7bf80724c
document what a REPL is
2019-06-10 11:39:42 -07:00
Megan Marsh
53a5e90d78
Update command/console.go
...
Co-Authored-By: Adrien Delorme <azr@users.noreply.github.com>
2019-06-10 11:38:29 -07:00
Megan Marsh
7cce3157a8
Update command/console.go
...
Co-Authored-By: Adrien Delorme <azr@users.noreply.github.com>
2019-06-10 11:38:14 -07:00
Megan Marsh
668e92f2ca
add docs and the option to list variables from inside the console
2019-06-06 14:26:12 -07:00
Megan Marsh
df916e805e
borrow wrappedreadline workarounds from terraform and implement a similar check for piped commands; this makes the cli experience much cleaner
2019-06-06 13:26:07 -07:00
Megan Marsh
b8ac1a800d
implement a packer console analogous to the terraform console
2019-06-05 16:35:22 -07:00
Adrien Delorme
cb2d89af6f
simplify path parsing by making at string instead of an array + add tests
2019-05-07 11:51:21 +02:00
Adrien Delorme
a4b8570991
refactor arg parsing into it's own cfg maker & test it
2019-05-07 11:43:18 +02:00
Adrien Delorme
7e8c42d243
BuildCommand: put config in a local struct
2019-05-07 11:15:35 +02:00
Adrien Delorme
cdbb742496
add more cancellation tests
2019-05-06 16:29:35 +02:00
Adrien Delorme
73a55631c4
fix testfile call
2019-05-06 15:47:53 +02:00
Adrien Delorme
2890687b2b
fix race condition in BuildCommand
...
a map[string]error was being written on unprotectedly
2019-05-06 15:42:23 +02:00
Adrien Delorme
af15ed3583
nil signals are probably just a cancellation in disguise
2019-05-06 15:29:59 +02:00
Adrien Delorme
583d93790f
add tests for cancellation while building
2019-05-06 15:07:57 +02:00
Adrien Delorme
dd2785ff08
BuildCommand.Run: avoid triggering a cancellation on termination
2019-05-06 12:26:22 +02:00
Adrien Delorme
0094d2878c
Build: move BuildCommand.Run into a RunContext command to allow testing for cancellation, put cancellation in Run
2019-05-06 12:19:59 +02:00
Adrien Delorme
a2cc2532ea
add TestBuildParallel_Timeout to test errors on parallel builds
2019-05-03 09:02:56 +02:00
Adrien Delorme
d40d3eca88
swap semaquire and wg.Add to avoid a deadlock
2019-05-03 08:19:33 +02:00
Adrien Delorme
263f318e82
be true to docs
2019-05-02 17:48:34 +02:00
Adrien Delorme
1dca416f87
move the semacquire to the main build loop so that the build order is kept
...
* a goroutine could start before another !
2019-05-02 16:58:28 +02:00
Adrien Delorme
852af993e6
BuildParallel: test with 3 parallel builds
2019-05-02 16:24:28 +02:00
Adrien Delorme
9281fada2d
prevent a breaking change so that we can merge the -parallel-builds option first.
2019-05-02 16:24:28 +02:00
Adrien Delorme
14486003a1
fix test to be race free
2019-05-02 15:04:02 +02:00
Adrien Delorme
c1527d9b47
fix text
2019-05-02 14:41:44 +02:00
Adrien Delorme
ae71a81c1e
Merge remote-tracking branch 'origin/master' into pr/7501
2019-05-02 11:47:43 +02:00
Brett Wandel
aaf56ffd26
added: testing
2019-05-02 08:38:56 +10:00
Brett Wandel
76b5c1995f
fixed: small changes to cancellation on ctrl-c
2019-04-19 17:10:36 +10:00
Marques Johansson
99987c2d56
Add Linode Images builder
...
Packer Builder for [Linode Images](https://www.linode.com/docs/platform/disk-images/linode-images/ )
Adds the following builder:
* `linode`
Based on https://github.com/linode/packer-builder-linode (MPL/2)
(formerly maintained by @dradtke). Includes website docs and tests.
Relates to #174 , #3131
2019-04-15 20:40:59 -04:00
Adrien Delorme
97f2914c6a
Merge pull request #7484 from yandex-cloud/yandex-cloud-builder
...
Builder for Yandex.Cloud
2019-04-15 14:02:43 +02:00
Brett Wandel
92e75f838a
added the ability to limit number of builds running in parallel
2019-04-13 22:31:54 +10:00
Adrien Delorme
d2f036ec44
Revert "Revert "Merge pull request #7391 from carlpett/proxmox-builder""
...
This reverts commit 032527ecfe .
2019-04-12 12:26:34 +02:00
Gennady Lipenkov
8f53ca5e5e
Add 'yandex' plugin as Builder
2019-04-12 01:00:54 +03:00
Adrien Delorme
032527ecfe
Revert "Merge pull request #7391 from carlpett/proxmox-builder"
...
This reverts commit b7d62b2ae0 , reversing
changes made to c36eaf16f7 .
2019-04-11 14:19:25 +02:00
Adrien Delorme
0b4ada9690
make sleep provisioner available to packer
2019-04-08 20:09:22 +02:00
Adrien Delorme
d7b1b597a7
test provisionning timeout
2019-04-08 20:09:21 +02:00
Adrien Delorme
a81abd297b
Merge remote-tracking branch 'origin/master' into context_provisioner
2019-04-08 20:09:01 +02:00
Calle Pettersson
9f8fc37fde
Implement Proxmox builder
2019-04-04 15:20:46 -07:00
Megan Marsh
217a93fc30
fix build_test.go on windows. This code needs to not be run in parallel, or else there can be race conditions with the post-processors all trying to access the same file at once. Additionally, I changed the test template itself so that it is valid code on either bash or cmd. Finally, I found and fixed a small bug in naming the file extensions in shell local inline scripts.
2019-04-04 14:57:56 -07:00
Adrien Delorme
a4bf94dd3c
change Builder to be passed a context for cancellation
...
we have to to give it to our hook
2019-04-03 15:55:55 +02:00
Adrien Delorme
045f2f41bd
display received signal in debug mode
2019-03-22 14:25:06 +01:00
Adrien Delorme
9f82b75e57
Use the hashicorp/go-getter to download files
...
* removed packer.Cache and references since packer.Cache is never used except in the download step. The download step now uses the new func packer.CachePath(targetPath) for this, the behavior is the same.
* removed download code from packer that was reimplemented into the go-getter library: progress bar, http download restart, checksuming from file, skip already downloaded files, symlinking, make a download cancellable by context.
* on windows if packer is running without symlinking rights and we are getting a local file, the file will be copied instead to avoid errors.
* added unit tests for step_download that are now CI tested on windows, mac & linux.
* files are now downloaded under cache dir `sha1(filename + "?checksum=" + checksum) + file_extension`
* since the output dir is based on the source url and the checksum, when the checksum fails, the file is auto deleted.
* a download file is protected and locked by a file lock,
* updated docs
* updated go modules and vendors
2019-03-13 12:11:58 +01:00
Andrew Widdersheim
a5b753820c
Fix build commands -except help message
...
The `-except` option needed some updates that were missed in 270f851e .
2019-03-05 10:54:35 -05:00
Megan Marsh
b8510f35fc
Merge pull request #7330 from hashicorp/except_post_processor_tests
...
name a post-processor to it's type when it is not named
2019-02-26 09:26:17 -08:00
Miłosz Smółka
94a7a07c87
Merge branch 'master' into hyperone
2019-02-24 15:16:21 +01:00
Adrien Delorme
7e2d86731e
tests: add a post-processor that creates an unnamed.txt file
2019-02-20 11:03:17 +01:00
Adrien Delorme
de336ef15e
TestBuildOnlyFileMultipleFlags: check that tomato.txt is not created
2019-02-19 16:40:42 +01:00
Adrien Delorme
b04b8b3857
test building with -except=""
2019-02-19 15:25:41 +01:00
Megan Marsh
75f574bd4b
Merge pull request #7221 from hashicorp/vagrant_builder
...
Vagrant builder
2019-02-15 10:05:44 -08:00
Megan Marsh
be21850e32
Merge pull request #7060 from andrewsomething/do-post-processor
...
Add digitalocean-import post-processor.
2019-02-14 11:58:00 -08:00
xinau
c207451f7e
Merge branch 'master' of https://github.com/hashicorp/packer into packer-provisioner-inspec
2019-02-12 05:32:05 +00:00
Miłosz Smółka
228829139b
Merge branch 'master' into hyperone
2019-02-07 14:12:13 +01:00
Megan Marsh
ad21367b21
vagrant builder
2019-02-04 14:08:43 -08:00
Adrien Delorme
8621949e01
make generate
2019-02-04 15:16:38 +01:00
Adrien Delorme
dd3e2c255c
respect a 'only' defined in a post-processor
2019-02-01 15:50:06 +01:00
Adrien Delorme
074a74ec38
make sure 'only' completely ignores post-processor
...
before this commit, if one would put a 'only' inside the post-processor definition, the post process could be skipped
2019-02-01 15:21:41 +01:00
Miłosz Smółka
be30415395
Add HyperOne builder
2019-01-23 14:04:05 +01:00
xinau
f5b13e3cb5
added inspec.io provisioner
2019-01-20 15:43:47 +00:00
Adrien Delorme
58245f2557
break a chain of post-processors when one is skipped & make -only
...
"blind" to post-processors
* to avoid trouble
* other arrays of post processors might still be there !
* add docs
* update tests
2019-01-11 14:08:30 +01:00
Adrien Delorme
61ade0e127
allow to use --only with post-processors
2019-01-10 15:44:34 +01:00
Adrien Delorme
4bf3cd44fc
allow to skip a post processor
2019-01-10 15:44:34 +01:00
Adrien Delorme
905db043c4
command.TestBuildOnlyFileCommaFlags: create some files using post processors
2019-01-10 15:44:02 +01:00
Adrien Delorme
7655d2efb2
Add tencent cloud builder ( #7135 & #6839 )
2018-12-20 17:09:44 +01:00
Megan Marsh
98e933ca54
make packer inspect not print sensitive variables.
2018-12-07 12:02:20 -08:00
Andrew Starr-Bochicchio
c0c5c6afac
Add DigitalOcean post-processor.
2018-11-29 21:00:57 -05:00
Megan Marsh
ba25e68fe0
add a new breakpoint provisioner
2018-11-29 14:32:52 -08:00
Megan Marsh
c5b6eff691
Merge pull request #6871 from LKaemmerling/master
...
Add hcloud builder
2018-10-18 11:13:16 -07:00
Lukas Kämmerling
270110767c
Add hcloud Builder
2018-10-17 12:15:47 +02:00
Josh Soref
66738ccaf4
Try to make help more consistent
...
Also try to synchronize the completion script
2018-10-10 21:34:35 -04:00
Adrien Delorme
626a3cc2a4
have -timestamp-ui match what's in doc
...
this was just an omission
also `=true` is not a necessary precision in this case
#6784
2018-10-03 14:40:13 +02:00
Ashley Lowde
2884f6fab6
improve formatting and documentation for PR#6784
2018-10-02 20:00:45 +09:30
Ashley Lowde
12496e3702
add optional timestamps to build log
2018-09-29 22:39:24 +09:30
Matthew Hooker
8a7d43dd44
bug fix and add test
2018-09-06 12:19:31 -07:00
Megan Marsh
cb35829f80
Merge pull request #6411 from jmartin-r7/esxi_compact
...
add support for disk compaction to esx5 builder
2018-09-04 12:44:32 -07:00
Oleg Butuzov
079b317b62
Misaligned help entries
...
Descriptions for `build` subcommand aligned.
hashicorp/packer#6652
2018-09-01 10:32:23 +03:00
Jeffrey Martin
e8f04c34a3
add vmware-compaction fixer help
2018-08-30 16:44:00 -05:00
Megan Marsh
c5b346b07b
Merge pull request #6393 from DanHam/fix-hyperv-export
...
Various improvements to Hyper-V ISO and VMCX builders
2018-08-24 15:52:49 -07:00
Matthew Hooker
ddf23a2c46
Complete Atlas deprecation.
...
Removes the push command and the Atlas post-processor. Please see our
guide on building immutable infrastructure with Packer on CI/CD for
ideas on implementing these features yourself.
https://www.packer.io/guides/packer-on-cicd/
2018-08-02 20:23:28 -07:00
Matthew Hooker
9bb0681586
Merge pull request #6423 from hashicorp/fix5513
...
cmd/validate: Warn users if configs need fixing
2018-07-23 13:52:28 -07:00
DanHam
c8f54d5291
Fixer and tests to convert 'clone_from_vmxc_path' -> 'clone_from_vmcx_path'
2018-07-20 02:12:48 +01:00
DanHam
3c5d7aec74
Ensure new fixer appears in 'packer fix' usage message
2018-07-20 02:12:47 +01:00
DanHam
1347f07618
Update 'packer fix' command usage output to include all fixers
2018-07-11 12:38:50 +01:00
Matthew Hooker
dde6805ee8
ignore empty top-level config keys when vetting fix
2018-07-02 13:57:11 -07:00
Sean Malloy
3622a669dc
Add new post processor googlecompute-import
2018-06-26 21:39:55 -05:00
Matthew Hooker
a5e29e68da
cmd/validate: notify user if config is "fixable"
2018-06-25 22:21:16 -07:00
M. Marsh
eb557af8bf
Merge branch 'master' into f-autocomplete
2018-04-26 11:18:37 -07:00
Matthew Hooker
3c37aaf4e6
update atlas deprecation language
...
This is a follow-on to #6018
2018-03-19 10:50:29 -07:00
Josh Soref
e7a30b4ba2
spelling: attempt
2018-03-13 07:11:42 +00:00
Edouard BONLIEU
7e36cfcff1
Add Scaleway builder
2018-02-08 12:09:24 -08:00
Matthew Hooker
6205c71f98
Merge pull request #5791 from YuSungDuk/master
...
Naver Cloud Platform builder
2018-02-08 11:10:18 -08:00
Matthew Hooker
c03ce222b2
add atlas deprecation warnings.
2018-02-07 15:45:00 -08:00
SwampDragons
997f8e4a2a
Merge pull request #5318 from hashicorp/sigtermcleanup
...
Gracefully clean up on SIGTERM
2018-02-02 11:56:56 -08:00
유성덕
5714108ef9
Merge branch 'master' into support_ncloud
2018-01-29 22:10:18 +09:00
Megan Marsh
7d85b31b29
make fmt
2018-01-25 14:34:03 -08:00
Megan Marsh
46c3113613
it compiles :)
2018-01-25 14:34:00 -08:00
Matthew Hooker
807e88245b
trying to add context to state bag
2018-01-24 17:09:15 -08:00
유성덕
5189d65467
Support Naver Cloud Platform
2018-01-11 18:57:53 +09:00
Krzysztof Wilczynski
0e08640fff
Re-factor version command to use version.FormattedVersion() function.
...
This commit removes surplus code which is almost a duplicate of the code
available in the version package by favouring the package implementation
instead.
Signed-off-by: Krzysztof Wilczynski <kw@linux.com>
2017-12-03 23:07:16 +01:00
Jeremy Voorhis
bfc75eb9d9
Implement cli.CommandAutocomplete for most commands
2017-10-13 11:57:44 -07:00
Jeremy Voorhis
a4cb8ae41b
Define methods on *BuildCommand (consistency)
2017-10-13 11:57:44 -07:00
SwampDragons
f3c33240fa
Merge pull request #5444 from vijayinvites/packer-vhdx
...
Hyperv vmcx builder and allow vhd/vhdx instead of ISO
2017-10-13 11:53:27 -07:00
Matthew Hooker
fcfdff0efd
rerun scripts/generate-plugins.go
2017-10-11 22:05:52 +05:30
Taliesin Sisson
efa62e1550
Can specify an iso, vhd or vhdx for download. If it is a vhd or vhdx it is used as the hard drive for spinning up a new machine, importing an exported virtual machine or cloning a virtual machine.
...
Can import a virtual machine from a folder
Can clone an existing virtual machine
2017-10-11 22:05:45 +05:30
Taliesin Sisson
452fcbd9a1
Only attach dvd drive if there is one
...
Fix debug messages for cloning
Add hyperv-vmcx as a builder from command line
2017-10-11 21:42:32 +05:30
Jearvon Dharrie
e918dc89bc
Add /downloads.html to the outdated version message
2017-10-10 23:31:33 -04:00
Andrew Pryde
6fd2f6701d
Rename Oracle BMCS builder to OCI
...
Oracle Bare Metal Cloud Services (BMCS) has been rebranded as Oracle
Cloud Infrastructure (OCI).
2017-09-12 10:40:56 -07:00
Matthew Hooker
624b1e5110
Merge pull request #4554 from prydie/f-oracle-bmcs
...
Oracle Bare Metal Cloud Services (BMCS) builder
2017-09-11 09:42:14 -07:00
Matthew Hooker
fdaf4ed8d3
Gracefully clean up on SIGTERM
2017-09-08 11:42:32 -07:00
Megan Marsh
8d24b3930a
cleanup imports and rebase artifacts
2017-09-05 15:23:22 -07:00
Michele Catalano
f4f0ab9f50
add integrate lxc builder in packer
...
add lxc with scripts/generate-plugins.go
2017-09-05 15:17:15 -07:00
Chris Lundquist
7366b6c78e
[lxd] first pass
2017-09-05 12:44:39 -07:00
Andrew Pryde
630ee5d650
Change imports mitchelh/packer -> hashicorp/packer
2017-08-02 09:53:48 +01:00
Andrew Pryde
9728f890cf
Implemented and documented oracle-bmcs builder
...
Implements a new Packer builder (oracle-bmcs) which adds support for
building custom images for Oracle Bare Metal Cloud Services (BMCS)
https://cloud.oracle.com/en_US/bare-metal .
Additionally includes documentation for the oracle-bmcs builder.
2017-08-02 09:53:48 +01:00
bugbuilder
3cc9f204ac
Moving vsphere-tpl to vsphere-template, fixed root folder creation and updated docs
2017-07-10 20:52:48 -04:00
bugbuilder
dc2124aa2a
Initial vSphere-tpl post-processor
2017-07-09 14:12:37 -04:00
Megan Marsh
17d3671601
make sure that flagVars is not a nil map
2017-07-06 09:27:05 -07:00
Matthew Hooker
056104ace4
fix tests
2017-06-08 19:12:04 -07:00
Matthew Hooker
d5c228ee98
additional renaming of private to sensitive
2017-06-08 15:52:16 -07:00
Matthew Hooker
01f64009ed
spacing
2017-06-08 15:47:46 -07:00
Matthew Hooker
baf31980c7
remove unneeded cast
2017-06-08 15:44:48 -07:00
Megan Marsh
33af49d980
rename private to be in line with tfe
2017-06-08 15:42:17 -07:00
Matthew Hooker
cd147e2da4
Merge pull request #4970 from hashicorp/4727_sensitive_vars
...
allow user to mark variables as sensitive for packer push
2017-06-08 15:27:37 -07:00
Megan Marsh
a21870e614
addressing PR comments
2017-06-08 13:24:07 -07:00
Megan Marsh
7ac429b9ca
add private to help function
2017-06-08 13:04:40 -07:00
Megan Marsh
fdca364f4b
allow user to mark variables as sensitive for packer push
2017-06-08 13:01:23 -07:00
Matthew Hooker
8933690e90
Merge pull request #4950 from hashicorp/warn_atlas_users
...
add warning about vagrant.box vms being uploaded to atlas
2017-06-07 13:44:41 -07:00
Megan Marsh
dbd7aa6b95
capitalize all the things
2017-06-07 13:30:39 -07:00
Megan Marsh
1c1db91715
add instructions
2017-06-07 13:20:02 -07:00
Megan Marsh
b31f8bb0f6
clean up formatting and add warning to packer push.
2017-06-01 11:25:53 -07:00
Matthew Hooker
1a26fbd59c
update changelog
2017-05-15 13:52:29 -07:00
zhuzhih2017
d646e1d035
refactor the code according hashicorp rename the repository
2017-04-18 15:14:45 +08:00
Matthew Hooker
81522dced0
move packer to hashicorp
2017-04-04 13:39:01 -07:00
Matthew Hooker
048e316645
s/TargettedUi/TargetedUI/
2017-03-29 12:44:42 -07:00
Matthew Hooker
230079f73a
spell fixes
2017-03-28 20:36:19 -07:00
Matthew Hooker
f0e83beaaa
display version correctly
2017-03-16 15:24:12 -07:00
zhuzhih2017
0400ebae95
Fix the code according PR review
2017-03-12 10:22:25 +08:00
zhuzhih2017
fadfb696dd
Add packer plugin which support alicloud ecs images
2017-03-03 16:56:17 +08:00
Matthew Hooker
c1480931e2
Merge pull request #4525 from mitchellh/nocolorsay
...
don't show ui color if we're not colorized
2017-02-26 18:47:56 -08:00
James Nugent
635aeb765b
amazon/ebssurrogate: Add New Builder
...
This commit adds a new type of builder which builds an AMI based on a
snapshot of an EBS volume which is provisioned on a "surrogate"
instance. This can be used to build operating system images from
scratch, but unlike the `chroot` builder does not require running from
an AWS EC2 instance.
2017-02-21 18:38:19 -06:00
Matthew Hooker
11354aa1b7
tidy up new line
2017-02-09 17:45:42 -08:00
Matthew Hooker
60955d8c2c
don't show ui color if we're not colorized
2017-02-09 17:41:42 -08:00
Matthew Hooker
31163f6e96
command/version: don't print extra new line.
2017-02-01 19:26:34 -08:00
Chris Bednarski
ee2d636840
Improve delay between key events
...
- Can now tune delay using PACKER_KEY_INTERVAL
- Added implementation to all of VMware and QEMU
- Removed double delay for QEMU
- Default key delay of 100ms (as before)
- Added docs to QEMU and VMware pages
2017-01-14 17:56:04 -08:00
Matthew Hooker
d0ef866639
don't interpolate atlas variables.
2017-01-12 16:08:54 -08:00
James Nugent
e15be036d7
builder: add Triton builder
...
This is a builder for Joyent's Triton system. It was originally at
jen20/packer-builder-triton, and subsequently at
joyent/packer-builder-triton on GitHub. The following commit vendors the
dependencies.
2016-12-24 10:25:31 +01:00
Taliesin Sisson
335615408a
Run go fmt on files
2016-12-12 22:45:19 +00:00
Taliesin Sisson
4721327bf6
Fix duplicate imports
2016-12-12 22:44:51 +00:00
Taliesin Sisson
ccf506ee22
Must point to iso hyperv plugin
2016-12-12 22:44:23 +00:00
Taliesin Sisson
25baa26a7a
Incude hyperv as part of the plugins
2016-12-12 22:44:23 +00:00
Matthew Hooker
d3ddd99721
Merge pull request #4163 from StackPointCloud/packer-builder-oneandone
...
Packer Builder 1&1
2016-12-08 14:07:35 -08:00
Matthew Hooker
c122a178a9
Merge pull request #4089 from mitchellh/replace3076
...
command/push: Fix variable pushes to Atlas
2016-11-15 12:24:51 -08:00
Matthew Hooker
93e31168f7
remove print
2016-11-14 12:08:02 -08:00
Jake Champlin
95760462a6
Update help output for build command
...
The `-only` flag has been around for some time now, and is documented on
our packer website, yet the help output for `packer build` lacks this
command line option.
2016-11-14 10:06:43 -05:00
jasminSPC
4bcba37f38
Packer Builder 1&1
2016-11-13 23:34:36 +01:00
Justin Campbell
fdaa89681a
Update go-atlas.
...
Use the atlas.BuildVars type.
The -var/-var-file precedence issue is a bug documented in #2682 . Not
introduced in this patch
2016-11-07 12:52:32 -08:00
Justin Campbell
16adc3f7cc
command/push: Add test for var-file push to Atlas
2016-11-07 12:52:30 -08:00
Justin Campbell
56cd8171cc
command/push: Push CLI vars to Atlas
2016-11-07 12:52:29 -08:00
Matthew Hooker
6b7ac8ee90
make generate
2016-11-02 11:48:32 -07:00
James Nugent
b1ff8c3bfc
builder/amazon: Add ebs-volume builder
...
This commit adds a builder that works like EBS builders, except does not
create an AMI, and instead is intended to create EBS volumes in an
initialized state. For example, the following template can be used to
create and export a set of 3 EBS Volumes in a ZFS zpool named `data` for
importing by instances running production systems:
```
{
"variables": {
"aws_access_key_id": "{{ env `AWS_ACCESS_KEY_ID` }}",
"aws_secret_access_key": "{{ env `AWS_SECRET_ACCESS_KEY` }}",
"region": "{{ env `AWS_REGION` }}",
"source_ami": "{{ env `PACKER_SOURCE_AMI` }}",
"vpc_id": "{{ env `PACKER_VPC_ID` }}",
"subnet_id": "{{ env `PACKER_SUBNET_ID` }}"
},
"builders": [{
"type": "amazon-ebs-volume",
"access_key": "{{ user `aws_access_key_id` }}",
"secret_key": "{{ user `aws_secret_access_key` }}",
"region": "{{user `region`}}",
"spot_price_auto_product": "Linux/UNIX (Amazon VPC)",
"ssh_pty": true,
"instance_type": "t2.medium",
"vpc_id": "{{user `vpc_id` }}",
"subnet_id": "{{user `subnet_id` }}",
"associate_public_ip_address": true,
"source_ami": "{{user `source_ami` }}",
"ssh_username": "ubuntu",
"ssh_timeout": "5m",
"ebs_volumes": [
{
"device_name": "/dev/xvdf",
"delete_on_termination": false,
"volume_size": 10,
"volume_type": "gp2",
"tags": {
"Name": "TeamCity-Data1",
"zpool": "data",
"Component": "TeamCity"
}
},
{
"device_name": "/dev/xvdg",
"delete_on_termination": false,
"volume_size": 10,
"volume_type": "gp2",
"tags": {
"Name": "TeamCity-Data2",
"zpool": "data",
"Component": "TeamCity"
}
},
{
"device_name": "/dev/xvdh",
"delete_on_termination": false,
"volume_size": 10,
"volume_type": "gp2",
"tags": {
"Name": "TeamCity-Data3",
"zpool": "data",
"Component": "TeamCity"
}
}
]
}],
"provisioners": [
{
"type": "shell",
"start_retry_timeout": "10m",
"inline": [
"DEBIAN_FRONTEND=noninteractive sudo apt-get update",
"DEBIAN_FRONTEND=noninteractive sudo apt-get install -y zfs",
"lsblk",
"sudo parted /dev/xvdf --script mklabel GPT",
"sudo parted /dev/xvdg --script mklabel GPT",
"sudo parted /dev/xvdh --script mklabel GPT",
"sudo zpool create -m none data raidz xvdf xvdg xvdh",
"sudo zpool status",
"sudo zpool export data",
"sudo zpool status"
]
}
]
}
```
StepModifyInstance and StepStopInstance are now shared between EBS and
EBS-Volume builders - move them into the AWS common directory and rename
them to indicate that they only apply to EBS-backed builders.
2016-11-02 12:56:39 -04:00
Matthew Hooker
d920b3fbf4
run gofmt
2016-11-01 14:08:04 -07:00
Matthew Hooker
01be917450
Merge pull request #3660 from StackPointCloud/packer-builder-profitbricks
...
Packer Builder ProfitBricks
2016-10-31 15:45:24 -07:00
Sander van Harmelen
dbf3bf56d4
Add a CloudStack Builder
2016-10-16 15:29:18 +02:00
jasminSPC
dca286bf38
Merge remote-tracking branch 'upstream/master' into packer-builder-profitbricks
2016-10-10 23:53:52 +02:00
Matthew Hooker
a8e57d83d2
gofmt project.
...
noticed many unrelated changes being added to patches because of gofmt.
ran `find . -not -path "./vendor/*" -name "*.go" -exec gofmt -w {} \;`
2016-09-29 14:13:06 -07:00
Doka
4256ab2cc2
add dot to build name regexp
...
allows build names like debian-8.3
2016-09-28 15:11:36 -07:00
Orivej Desh
4fe86244a5
Improve -on-error descriptions
2016-09-18 03:00:36 +00:00
Orivej Desh
639bf356aa
Fail on unknown values of -on-error
2016-09-17 14:42:21 +00:00
Orivej Desh
e9cc28565b
Document -on-error on the "packer build" page
2016-09-16 12:15:00 +00:00
Orivej Desh
6762965696
Add -on-error command line argument to allow preserving artifacts on builder errors
...
Resolves #409
2016-09-16 12:15:00 +00:00
jasminSPC
d84b3af863
Fixed tests
2016-08-31 14:11:10 +02:00
Scott Crunkleton
d2e65e6433
Generated command/plugin.go using scripts/generate-plugins.go.
2016-08-15 14:36:26 -07:00
crunk1
55b5a45ae4
Created googlecompute-export post-processor. Modified the googlecompute builder to pass a few configuration values to its resulting artifact. These values can then be used in googlecompute-export post-processor.
...
Added documentation and changed authentication stuff on temporary VM.
2016-08-15 14:36:26 -07:00
Chris Bednarski
db593a517d
Added manifest post-processor, which creates a manifest of build artifacts
2016-06-10 15:57:01 -07:00
Vasiliy Tolstov
d64603e137
initial import of checksum post-processor ( #3492 )
...
Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
2016-05-18 17:31:16 -07:00
Christopher Boumenot
ad3d674919
Do not use Fprintf, use Fprint.
2016-04-05 22:41:26 -07:00
Alvaro Miranda
6237df566f
add -color to build -h command
2016-03-23 04:40:24 +13:00
Chris Bednarski
5b5888b230
Initial import of Microsoft contributed code
2016-03-14 20:08:35 -07:00
Chris Bednarski
6a38303030
Make the build name error message show the original regexp
2016-03-01 19:01:46 -08:00
Chris Bednarski
53176f8cdb
Added amazon s3 service to vendor, to support the amazon-import feature
2016-02-12 10:41:26 -08:00
Chris Bednarski
58ebd6a9fd
Merge branch 'deps'
2016-02-05 14:22:00 -08:00
Chris Bednarski
93547ad91c
Regenerate command/plugin and apply go fmt (now handled by the makefile)
2016-02-05 11:18:36 -08:00
Chris Bednarski
171265c983
Remove generator from command/version because we can't go build ./... -- it also builds vendored stuff
2016-02-05 11:17:48 -08:00
Marat Bakeev
c95b2b483f
Merge branch ansible-provisioner of https://github.com/dkhenry/packer
2016-02-05 15:40:17 +13:00
Chris Bednarski
1f8ebab4de
There's no Warn, only Say
2016-01-20 15:30:16 -08:00
Chris Bednarski
d8953e48d4
Change log to Ui.Warn and restore the removed functionality for now
2016-01-14 17:18:02 -08:00
Chris Bednarski
5e34864494
Add deprecation notice for -m/-message
2015-10-27 18:35:57 -07:00
Chris Bednarski
3dfdef4d39
Removed push -m since this is not used
2015-10-27 18:30:58 -07:00
Mark Peek
71ed8e4a38
Fix #2742 : Include template line numbers on error
2015-10-25 12:28:06 -07:00
Mark Peek
62fd4df0a7
Merge pull request #2684 from mitchellh/docs-atlas-names
...
Added a note to the push docs about dot being disallowed in atlas names
2015-10-23 17:46:24 -07:00
Chris Bednarski
6783bc3fb0
Added generator for command/plugin.go so we don't have to edit it by hand to add new plugins
2015-10-21 16:57:38 -07:00
Chris Bednarski
bfe5b5b4b6
Change if/else logic to switch
2015-10-21 16:57:38 -07:00
Chris Bednarski
1641a5e0cb
Replace string splitting with a regexp; this is clearer and less code because of the post-processor case
2015-10-21 16:57:38 -07:00
Chris Bednarski
e080e73b04
Add some exit codes and use a constant for -PACKERSPACE-
2015-10-21 16:57:38 -07:00
Chris Bednarski
9fa93712a1
Added integrated post-processors
2015-10-21 16:57:38 -07:00
Chris Bednarski
d09a9ab0c7
Implemented internal plugins
...
- Internal plugins are compiled into the same packer binary and invoked through the plugin command
- Search paths allow disk-based plugins to override and should function as normal
- This should allow for a 94% space savings vs statically compiling all the plugins as separate binaries.. approximately 24mb vs 431mb
2015-10-21 16:57:38 -07:00
Mark Peek
af055ad3e0
Synchronize access to artifact map to remove race
2015-10-14 08:25:13 -07:00
Chris Bednarski
c834a00e22
Added a name validator to the push command
2015-08-26 12:16:18 -07:00
Rickard von Essen
4e20522afd
Fixes #2667 : Added vmware-rename to fix command help text
2015-08-24 20:19:49 +02:00
Chris Bednarski
b3eacc5c2b
Updated test to verify expected behavior
2015-07-13 19:32:28 -07:00
Chris Bednarski
78174dae4e
Don't override packer's build version from a config file; fixes #2385
2015-07-13 19:03:36 -07:00
Chris Bednarski
da20c36454
Removed unused variable breaking gorename
2015-07-13 18:04:50 -07:00
Chris Bednarski
28a13111b8
Add stub for validate test
2015-07-13 14:57:35 -07:00
Zach Zolton
548f2ced1c
Fix packer build reading from STDIN
...
Signed-off-by: Jesse Szwedko <jesse.szwedko@getbraintree.com>
2015-06-30 17:56:14 +00:00