Commit Graph

16960 Commits

Author SHA1 Message Date
teddylear d85286e228 Merging in master 2021-02-10 17:44:11 -05:00
Sylvia Moss d28e6fe009
write timestamp local only when necessary (#10602) 2021-02-10 14:54:19 +01:00
Sylvia Moss 1e889078fd
add regex and regexall functions (#10601) 2021-02-10 11:58:20 +01:00
Calle Pettersson 6c77d28537
proxmox: Fix additional_iso_files (#10586) 2021-02-10 10:59:44 +01:00
Megan Marsh 92f384b52f update changelog 2021-02-09 14:08:27 -08:00
Sylvia Moss 368ccfe7c9
add profitbricks code owners (#10596) 2021-02-09 11:29:24 -05:00
Adrien Delorme ffbb110167
Test running plugins with fake and fresh plugins (#10595)
* show error as to why plugin discovery failed
* allow to run more manual tests after a plugin installation
* test that a freshly installed external plugin can run
2021-02-09 17:07:59 +01:00
mflorin 9afaa5a21f
Profitbricks builder fixes (#10549) 2021-02-09 16:56:06 +01:00
Sylvia Moss f5006d0842
fix empty locals and source name with blank space (#10593) 2021-02-09 14:57:42 +01:00
Jessi 88c516b2d5
Add IMDSv2 support for AWS EBS builder (#10546) 2021-02-09 11:47:54 +01:00
Bryce Kalow d7bb60ea86
website: update next and nextjs-scripts (#10570)
website: update next and nextjs-scripts
2021-02-08 14:48:35 -06:00
Megan Marsh 08e67f8990
Merge pull request #10587 from hashicorp/azr_doc_init_less_highlights
Document init with less highlights
2021-02-08 11:09:04 -08:00
Wilken Rivera 8c3b3ca00f
Update website/content/docs/commands/init.mdx 2021-02-08 13:34:14 -05:00
Bryce Kalow 4a686ef66d chore: upgrade nextjs-scripts & next 2021-02-08 17:47:18 +00:00
Sylvia Moss f616955ebc
Fix issue when loading datasource single plugin type (#10589) 2021-02-08 13:58:35 +01:00
Adrien Delorme a1b2e71005
Update website/content/docs/commands/init.mdx
Co-authored-by: Sylvia Moss <moss@hashicorp.com>
2021-02-08 13:53:29 +01:00
Sylvia Moss d53488db68
Add aws_secretsmanager transformation to hcl2_upgrade (#10553) 2021-02-08 11:28:26 +01:00
Adrien Delorme b6cfe16444 Document the `PKR_GITHUB_API_TOKEN` setting in /configure#env vars 2021-02-08 10:59:04 +01:00
Adrien Delorme 4c02123142 init documentation: have less highlights and more text 2021-02-08 10:58:14 +01:00
teddylear d3754e3021 Updating recursive formatter tests to be cleaner and table driven 2021-02-06 18:02:26 -05:00
Adrien Delorme ab7e89781a empty commit to check if I can push 2021-02-06 18:02:26 -05:00
teddylear 40a97e29db Clean up recursive format tests to be more accurate 2021-02-06 18:02:26 -05:00
teddylear 93df53a275 Refactor recursive formatting test cases to be table driven 2021-02-06 18:02:26 -05:00
teddylear 6adf1f6659 Fixing recursive fmt tests syntax and adding test case when recursive
option is off
2021-02-06 18:02:26 -05:00
teddylear 261abe0cae Setting recursive fmt to false, updatting recursive fmt test to validate
formatted files
2021-02-06 18:02:26 -05:00
teddylear ab4b3a8465 Adding recursive flag to formatter to format subdirectories 2021-02-06 18:02:23 -05:00
Megan Marsh 13320650f0
document builder id of artifact for each builder's output on website (#10580)
* document builder id of artifact for each builder's output on website

* document postprocessor artifact ids on website

* Fix links to new communicator page

Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
2021-02-05 19:49:28 -05:00
Megan Marsh 2324f433f7
Merge pull request #10579 from hashicorp/fix-single-plugin-loading
Fix issue when loading single plugin type `packer-provisioner-comment` built with latest SDK
2021-02-05 14:06:27 -08:00
Megan Marsh ece5e94c3d
remove dev line (#10578) 2021-02-05 16:47:41 -05:00
Wilken Rivera ad239bd2b9
Fix markdown link checker issues (#10575)
* Remove exclusions for docs on master

* Update extending redirects with new page locations

* Update documentation links for SaltStack
2021-02-05 16:46:53 -05:00
Wilken Rivera 39d550054d Fix lint errors 2021-02-05 16:46:24 -05:00
Wilken Rivera ef4d35097b Fix issue when loading single plugin type
This changes wraps the plugin client start call with an anonymous function so that Packer starts a
new plugin for each occurrence of a particular plugin block.

Before only one subprocess was being created causing subsquent calls to fail as it was trying start
an already started plugin subprocess.

Before Change
```
???????: failed loading comment: error dial unix /tmp/packer-plugin358226172: connect: no such file or directory
2021/02/05 16:09:13 On error:
2021/02/05 16:09:13 Waiting on builds to complete...

2021/02/05 16:09:13 Starting build run: null.basic-example
2021/02/05 16:09:13 Running builder:
2021/02/05 16:09:13 [INFO] (telemetry) Starting builder
  on examples/basic-example.pkr.hcl line 29:
  (source code not available)

dial unix /tmp/packer-plugin358226172: connect: no such file or directory

???????: failed loading comment: error dial unix /tmp/packer-plugin358226172: connect: no such file or directory

2021/02/05 16:09:13 packer.test plugin: [INFO] communicator disabled, will not connect
2021/02/05 16:09:13 packer.test plugin: Unable to load communicator config from state to populate provisionHookData
  on examples/basic-example.pkr.hcl line 38:
2021/02/05 16:09:13 packer.test plugin: Running the provision hook
  (source code not available)

dial unix /tmp/packer-plugin358226172: connect: no such file or directory

???????: failed loading comment: error dial unix /tmp/packer-plugin358226172: connect: no such file or directory

  on examples/basic-example.pkr.hcl line 42:
  (source code not available)

2021/02/05 16:09:13 [INFO] (telemetry) Starting provisioner comment
dial unix /tmp/packer-plugin358226172: connect: no such file or directory
```

After change
```

null.basic-example: output will be in this color.

==> null.basic-example:   ____                   _
==> null.basic-example:  | __ )    ___    __ _  (_)  _ __
==> null.basic-example:  |  _ \   / _ \  / _` | | | | '_ \
==> null.basic-example:  | |_) | |  __/ | (_| | | | | | | |
==> null.basic-example:  |____/   \___|  \__, | |_| |_| |_|
==> null.basic-example:                  |___/
==> null.basic-example:
==> null.basic-example: Running local shell script: /tmp/packer-shell646549657
    null.basic-example: This is a shell script
==> null.basic-example: Pausing at breakpoint provisioner.
==> null.basic-example: Press enter to continue.
==> null.basic-example: In the middle of Provisioning run
==> null.basic-example: Running local shell script: /tmp/packer-shell177279484
    null.basic-example: This is another shell script
==> null.basic-example:   _____               _
==> null.basic-example:  | ____|  _ __     __| |
==> null.basic-example:  |  _|   | '_ \   / _` |
==> null.basic-example:  | |___  | | | | | (_| |
==> null.basic-example:  |_____| |_| |_|  \__,_|
==> null.basic-example:
Build 'null.basic-example' finished after 1 second 32 milliseconds.

==> Wait completed after 1 second 32 milliseconds

==> Builds finished. The artifacts of successful builds are:
--> null.basic-example: Did not export anything. This is the null builder
 Please enter the commit message for your changes. Lines starting
```
2021-02-05 16:35:01 -05:00
Megan Marsh a63ad19b0c
Merge pull request #10577 from hashicorp/fix_build_run_diags
plugin loading failure should be considered an error so build will no…
2021-02-05 13:31:40 -08:00
Megan Marsh ca123721a6 plugin loading failure should be considered an error so build will not try to run 2021-02-05 11:06:52 -08:00
Alex Chan 540effbbc0
Correct the spelling of heirarchical/hierarchical (#10576) 2021-02-05 16:32:28 +01:00
Adrien Delorme 692433721d
Add some acceptance testing for Packer init commands (#10566) 2021-02-05 14:06:28 +01:00
Adrien Delorme 0f34592daa
packer init doc clarification (#10558)
* Packer has no state like Terraform has

* init command docs: tell where a plugin will be installed

* docs: add a note that packer init does not work with legacy JSON templates

* docs: add a not that packer init does not install single-plugin binaries

* the plugin getter => packer init

* Update init.mdx

* grammar

* link to how to install plugins manually

* Update website/content/docs/commands/init.mdx

Co-authored-by: Sylvia Moss <moss@hashicorp.com>

* Update website/content/docs/commands/init.mdx

Co-authored-by: Sylvia Moss <moss@hashicorp.com>

Co-authored-by: Sylvia Moss <moss@hashicorp.com>
2021-02-05 13:26:58 +01:00
Megan Marsh ba1ad9ea15
Vsphere example update (#10574)
* fix ubuntu json template example

* add hcl template example

* add hcl alpine example

* add hcl versions of alpine and macos; update macos json

* add hcl version of windows template, call fix on windows json
2021-02-05 13:21:29 +01:00
Sylvia Moss ef4afafde9
Fix force flag for hcl2 provisioners and post-processors (#10571) 2021-02-05 10:57:14 +01:00
Adrien Delorme f588c46fb6
add some docs for the cache dir (#10568) 2021-02-05 10:56:03 +01:00
Adrien Delorme 1075120109
use the SDK version 0.0.11 (#10572) 2021-02-04 17:52:40 +01:00
Sylvia Moss 3ddb17ad86
Don't allow data sources to be used inside data sources (#10559) 2021-02-04 11:25:44 +01:00
Adrien Delorme 92ccd5fa1d
init: show successful installs in cyan (#10557) 2021-02-04 11:11:42 +01:00
Wilken Rivera 8ccd164f25
Update diagnostic detail to display list of PostProcessors (#10564) 2021-02-04 10:56:59 +01:00
Adrien Delorme ed091163be
HCL2 Parse packer.required_plugins block + packer init (#10304)
This adds the new `required_plugins` block to be nested under the packer block.

Example:
```hcl
packer {
  required_plugins {
    aws = {
      version = ">= 2.7.0"
      source = "azr/aws"
    }
    azure = ">= 2.7.0"
  }
}
```

For example on darwin_amd64 Packer will install those under :
* "${PACKER_HOME_DIR}/plugin/github.com/azr/amazon/packer-plugin-amazon_2.7.0_x5.0_darwin_amd64"
* "${PACKER_HOME_DIR}/plugin/github.com/hashicorp/azure/packer-plugin-azure_2.7.0_x5.0_darwin_amd64_x5"

+ docs
+ tests
2021-02-02 18:05:04 +01:00
Megan Marsh ac014fc1c3
Merge pull request #10542 from MarckK/tags
edit examples of docker tags for post processor hcl syntax to be array of strings
2021-01-29 11:29:46 -08:00
Kara de la Marck 61f03cc137 docs: fix instructions to show docker tags for post processor hcl syntax as array of strings 2021-01-29 18:58:13 +00:00
Megan Marsh 18970bfbe4
Merge pull request #10534 from timblaktu/patch-1
Improve Documentation for Build-level Source Block
2021-01-27 14:01:47 -08:00
Tim Black 300604675b
Improve Documentation for Build-level Source Block
The docs for top-level and build-level source blocks did not make it clear enough, early enough in the page, how packer merges their contents and fails when ambiguities  arise from redefinition. I know the info it there, but it's at the end and I feel that my modification shortens the page overall while putting the most useful info front and center. 

Also, there is simply an error in the note at the end of this page, which further confuses the situation for new readers trying to use HCL and reuse source blocks. It's referring to a non-existent amazon source which is probably a past copy/paste error. 

It took me a day to get re-usable source blocks working, bc I skimmed the page at first (I know slap my wrist), but didn't really grasp what it was saying in the Note at the end, and found it confusing. It wasn't until I found the Issues and PRs related to this feature getting added last April/May that I realized how it was implemented that I started to grasp what this was saying.
2021-01-27 11:12:42 -08:00
Wilken Rivera f36554fa0e
Update redirects and URLs to legacy JSON template docs (#10530) 2021-01-27 09:08:59 -05:00