Commit Graph
14773 Commits
Author SHA1 Message Date
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
Megan Marsh 73c349d09c Merge pull request #8908 from hashicorp/fix_4795
provisioner/powershell: Add cleanup step to remove any temporarily created scripts
2020-04-09 08:56:19 -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:

https://github.com/hashicorp/packer/blob/dde74232f251434715cb76664426d9c1e1c91bd8/builder/lxd/config.go#L61-L63

More random examples of where this could cause an issue :

https://github.com/hashicorp/packer/blob/0785c2f6fca9c22bf25528e0176042799dd79df9/provisioner/ansible-local/provisioner.go#L380-L381

https://github.com/hashicorp/packer/blob/b4efd13a4d69a937a22caa5dd84eb98f7fdce5cf/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
Wilken Rivera c358682411 Merge pull request #9030 from hashicorp/document_headless_vmware
update docs for headless to help users know they may need to launch the gui
2020-04-08 17:37:22 -04:00
Megan Marsh a48c0ecf49 update docs for headless to help users know they may need to launch the gui 2020-04-08 13:53:19 -07:00
Megan Marsh e845632d3d Merge pull request #9027 from alrs/fix-powershell-provisioner-err
provisioner/powershell: Test Error Improvements
2020-04-08 10:20:50 -07:00
Lars Lehtonen 49f28c9439 provisioner/powershell: fix dropped error
provisioner/powershell: improve error message
2020-04-08 10:04:08 -07:00
Wilken Rivera 4a46d6ff7b docs/provisioner/powershell: Add documentation for skip_clean option 2020-04-08 10:23:15 -04:00
Wilken Rivera fe721d8e11 test/provisioner/powershell: Add acceptance test for powershell provisioner cleanup
Passing Tests
```
--- PASS: TestAccPowershellProvisioner_basic (282.02s)
--- PASS: TestAccPowershellProvisioner_basic/testing_amazon-ebs_builder_against_powershell_provisioner (282.01s)                               PASS
ok      github.com/hashicorp/packer/provisioner/powershell 282.046s
```

Failing tests on master
```
2020/04/08 09:59:34 Uploading file to 'c:/Windows/Temp/script.bat'
2020/04/08 09:59:36 [INFO] starting remote command: set "PACKER_BUILDER_TYPE=amazon-ebs" && set "PACKER_BUILD_NAME=amazon-ebs"
&& "c:/Windows/Temp/script.bat"
2020/04/08 09:59:36 ui:     amazon-ebs:
2020/04/08 09:59:36 ui:     amazon-ebs: C:\Users\Administrator>dir C:\Windows\Temp\packer-*.ps1
2020/04/08 09:59:36 ui:     amazon-ebs:  Volume in drive C has no label.
2020/04/08 09:59:36 [INFO] command 'set "PACKER_BUILDER_TYPE=amazon-ebs"
&& set "PACKER_BUILD_NAME=amazon-ebs" && "c:/Windows/Temp/script.bat"' exited with code: 0
2020/04/08 09:59:36 ui:     amazon-ebs:  Volume Serial Number is 46CA-4083
2020/04/08 09:59:36 ui:     amazon-ebs:
2020/04/08 09:59:36 ui:     amazon-ebs:  Directory of C:\Windows\Temp
2020/04/08 09:59:36 ui:     amazon-ebs:
2020/04/08 09:59:36 ui:     amazon-ebs: 04/08/2020  01:59 PM 102 packer-acc-test-script-test.ps1
2020/04/08 09:59:36 ui:     amazon-ebs: 04/08/2020  01:59 PM 76 packer-acc-test-vars.ps1
2020/04/08 09:59:36 ui:     amazon-ebs:                2 File(s) 178 bytes
2020/04/08 09:59:36 ui:     amazon-ebs:                0 Dir(s) 9,735,806,976 bytes free
2020/04/08 09:59:36 ui: ==> amazon-ebs: Provisioning step had errors: Running the cleanup provisioner, if present...
2020/04/08 09:59:36 ui: ==> amazon-ebs: Terminating the source AWS instance...
2020/04/08 10:00:09 ui: ==> amazon-ebs: Cleaning up any extra volumes...
2020/04/08 10:00:09 ui: ==> amazon-ebs: No volumes to clean up, skipping
2020/04/08 10:00:09 ui: ==> amazon-ebs: Deleting temporary security group...
2020/04/08 10:00:10 ui: ==> amazon-ebs: Deleting temporary keypair...
2020/04/08 10:00:11 ui error: Build 'amazon-ebs' errored: Script exited
with non-zero exit status: 0.Allowed exit codes are: [1]
2020/04/08 10:00:11 machine readable: error-count []string{"1"}
2020/04/08 10:00:11 ui error:
==> Some builds didn't complete successfully and had errors:
2020/04/08 10:00:11 machine readable: amazon-ebs,error []string{"Script
exited with non-zero exit status: 0.Allowed exit codes are: [1]"}
2020/04/08 10:00:11 ui error: --> amazon-ebs: Script exited with
non-zero exit status: 0.Allowed exit codes are: [1]
```

