Commit Graph
18303 Commits
Author SHA1 Message Date
Laura Pacilio 0c908a3a75 Remove Beta language from HCP packer data sources pages 2022-03-03 18:29:53 -05:00
Wilken Rivera 2ea4c38c35 Bump Go version 2022-03-03 17:31:53 -05:00
Wilken Rivera 46275de04f Update CHANGELOG 2022-03-03 17:31:36 -05:00
Wilken Rivera ea3c73a480 Set default file extension for binary installations on Windows (#11625)
This change sets the default file extension for binary installations on
Windows.

Results before change
```
$ packer plugins install github.com/hashicorp/amazon
9 errors occurred:
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_freebsd_arm64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_darwin_amd64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_freebsd_amd64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_linux_amd64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_darwin_arm64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_windows_arm64.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_windows_386.zip: wrong system, expected windows_amd64
        * ignoring invalid remote binary packer-plugin-amazon_v1.0.8_x5.0_linux_arm.zip: wrong system, expected windows_amd64
        * could not find a packer-plugin-amazon_v1.0.8_x5.0_windows_amd64.zip file in zipfile

exit status 1
```

Results after change
```
$ packer plugins install github.com/hashicorp/amazon
Installed plugin github.com/hashicorp/amazon v1.0.8 in "C:/Users/Packer/AppData/Roaming/packer.d/plugins/github.com/hashicorp/amazon/packer-plugin-amazon_v1.0.8_x5.0_windows_amd64.exe"
```
2022-03-03 17:30:27 -05:00
Pamela Bortnick bf1b550e95 Add expiration date to banner 2022-03-03 12:43:25 -05:00
Wilken Rivera 70806cb27e Bump version for 1.8.0 release 2022-03-03 12:07:10 -05:00
Wilken Rivera 8dbde0fb38 Update CHANGELOG 2022-03-03 12:00:01 -05:00
Pamela Bortnick a2f8fc776e Update url 2022-03-03 10:50:22 -05:00
Pamela Bortnick 84a38a5d34 Change hero cta 2022-03-03 10:50:10 -05:00
Sylvia Moss c15d3a2e89 remove iteration revocation check (#11624) 2022-03-03 14:45:19 +01:00
Adrien Delorme 0ed3e1529c Add reference and link to the plugins command docs in the manual install part (#11620)
* Update installing-plugins.mdx

add reference and link to the plugins command docs
2022-03-02 12:07:01 -05:00
Wilken Rivera 28f8d86d7d Update CHANGELOG 2022-03-02 10:49:24 -05:00
Sylvia Moss 5135d68b5f do not fail for scheduled revocation (#11619) 2022-03-02 15:39:17 +01:00
Wilken Rivera bdaa03be31 Update monogo-driver to address CVE-2021-20329 (#11617) 2022-03-02 15:23:54 +01:00
Wilken Rivera ba8c468a72 [CI] Add publish-release step to nightly release workflow (#11618)
In reviewing the results of the nightly release workflow it was found
that upon creating the release it was successfully marked as a
prerelease. But it still needed to be manually publish as an official
prerelease. This change adds a new action to publish the created
release, as the last step.
2022-03-02 13:23:38 +01:00
Wilken Rivera 5fa0028f37 Update documenation links for community plugins (#11613)
* Remove plugin docs bering remoted ingested from community list

* Update plugin link
2022-03-01 21:04:46 -05:00
Michele Degges a0089ae808 Remove setup-go from get-product-version CI job (#11608) 2022-03-01 11:30:37 +01:00
Michele Degges 0ecba941e2 Remove nightly release draft (#11611) 2022-03-01 11:28:18 +01:00
Michele Degges 9a7a9dc7b1 Add workflow_dispatch caller to nightly_release job (#11610) 2022-02-28 17:15:45 -08:00
Michele Degges c279bbb5f2 CI fix docker build job for nightly release failure (#11609) 2022-02-28 16:45:35 -08:00
Pamela Bortnick e6b242b8eb Delete console log 2022-02-28 14:46:30 -05:00
Pamela Bortnick 4d7dbba904 Add alert banner to site 2022-02-28 14:46:05 -05:00
Wilken Rivera 4b5869f210 Update CHANGELOG 2022-02-28 14:27:17 -05:00
Michele Degges 1506fef7d4 Fix docker build for workflow_call events (#11603) 2022-02-28 09:46:46 -08:00
Johanan LiebermannandAdrien Delorme f8ea98d671 Add missing closing parenthesis (#11599)
* Add missing closing parenthesis

Signed-off-by: Johanan Liebermann <[email protected]>
Co-authored-by: Adrien Delorme <[email protected]>
2022-02-28 15:57:57 +01:00
Adrien Delorme f2a36af98e remove packer-plugin-check command (#11317)
⚠️ to merge only once all plugins stop using this
2022-02-26 13:02:20 -05:00
Michele Degges b4ea5cff07 Fix linux packaging CI step on workflow_call events (#11601) 2022-02-25 17:29:06 -08:00
Michele Degges 29e734ef1c Fix readme build badge (#11600) 2022-02-25 19:58:52 -05:00
b63a9c9803 Onboard to CRT (#11564)
Onboard Packer to CRT

Co-authored-by: Wilken Rivera <[email protected]>
Co-authored-by: Claire Labry <[email protected]>
2022-02-25 15:56:20 -08:00
Wilken RiveraandSylvia Moss dd525fb814 Update HCP Packer build labels when re-running Packer on an incomplete build (#11584)
* Update HCP Packer build labels argument

Previously when running a partial build on multi-cloud build template it
was found that build labels were only being applied at the creation for
the partially executed build. Leaving all other completed builds with
no HCP Packer build labels. This updates how incomplete builds are
loaded from the registry and ensure that any defined
hcp_packer_registry.build_labels are assigned to the build before
starting an actual Packer build.

Related to: #11573

* Add test case for overwriting build labels

* Update tests to call CreateInitialBuild for non-existing builds

* Rename test case to TestBucket_PopulateIteration

* Fix data race in PopulateIteration against mock service

Before Change
```
WARNING: DATA RACE
Write at 0x00c0005421b0 by goroutine 47:
  github.com/hashicorp/packer/internal/registry.(*MockPackerClientService).PackerServiceCreateBuild()
      /Users/scrubbed/Development/packer/internal/registry/mock_service.go:173 +0x2b6
  github.com/hashicorp/packer/internal/registry.(*Client).CreateBuild()
      /Users/scrubbed/Development/packer/internal/registry/service.go:169 +0x592
  github.com/hashicorp/packer/internal/registry.(*Bucket).CreateInitialBuildForIteration()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:107 +0x204
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration.func1()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:368 +0x14e
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration·dwrap·1()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:376 +0x58

Previous write at 0x00c0005421b0 by goroutine 46:
  github.com/hashicorp/packer/internal/registry.(*MockPackerClientService).PackerServiceCreateBuild()
      /Users/scrubbed/Development/packer/internal/registry/mock_service.go:173 +0x2b6
  github.com/hashicorp/packer/internal/registry.(*Client).CreateBuild()
      /Users/scrubbed/Development/packer/internal/registry/service.go:169 +0x592
  github.com/hashicorp/packer/internal/registry.(*Bucket).CreateInitialBuildForIteration()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:107 +0x204
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration.func1()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:368 +0x14e
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration·dwrap·1()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:376 +0x58

Goroutine 47 (running) created at:
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:362 +0x5c7
  github.com/hashicorp/packer/internal/registry.TestBucket_UpdateLabelsForBuild_withMultipleBuilds()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket_test.go:179 +0xf7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47

Goroutine 46 (finished) created at:
  github.com/hashicorp/packer/internal/registry.(*Bucket).PopulateIteration()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket.go:362 +0x5c7
  github.com/hashicorp/packer/internal/registry.TestBucket_UpdateLabelsForBuild_withMultipleBuilds()
      /Users/scrubbed/Development/packer/internal/registry/types.bucket_test.go:179 +0xf7
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1259 +0x22f
  testing.(*T).Run·dwrap·21()
      /usr/local/go/src/testing/testing.go:1306 +0x47
==================
```

* Add methods for managing builds on an Iteration

* Update Mock Service to be a bit more concurrent

It is a simple set of changes to make it work for the current testing
use cases. If we need to we can move the Called fields to counters or
re-architect the mock.

This change also fixes a race condition when appending to the Slice of
errs when calling PopulateIteration.

* Update test case descriptions

* Apply suggestions from code review

Only append to errs if err is not nil

Co-authored-by: Sylvia Moss <[email protected]>

* Fix linting issues

Co-authored-by: Sylvia Moss <[email protected]>
2022-02-25 15:50:41 -05:00
Wilken Rivera 0a7dbb65a3 Update CODEOWNERS
Codeowners for external plugins are tracked within the respective
plugin repo.
2022-02-25 14:25:26 -05:00
Pekka NurmiandWilken Rivera a4450adc54 Add UpCloud plugin documentation (#11587)
* Add UpCloud plugin documentation

* Update UpCloud plugin repository path

* Add sourceBranch to UpCloud plugin description

* Alphabetically sort plugin

Co-authored-by: Wilken Rivera <[email protected]>
2022-02-25 11:26:34 -05:00
Johanan Liebermann a66a15bd35 Add missing closing parenthesis (#11593)
Signed-off-by: Johanan Liebermann <[email protected]>
2022-02-25 11:09:56 -05:00
Zachary Shilton de613d297f website: bump docs-page to fix manual copy issue (#11538)
* website: bump docs-page to fix manual copy issue

* chore: pin to latest docs-page pre-release as fix demo

* chore: bump to latest pre-release

* chore: bump to latest docs-page
2022-02-24 15:07:54 -05:00
Wilken Rivera f204f19e06 Update CHANGELOG 2022-02-24 12:27:00 -05:00
Ygal Blum 30813e743d Fix secret name to GPG_PASSPHRASE (#11586) 2022-02-24 10:53:23 -05:00
Wilken Rivera 119a825296 Update CreateIntialBuildForIteration to initialize each build its own map (#11574)
* Rename mock bucket test file

* Add failing tests for reproducing #11573

```
=== RUN   TestBucket_CreateInitialBuildForIteration
2022/02/16 16:22:21 [TRACE] creating initial build for component happycloud.image
--- PASS: TestBucket_CreateInitialBuildForIteration (0.00s)
=== RUN   TestBucket_UpdateLabelsForBuild
2022/02/16 16:22:21 [TRACE] creating initial build for component happycloud.image
    types.bucket_test.go:87: expected the initial build to have an additional build label but thee is no diff: ""
--- FAIL: TestBucket_UpdateLabelsForBuild (0.00s)
=== RUN   TestBucket_UpdateLabelsForBuild_withMultipleBuilds
2022/02/16 16:22:21 [TRACE] creating initial build for component happycloud.image
2022/02/16 16:22:21 [TRACE] creating initial build for component happycloud.image2
    types.bucket_test.go:125: Comparing component build labels: map[based_off:alpine source_image:another-happycloud-image version:1.7.0]
         against global build labels: map[based_off:alpine source_image:another-happycloud-image version:1.7.0]
    types.bucket_test.go:128: expected the initial build to have an additional build label but they are equal
    types.bucket_test.go:125: Comparing component build labels: map[based_off:alpine source_image:another-happycloud-image version:1.7.0]
         against global build labels: map[based_off:alpine source_image:another-happycloud-image version:1.7.0]
    types.bucket_test.go:128: expected the initial build to have an additional build label but they are equal
--- FAIL: TestBucket_UpdateLabelsForBuild_withMultipleBuilds (0.00s)
FAIL
FAIL    github.com/hashicorp/packer/internal/registry   0.646s

```

* Update CreateIntialBuildForIteration to initialize each build with a new map

Previously upon creating the initial build the same map, which was
initialized for the build_labels argument was being shared across all
build images. This was causing an issue with labels being backed by the
same map for all builds. This change ensures that all builds get their
own map with any global build labels copied over during the initial creation.

Closes #11573

Passing tests with changes on branch
```
RUN   TestBucket_CreateInitialBuildForIteration
2022/02/16 16:37:40 [TRACE] creating initial build for component happycloud.image
--- PASS: TestBucket_CreateInitialBuildForIteration (0.00s)
=== RUN   TestBucket_UpdateLabelsForBuild
2022/02/16 16:37:40 [TRACE] creating initial build for component happycloud.image
--- PASS: TestBucket_UpdateLabelsForBuild (0.00s)
=== RUN   TestBucket_UpdateLabelsForBuild_withMultipleBuilds
2022/02/16 16:37:40 [TRACE] creating initial build for component happycloud.image
2022/02/16 16:37:40 [TRACE] creating initial build for component happycloud.image2
    types.bucket_test.go:125: Comparing component build labels: map[based_off:alpine source_image:another-happycloud-image version:1.7.0]
         against global build labels: map[based_off:alpine version:1.7.0]
    types.bucket_test.go:125: Comparing component build labels: map[based_off:alpine source_image:the-original-happycloud-image version:1.7.0]
         against global build labels: map[based_off:alpine version:1.7.0]
--- PASS: TestBucket_UpdateLabelsForBuild_withMultipleBuilds (0.00s)

```

* Handle errors from bucket methods

* Update test cases

Initialize maps for bucket when calling NewBucketWithIteration
2022-02-22 15:34:09 -05:00
Wilken Rivera df5699c10d Rename integration program documentation (#11570) 2022-02-18 10:01:59 -05:00
Adrien Delorme 0362a3ec10 all shells: Pass env vars through a key value store (#11569)
* allowing to set shell env vars from a key/value map.
* tests

This new map will work alongside the `environment_vars` but it allows using a
datasource value seamlessly. At validation, and because `environment_vars` was
an array of strings containing `KEY=value`, using datsources would not work,
because these values are not known yet and would evaluate to `<unknown>`. With
this, the value and the key can be unknown and will validate correctly for
datasources.
2022-02-16 12:05:44 +01:00
Michael Weibel f718dbdcc0 docs: add link to builder list (#11571)
browsing through the documentation I was searching for the list of builders available. The obvious choice (builders page) didn't link to the list of builders and it took me a few minutes to find that. Adding a link to the plugins might speed up that bit and would avoid having to rescue to the search engine.
2022-02-16 11:39:04 +01:00
Adrien DelormeandWilken Rivera e03ad29ca0 Sanitize var code (#11566)
* evaluateLocalVariables: modify code for readability and some (not benchmarked) perfs

* Make default input variable type the DynamicPseudoType

This should be the default, and avoids a panic. This type can represent situations where a type is not yet known. Its meaning is undefined in cty.

* do not take Empty types from default value

* Update types.variables.go

Co-authored-by: Wilken Rivera <[email protected]>
2022-02-14 11:00:41 -05:00
Adrien Delorme 19fc5added Allow to parse pgp signed checksums (#11495)
* get go-getter with comment ignore in checksum files

* get github.com/hashicorp/go-getter/v2 v2.0.1
2022-02-11 15:02:26 -05:00
9f4a1281dd Add packer plugins command and subcommands to interact with plugins (#11553)
* add basic docs for plugins command

* refactor docs

Co-Authored-By: Wilken Rivera <[email protected]>

* add plugins command

* add plugins subcommands

they do nothing for now

* add plugins installed command + tests

* add plugins install command

* add remove plugin command

* better docs for the plugins install command

* remove duplicate content

* better output for installed plugins

* add plugins required command

* Update plugins_install.go

* add newline after `Usage:`

* Update plugins_remove.go

* Update plugins_required.go

* Update plugins_remove.go

* Update plugins_installed.go

* Update plugins_install.go

* add docs

* Update plugins_install.go

* fix typos

* Update plugins_test.go

* fix typos

Co-Authored-By: Wilken Rivera <[email protected]>

* Update core_wrapper.go

Co-Authored-By: Wilken Rivera <[email protected]>

* Update website/content/docs/commands/plugins/remove.mdx

Co-authored-by: Wilken Rivera <[email protected]>

* Update website/content/docs/commands/plugins/required.mdx

Co-authored-by: Wilken Rivera <[email protected]>

* Update website/content/docs/commands/plugins/required.mdx

Co-authored-by: Wilken Rivera <[email protected]>

* Update plugins_required.go

* Update install.mdx

* Update required.mdx

* plugins requirement, warn when no plugin was found

* Update website/content/docs/commands/plugins/required.mdx

Co-authored-by: Wilken Rivera <[email protected]>

Co-authored-by: Wilken Rivera <[email protected]>
Co-authored-by: Wilken Rivera <[email protected]>
2022-02-10 16:53:50 -05:00
jugglinmike 759cadaf0d Correct typo (#11555) 2022-02-09 15:19:01 -05:00
Kevin Wang 833bd51448 chore(website): bump @hashicorp/platform-cli (#11549) 2022-02-03 11:29:57 -05:00
Wilken Rivera 2ad15617cc core/hcl2: Fix issue preventing builds from pausing between provisioners when the --debug argument has been passed (#11537)
* Update HCL2 PackerConfig to call SetDebug mode for CoreBuild when --debug flag is passed

```
~>  packer build --debug /tmp/source.pkr.hcl
Debug mode enabled. Builds will not be parallelized.
null.example: output will be in this color.

==> null.example: Pausing after run of step 'StepConnect'. Press enter to continue.
==> null.example: Pausing before the next provisioner . Press enter to continue.
==> null.example: Running local shell script: /var/folders/vz/rv7bk6v15211jxg8q801f7kw0000gq/T/packer-shell4149319610
    null.example: hi
==> null.example: Pausing before the next provisioner . Press enter to continue.
==> null.example: Running local shell script: /var/folders/vz/rv7bk6v15211jxg8q801f7kw0000gq/T/packer-shell3210691290
    null.example: hi 2
==> null.example: Pausing after run of step 'StepProvision'. Press enter to continue.
==> null.example: Pausing before cleanup of step 'StepProvision'. Press enter to continue.
==> null.example: Pausing before cleanup of step 'StepConnect'. Press enter to continue.
Build 'null.example' finished after 8 seconds 284 milliseconds.

==> Wait completed after 8 seconds 284 milliseconds

==> Builds finished. The artifacts of successful builds are:
--> null.example: Did not export anything. This is the null builder
```

* Add call to SetOnError, and SetForce
2022-02-03 09:03:11 -05:00
packer-ci f0e7edd62d Putting source back into Dev Mode 2022-02-02 22:42:15 +00:00
packer-ci fa0f6e6fdc Cut version 1.7.10 v1.7.10 2022-02-02 22:01:38 +00:00
packer-ci 661b85e18c cut version 1.7.10 2022-02-02 22:01:36 +00:00
packer-ci 8b35473005 update changelog 2022-02-02 22:01:36 +00:00