Commit Graph
18119 Commits
Author SHA1 Message Date
Ashlee M Boyer a4153443c8 Reverting changes 2023-01-27 17:24:30 -05:00
Ashlee M Boyer 901a58fff2 Revert workflow change 1 of 2 2023-01-27 17:19:29 -05:00
Ashlee M Boyer fe8864e72b Making md change to trigger workflow 2023-01-27 16:58:29 -05:00
Ashlee M Boyer a858e17393 Testing workflow fixes 2023-01-27 16:56:37 -05:00
Ashlee M Boyer 8ac4763b28 Testing link checker workflow update 2023-01-27 16:23:50 -05:00
Kendall Strautman 1feff93791 Update community-tools.mdx 2023-01-27 14:32:51 -05:00
50da6c8dc8 docs: Migrate link formats (#12192)
* Adding check-legacy-links-format workflow

* Adding test-link-rewrites workflow

* Migrating links to new format

* Updating docs-content-check-legacy-links-format hash

* chore: update source

* Update generated partials from Packer plugin SDK

* Bump packer-plugin-sdk to get latest packer-sdc

* Update website/content/docs/templates/hcl_templates/blocks/build/provisioner.mdx

* Update Plugin SDK to fix shell-local regression

---------

Co-authored-by: Kendall Strautman <[email protected]>
Co-authored-by: Wilken Rivera <[email protected]>
Co-authored-by: Kendall Strautman <[email protected]>
2023-01-27 09:47:08 -08:00
dependabot[bot] 15a3e4f5fb build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.29.0 to 0.31.0
Bumps [github.com/hashicorp/hcp-sdk-go](https://github.com/hashicorp/hcp-sdk-go) from 0.29.0 to 0.31.0.
- [Release notes](https://github.com/hashicorp/hcp-sdk-go/releases)
- [Changelog](https://github.com/hashicorp/hcp-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcp-sdk-go/compare/v0.29.0...v0.31.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcp-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-25 21:19:47 -05:00
Lucas Bajolet ec1d2e68f5 hcp: generate fingerprints on each new build
Fingerprints are how we link a packer build to an iteration on HCP.
These are computed automatically from the Git SHA in the current state,
and are unique to the bucket/iteration.

The main problem with this approach is that while sound in theory, it
quickly falls apart when users want to run the same build configuration
twice, but expect a new image to be created.

With the current model, this fails, as the iteration with the current
SHA already exists.

While this is solvable through environment variables, or by committing a
change to the repository, we think this is not clear enough, and causes
an extra step to what should otherwise be a simple process.

Therefore, to lower the barrier of entry into HCP, we change this
behaviour with this commit.

Now, fingerprints are randomly generated ULIDs instead of a git SHA, and
a new one is always generated, unless one is already specified in the
environment.

This makes continuation of an existing iteration a conscious choice
rather than something automatic, and virtually eliminates conflicts such
as the ones described above.
2023-01-25 15:29:26 -05:00
Lucas Bajolet 73482bb636 internal: remove unused Labels on Iteration
The iteration structure that we use for linking a packer build to an
iteration on HCP defines a `Labels' attribute, which is never set nor
read from at any point.

Since it is unused, we remove it in this commit.
2023-01-25 15:29:26 -05:00
lonegunmanb 6137745cc1 Update variables documentation to refer to Packer not Terraform (#12220) 2023-01-25 10:39:33 -05:00
Wilken Rivera ad640c4224 Unpin Outscale documentation version 2023-01-24 18:39:17 -05:00
Wilken Rivera da455bdd09 Add HCP Ready label to Oracle plugin in preparation for 1.0.4 release 2023-01-24 15:52:21 -05:00
Wilken Rivera 4ca37bae86 Add a small sleep to calm the machines 2023-01-24 11:23:01 -05:00
Wilken Rivera 5081a5f24a Update nightly-release.yml 2023-01-24 11:23:01 -05:00
lonegunmanb ba546eb8cb correct document issue in provisioner block doc (#12210) 2023-01-24 10:21:54 -05:00
craigpero 38d0bc818d Update index.mdx
In trying the example, I found that you have to type "*.second-example" for the expected results.   I took the command line on line #78 literal and it didn't work as typed. When I used my proposed change... it worked for me.
Alternatively, "*.second*" works but that could grab builders that were not intended.
2023-01-20 14:53:53 -05:00
dependabot[bot] 6e96b9e10f build(deps): bump json5 from 1.0.1 to 1.0.2 in /website (#12185)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-19 14:03:15 -05:00
claire labry 0d94e7d753 Introduce action-set-product-version for Packer (#12135)
This change introduces the new actions-set-product-version, a tiny, but mighty, GitHub action that acts as a bridge between the product repo and our new CRT feature: automated version bumping.

tl;dr automated version bumping has a new command (bob update version) in the bob CLI that automatically bumps the version to a new patch. This automation has been introduced to crt-workflows-common as a new workflow (with the new bob command) and handles version bumping at the end of the release pipeline (after being released to production); for example, 1.0.0→1.0.1 and 1.0.0-dev→1.0.0. Bumping the minor version (ie 1.0.x→1.1.0) is only supported manually via bob update version -bump minor, but not supported in CRT (this work is upcoming). This is made possible by adding the new event “bump-version” in the ci.hcl file in this PR.

What this small action does:

    Allows for the static version string from the version/VERSION file to be read by the new CRT workflow and automagically be bumped to the next version (whether it be a minor, or patch, or major version bump).
    Outputs an error if there’s no VERSION file in the version dir
    Outputs an error if there’s no version string in the VERSION file
    Is able to parse product_version if it is 1.3.0-alpha1 as 1.3.0 (example: when product_version = 1.3.0-alpha1, base_version = 1.3.0)
    Is able to parse prerelease product versions such as alpha1 (example prerelease_product_version = alpha1) in the statement above.
2023-01-19 14:02:09 -05:00
Gary McDonald 86a6044577 Fix the spelling of several words within the README.md stored in the website/ project directory. (#12197)
Signed-off-by: Gary McDonald <[email protected]>

Signed-off-by: Gary McDonald <[email protected]>
2023-01-19 14:00:45 -05:00
dependabot[bot] 7ae61cbe43 build(deps): bump tomhjp/gh-action-jira-search from 0.2.1 to 0.2.2
Bumps [tomhjp/gh-action-jira-search](https://github.com/tomhjp/gh-action-jira-search) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/tomhjp/gh-action-jira-search/releases)
- [Commits](https://github.com/tomhjp/gh-action-jira-search/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: tomhjp/gh-action-jira-search
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-01-19 13:59:20 -05:00
Wilken Rivera bafe915b9e Add PACKER_GITHUB_API_TOKEN to fix failures due to API rate limiting
In response to https://github.com/hashicorp/packer/actions/runs/3954018806/jobs/6770905412
2023-01-19 13:58:37 -05:00
Mariano Asselborn ab55430b17 RELENG-305: add VBA automation to create new release branches 2023-01-16 10:52:54 -05:00
Ashlee Boyer b46fafe871 Updating old learn link 2023-01-16 09:38:53 -05:00
Ashlee Boyer 09ec2fc5bf Updating link to use cases docs page 2023-01-16 09:38:53 -05:00
Lucas Bajolet 4d559e23b7 hcl2: don't warn on excluded post-processor (#12187)
* hcl2template: use && for chaining conditions

For deciding if we need to run an error provisioner block, we checked
using a nested if that we didn't need to avoid running it.

This is unnecessary, and adds a superfluous level of inbrication to the
code, so we chain both conditions with &&.

* hcl2: don't warn on excluded post-processor

When a post-processor is excluded through the -except command-line
argument for packer build, we used to print a warning on HCL2 templates
if this except statement did not match a build.

However, since we can use the except option to avoid running
post-processors, we should account for this as well when printing out a
warning that there were no matches.

This commit adds this counter to the except checks for the
post-processors as well.
2023-01-11 14:30:02 -05:00
Lucas Bajolet ca197afe9b hcp: remove superfluous return value on GetBuilds
This commit irons out one of the pain points of the HCP rework by
introducing a HCPPublisher interface, implemented both by the JSON Core,
and the HCL2 PackerConfig, which keeps a map of the build names used by
Packer to the build names pushed on HCP.

This in turn lets us go back to the old implementation of the GetBuilds
function, which returns a list of (filtered) builds, and eventually an
error if something went wrong while processing.
2022-12-22 16:06:34 -05:00
Lucas Bajolet 2200cb14ce hcp: set the status to CANCELLED when a build is
Related to the previous behaviour problem, this changes how the status
of a build is set on HCP Packer, as a cancelled build is different from
a failed one, we can set it to the appropriate state on cancellation.
2022-12-22 15:20:33 -05:00
Lucas Bajolet f8bc240b02 core: CoreBuild.Run error on cancelled builds
When a build is cancelled by a user, the current implementation of
CoreBuild.Run does not return an error signifying that there was a
problem with the build.

This in turn causes the HCP code to attempt to update the status of the
build to DONE, but fails because there are no artifacts to push.

This commit changes this behaviour by returning the error provoked by
the cancellation to the caller, so it can be taken into account when
setting the status of the build.
2022-12-22 15:20:33 -05:00
Wilken Rivera ea1d32e456 Update CHANGELOG 2022-12-21 16:02:21 -05:00
Wilken Rivera 56f784ae95 Bump github.com/hashicorp/go-getter/v2 (#12161)
The latest version of Go-Getter contains a SMBClient timeout option,
along with an updated AWS SDK to improve S3 support.

```
go get github.com/hashicorp/go-getter/v2
go get github.com/hashicorp/go-getter/s3/v2
go get github.com/hashicorp/go-getter/gcs/v2
go mod tidy
```
2022-12-20 15:38:12 -05:00
Wilken Rivera 9002ac263f Update BuildBlock with valid HCL2Ref (#12167)
While looking into #11932 I found that Packer will throw an error when
an unknown source is referenced from within the sources attribute for
a build block. The hcl.Diagnostics error includes a Subject, which
should highlight where in the HCL2 configuration file the unknown source resides.
But when creating the BuildBlock no HCL2Ref data is copied over, thus the
Subject is displayed with with zero value for an hcl.Range type.

This change updates the build creation logic to copy the HCL2Ref data
from the build block at decode time so that it can be properly
referenced downstream.

Closes #11932

Failure due to change in output
```
--- FAIL: TestValidateCommand_ShowLineNumForMissing (0.00s)
    --- FAIL: TestValidateCommand_ShowLineNumForMissing/test-fixtures/validate-invalid/missing_build_block.pkr.hcl (0.00s)
        validate_test.go:377: Unexpected output:   (
                """
                Error: Unknown source file.cho

            -     on  line 0:
            +     on test-fixtures/validate-invalid/missing_build_block.pkr.hcl line 6:
                  (source code not available)

                ... // 4 identical lines
                """
              )
        validate_test.go:379:
FAIL
FAIL    github.com/hashicorp/packer/command     1.002s
```
2022-12-20 15:37:59 -05:00
Wilken Rivera 50a356529a Update Go checks to run on pull_requests (#12166)
Currently go-test and go-validate only run for users who have push
access to the Packer repo. We want to ensure tests and validation run
for all opened pull requests including public forks.
2022-12-16 11:35:41 -05:00
dependabot[bot] a6e7635d05 build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.28.0 to 0.29.0 (#12163)
Bumps [github.com/hashicorp/hcp-sdk-go](https://github.com/hashicorp/hcp-sdk-go) from 0.28.0 to 0.29.0.
- [Release notes](https://github.com/hashicorp/hcp-sdk-go/releases)
- [Changelog](https://github.com/hashicorp/hcp-sdk-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcp-sdk-go/compare/v0.28.0...v0.29.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcp-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-15 12:43:55 -05:00
Wilken Rivera 82bcc9e671 Reset to dev mode 2022-12-13 14:29:25 -05:00
Wilken Rivera 020f9818c3 Update CHANGELOG.md
Fix version for vSphere plugin
2022-12-13 11:32:45 -05:00
Wilken Rivera e4f31384a3 Cut release 1.8.5 v1.8.5 2022-12-12 16:40:41 -05:00
Wilken Rivera ad25ebc836 Update CHANGELOG 1.8.5 2022-12-12 16:34:32 -05:00
Lucas Bajolet 027e920147 go.mod: bump golang.org/net to 0.4.0
As with the go version to 1.18.9, this fix concerns mitigations to the
GO-2022-1144 vulnerability.

Since we depend on golang.org/net too, we need to update it to a version
that is not vulnerable anymore, and this is starting at version 0.4.0
2022-12-12 16:17:51 -05:00
Wilken Rivera f35270700f Update external plugins to latest available release 2022-12-12 15:48:11 -05:00
Fedor Korotkov 5997724745 website: Added Tart builder
This PR add [`tart` builder](https://github.com/cirruslabs/packer-plugin-tart) to the list of all the builders.

Tart is a open-source toolset for building, running and managing Linux and macOS virtual machines on Apple Silicon. Part of the toolset is this packer plugin.
2022-12-12 15:13:23 -05:00
Lucas Bajolet 0aa2df1027 go-version: bump to 1.18.9
The go 1.18.9 version fixes a vulnerability GO-2022-1144, which concerns
the net/http and golang.org/x/net packages.

These are used in the codebase, and therefore automated tools report the
generated binaries as vulnerable to this.

Note that while Packer is indeed vulnerable to this, this is a DoS
attack. This is therefore unlikely to impact Packer severely, especially
as it requires a deliberate attempt to provoke an OOM/excessive GC
cycles.

Nonetheless, since this vulnerability is fixed with go 1.18.9, we bump
the version used to build/test the tools to this version.
2022-12-12 14:38:16 -05:00
Wilken Rivera 3b9274aa04 command/validate: Add -evaluate-datasources flag to command help text (#12152)
```
Usage: packer validate [options] TEMPLATE

  Checks the template is valid by parsing the template and also
  checking the configuration with the various builders, provisioners, etc.

  If it is not valid, the errors will be shown and the command will exit
  with a non-zero exit status. If it is valid, it will exit with a zero
  exit status.

Options:

  -syntax-only                  Only check syntax. Do not verify config of the template.
  -except=foo,bar,baz           Validate all builds other than these.
  -only=foo,bar,baz             Validate only these builds.
  -machine-readable             Produce machine-readable output.
  -var 'key=value'              Variable for templates, can be used multiple times.
  -var-file=path                JSON or HCL2 file containing user variables, can be used multiple times.
  -no-warn-undeclared-var       Disable warnings for user variable files containing undeclared variables.
  -evaluate-datasources         Evaluate data sources during validation (HCL2 only, may incur costs); Defaults to false.

```
2022-12-12 13:14:25 -05:00
dependabot[bot] 7c498d7217 build(deps): bump dessant/lock-threads from 3 to 4 (#12145)
Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 3 to 4.
- [Release notes](https://github.com/dessant/lock-threads/releases)
- [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dessant/lock-threads/compare/v3...v4)

---
updated-dependencies:
- dependency-name: dessant/lock-threads
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-08 07:31:51 -05:00
Wilken Rivera bd53a7e237 Add github.com/hashicorp/hcp-sdk-go to dependabot tracking (#12147) 2022-12-08 07:29:28 -05:00
Lucas Bajolet 4846301ff4 hcp: reject template type changes between builds
As a follow-up to tracking the template type for an iteration, we
actively check that it remains consistent between two invocations of
packer, and reject the update if it is not the case.
2022-12-07 16:18:52 -05:00
Lucas Bajolet 6d0045607c hcp: record template type when creating iterations
In order to ensure users keep the same templates between two packer
invocations for a single iteration, we start tracking the type of
template used when building images.
2022-12-07 16:18:52 -05:00
Lucas Bajolet 08f1e85fb1 hcp: fix payloads for new SDK version
The grpc_gateway v2 changes had some repercussions in the payloads of
the API calls, making the current code non-functional against the latest
SDK.
2022-12-07 16:18:52 -05:00
Christophe Jauffret abb2f79155 Add Nutanix docs (#12131) 2022-12-05 11:58:59 -05:00
HashiBot 97bdeadbe6 chore: Update Digital Team Files (#12139)
* Update generated website Makefile

* Update generated scripts (should-build.sh)

* Update generated scripts (website-start.sh)

* Update generated scripts (website-build.sh)
2022-12-05 11:53:10 -05:00