test: Fix windows-shell command
2020-04-08 10:05:54 -04:00
Wilken Rivera 91c8afda8e provisioner/elevated: Add cleanup logic to remove elevated user scheduled task artifacts 2020-04-08 00:23:40 -04:00
Wilken Rivera 11db6014fa provisioner/powershell: Update remote clean up logic
* Add retry logic so that the provisioner will retry if it fails to upload/execute because of some restart provisioner step
* Add a testConfigWithSkipClean for testing that the provisioner executes the correct commands
* Add a test case for toggling the "skip_clean" config option
2020-04-08 00:23:40 -04:00
Wilken Rivera f6a61e2511 provisioner/powershell: Add post clean up step to remove temp script files 2020-04-08 00:23:40 -04:00
Wilken Rivera 3892e0905a Merge pull request #9022 from hashicorp/document_boot_wait
properly document how to set boot_wait to 0s
2020-04-08 00:10:34 -04:00
Megan Marsh 346dcae78e make generate 2020-04-07 17:01:23 -07:00
Megan Marsh 6fc3c4eb49 properly document how to set boot_wait to 0s 2020-04-07 16:43:33 -07:00
Megan Marsh 5b8113ab0f Merge pull request #9006 from hashicorp/provisioner_acc_contributing
Add how to write provisioner's acceptance tests to CONTRIBUTING docs
2020-04-07 16:02:16 -07:00
Megan Marsh 9ed6fab8c4 Merge pull request #8940 from hashicorp/je.new-website
New Docs Website!
2020-04-07 15:15:27 -07:00
Jeff Escalante cb298c8c90 linkcheck correction 2020-04-07 17:53:26 -04:00
Jeff Escalante 81b08898ba update generated pages after rebase 2020-04-07 17:53:26 -04:00
Jeff Escalante e5a6363f95 update deps, fix one-off pages 2020-04-07 17:53:26 -04:00
Jeff Escalante c0b511f682 new footer 2020-04-07 17:53:25 -04:00
Jeff Escalante f3a728abb2 remove unneeded file 2020-04-07 17:53:25 -04:00
Jeff Escalante 9d62c8b5a5 remove scripts 2020-04-07 17:53:25 -04:00
Jeff Escalante 23a5c472aa remove sidebar_current from front matter 2020-04-07 17:53:25 -04:00
Jeff Escalante bac9821016 remove lingering source files 2020-04-07 17:53:24 -04:00
Jeff Escalante 5719a0a806 add redirects section to readme 2020-04-07 17:53:24 -04:00
Jeff Escalante ce95bb1d70 fix newly added partial paths 2020-04-07 17:53:23 -04:00
Jeff Escalante 20e8481a7c add new generated partials after rebase 2020-04-07 17:53:23 -04:00
Jeff Escalante ccdb8ee62f add docker config 2020-04-07 17:53:23 -04:00
Jeff Escalante 860434141e patch dollar sign escaping issue 2020-04-07 17:53:23 -04:00
Jeff Escalante 6798b73305 revert prettier formatting on generated partials 2020-04-07 17:53:22 -04:00
Jeff Escalante 2999934326 fix generation script, bugfixes in source comments, update website paths in primary codebase 2020-04-07 17:53:22 -04:00
Jeff Escalante 9165be87da packer.io prefix removal, html extension remove for in-code errors 2020-04-07 17:53:22 -04:00
Jeff Escalante 7555536f7a a couple more broken links 2020-04-07 17:53:21 -04:00
Jeff Escalante 18511bab05 bunch more broken link fixes 2020-04-07 17:53:21 -04:00
Jeff Escalante af257c2bb9 fix all local relative links 2020-04-07 17:50:53 -04:00
Jeff Escalante bdd9f5bd08 another redirect fix 2020-04-07 17:50:52 -04:00
Jeff Escalante 20d3a2027f attempted redirects fix 2020-04-07 17:50:52 -04:00
Jeff Escalante 76b9b83721 update permalink styles, small homepage fix 2020-04-07 17:50:52 -04:00
Jeff Escalante 090df9c2b6 code block language cleanup 2020-04-07 17:50:52 -04:00
Jeff Escalante 23aba814e1 update to 1.5.5 2020-04-07 17:50:51 -04:00
Jeff Escalante 3f3e0f752c add packer segment key 2020-04-07 17:50:51 -04:00
Jeff Escalante 55df737179 add bugsnag tokens 2020-04-07 17:50:51 -04:00
Jeff Escalante 4afd107eeb patch source files for extensions changes 2020-04-07 17:50:51 -04:00
Jeff Escalante d626cedd45 remove unnecessary .html extensions 2020-04-07 17:50:51 -04:00
Jeff Escalante 86b6a4562b update deps, remove internal index.html's 2020-04-07 17:50:50 -04:00
Jeff Escalante 8ca9f2a58c add community page css 2020-04-07 17:50:50 -04:00
Jeff Escalante 8d917b6f77 patch a couple small bugs 2020-04-07 17:50:50 -04:00
Jeff Escalante 899c0fd8a9 homepage 2020-04-07 17:50:50 -04:00
Jeff Escalante f48529e6ff a variety of markdown fixes 2020-04-07 17:50:49 -04:00