Commit Graph
18303 Commits
Author SHA1 Message Date
Lucas Bajolet 7cd095062a parser: extract HCP logic out of the HCL parser
Before this commit, some HCP-related logic was embedded in the parser,
making all of it common to all commands.

This complexifies the logic as some parts rely on the template being in
a HCP-valid environment, and the datasources need to be evaluated in
order for some operations to be executed.

To simplify this and avoid those pitfalls, we move this logic to its own
set of functions that will be performed after the parsing is done, on
any valid HCL2 or JSON template.
2022-08-12 11:54:21 -04:00
Lucas Bajolet 8b9c70cba2 packer: remove useless nil check on generatedVars 2022-08-12 11:54:21 -04:00
Lucas Bajolet 4be7e38474 command: move GetConfig methods to meta
Since the GetConfig methods are common to all the commands of Packer
that rely on a config to work, we move them from build.go to meta.go in
order to make the intent clearer.
2022-08-12 11:54:21 -04:00
Wilken Rivera 70c4f7a8c9 Update CHANGELOG
In moving to the shared HashiCorp release toolkit it was agreed to
remove support for the following architectures ppc64le mips mips64 mipsle mipsle64 s390x
since they are not part of the HashiCorp supported platforms. Nor are
they available as a release binary for any of the Packer plugins.

This change adds an entry to the Packer CHANGELOG to call out the
removal of the said architectures.

As we continue with the path of removing the plugins from Packer core
supporting platforms outside of those managed by our tooling
will be an issue for users as Packer needs the plugins to operate
properly.
2022-08-10 13:24:45 -04:00
Wilken Rivera 88ad9655aa Update python command for reading in pull.json 2022-08-09 21:01:51 -04:00
Wilken Rivera 0f59a53ba6 Update changelog scripts to work with Python3
Now that Python 2 has been removed from Macos 12.x and replaced with
Python3 I'm updating the simple tools to work with the Python3
interrupter.
2022-08-09 21:01:51 -04:00
Wilken Rivera 23cd26617b Update comments used by generated docs
This change updates the comments for the HCP Packer data sources to
match the recently corrected documentation text.
2022-08-09 15:42:00 -04:00
Sarah Thompson 70b3d0b2b9 Merge pull request #11882 from hashicorp/post-publish-website
Introduces the post publish website event
2022-08-08 17:30:10 +01:00
Dan Barr d2c83c4944 Update Golang references to Go
* Fix any "golang" to just "Go"
* Update golang.org URLs to go.dev
2022-08-05 13:42:56 -04:00
Dan Barr aec214d0b8 Fix plugin nav titles
* Normalize branding/capitalizations
2022-08-05 13:42:56 -04:00
Dan Barr ab69a2963b Update HTTP data source page title
* Capitalize HTTP
2022-08-05 13:42:56 -04:00
Dan Barr ab29b187b1 Fix capitalizations in docs
* Brands (HashiCorp, VMware)
* Various OS/languages (Windows, Unix, Linux, POSIX, Python, PowerShell)
* Various abbreviations (ID, VM, HTTP)
2022-08-05 13:42:56 -04:00
Wilken Rivera 0c9c3fe48c Put in dev mode 1.8.4 2022-08-02 21:05:48 -04:00
Wilken Rivera 083ab4f4cb Update CHANGELOG
This change fixes a few typos and inconsistencies within the changelog
entries for the 1.8.3 release.
2022-08-02 16:03:34 -04:00
Wilken Rivera 38b47d8211 Cut release 1.8.3
* Fix spacing in CHANGELOG
* Add release date to CHANGELOG
v1.8.3
2022-08-02 05:55:28 -04:00
Wilken Rivera 46e24b129c Update CHANGELOG 2022-08-01 15:42:46 -04:00
Wilken Rivera 392c4774da Bump bundled plugins to latest available version (#11917) 2022-08-01 09:37:33 -04:00
Wilken Rivera c09f98686d Add HCP Packer Ready badge to UpCloud (#11914) 2022-07-29 15:41:27 -04:00
Wilken Rivera e3ad29d2aa Update third-party plugin imports (#11912)
* packer-plugin-digitalocean: Update module import path

* packer-plugin-outscale: Remove bundled plugin

* packer-plugin-scaleway: Remove bundled plugin
2022-07-29 11:45:30 -04:00
Sylvia Moss 5c3d5c1295 Send channel id to HCP Packer (#11861) 2022-07-29 15:15:29 +02:00
dependabot[bot] d8e0ccc965 Bump actions/stale from 5.1.0 to 5.1.1 (#11910)
Bumps [actions/stale](https://github.com/actions/stale) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/v5.1.1/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5.1.0...v5.1.1)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-28 15:28:42 -04:00
dependabot[bot] a8c60e5117 Bump slackapi/slack-github-action from 1.20.0 to 1.21.0 (#11911)
Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.20.0 to 1.21.0.
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Commits](https://github.com/slackapi/slack-github-action/compare/v1.20.0...v1.21.0)

---
updated-dependencies:
- dependency-name: slackapi/slack-github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-28 15:28:18 -04:00
Lucas Bajolet 0da7cf781e go.mod: bump SDK to v0.3.1 2022-07-28 14:50:57 -04:00
dependabot[bot] a362afe785 Bump slackapi/slack-github-action from 1.19.0 to 1.20.0 (#11906)
Bumps [slackapi/slack-github-action](https://github.com/slackapi/slack-github-action) from 1.19.0 to 1.20.0.
- [Release notes](https://github.com/slackapi/slack-github-action/releases)
- [Commits](https://github.com/slackapi/slack-github-action/compare/v1.19.0...v1.20.0)

---
updated-dependencies:
- dependency-name: slackapi/slack-github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-28 11:10:14 -04:00
dependabot[bot] cd75c20390 Bump actions/stale from 5.0.0 to 5.1.0 (#11880)
Bumps [actions/stale](https://github.com/actions/stale) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v5.0.0...v5.1.0)

---
updated-dependencies:
- dependency-name: actions/stale
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-27 15:56:58 -04:00
krzys_h f28d36c888 Fix typo in the pipelining-builds docs (#11900)
Somebody forgot to finish their last sentence...
2022-07-23 09:16:50 -04:00
Wilken Rivera a4a497bd80 Delete pull-requests-opened.yml (#11890)
This action doesn't work as expected given that public forks don't have access to the token.
2022-07-22 13:02:50 -04:00
Wilken Rivera e12bbf3fb9 Update DigitalOcean plugin docs path (#11886) 2022-07-22 13:02:30 -04:00
Bryce Kalow 954285632d fix: use newer node for check-plugin-docs (#11893) 2022-07-21 11:23:29 -04:00
Chris Griggs 30a263ec7f Removing Huawei from plugin docs (#11888) 2022-07-21 07:42:29 -04:00
Lucas Bajolet 6ab16561b5 hcl2: fix crash on malformed overrides (#11881)
When an override block is either not an object, or if one of its
contents are not an object, Packer would crash trying to forcefully
cast the cty.Value to a cty.Collection.

To avoid this behaviour, we add extra checks that return hcl.Diagnostics
when they fail.
2022-07-20 14:30:49 -04:00
Lucas Bajolet 6794c6053a hcl2template: only iterate on known HCP datasource (#11883)
When we try to validate a build that contains references to
hcp_packer_image, the data is not fetched, and the value is therefore
unknown.

However, during the decoding phase for the build blocks, we attempt to
fetch the ancestry information for the current build, from the
information previously fetched from HCP.

Since we're validating, there's no way this is set, and attempting to
cast without checking causes Packer to crash on the conversion.

To avoid this, we only attempt this conversion if the value is known.

Closes #11870
2022-07-20 10:46:50 -04:00
Claire Labry 3c76f5a95e introduces the post publish website event 2022-07-18 12:56:01 -04:00
Shohei Maeda 9f28ced11c Add component_type optional field (#11872)
* Add `component_type` optional field

to support specifying the exact build image when multiple images exist in the same provider and region for a given iteration

* update docs

* update docs
2022-07-14 10:33:10 -07:00
Lucas Bajolet 819cc50f31 datasource: change phrasing for iteration_id
The comment was mentioning the name of an iteration Id, which is
conflicting.
This commit rephrases the comment to directly specify the ID of the
iteration.
2022-07-13 17:10:38 -04:00
Lucas Bajolet fabfc8f015 hcp-packer-image: add support for channel
In addition to the current way of specifying an image based on an
iteration on HCP Packer, which requires first declaring an iteration,
and then referencing it from the image to build, we add the capacity of
specifying a channel.

This alternative will get the iteration linked to the channel, and is
essentially a more convenient way to get an image's metadata from HCP
Packer.

This commit is essentially a backport from the Terraform HCP provider,
for consistency between the two tools.
2022-07-13 17:10:38 -04:00
Wilken Rivera 9f64b99073 Add Packer Plugin Gridscale to plugins page (#11862)
* Add Packer Plugin Gridscale to plugins page

* Add verified tier badge
2022-07-07 14:06:28 -04:00
Wilken Rivera 6b03734b2f Document known limitation of locals being used within a data source (#11864)
* Document known limitation of locals being used within a data source

* Update website/content/partials/datasources/local-dependency-limitation.mdx
2022-07-07 12:48:23 -04:00
dependabot[bot] 65611c1577 Bump github.com/hashicorp/hcl/v2 from 2.12.0 to 2.13.0 (#11856)
Bumps [github.com/hashicorp/hcl/v2](https://github.com/hashicorp/hcl) from 2.12.0 to 2.13.0.
- [Release notes](https://github.com/hashicorp/hcl/releases)
- [Changelog](https://github.com/hashicorp/hcl/blob/main/CHANGELOG.md)
- [Commits](https://github.com/hashicorp/hcl/compare/v2.12.0...v2.13.0)

---
updated-dependencies:
- dependency-name: github.com/hashicorp/hcl/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-06 15:58:21 -04:00
Lucas Bajolet 0a41694ee5 registry: add heartbeat call for running builds (#11846)
* registry: add heartbeat call for running builds

When a build is running, we send periodic heartbeats to HCP Packer's
API.

This will be used on the service side to detect if a build is stalled on
the core side because of a crash or any other malfunction that caused
Packer not to send an update on the status of a build.

* registry: only update status on status update

Prior to this commit, we'd send updates to both the labels and the
cloud-provider whenever an update to the status of a build would be
sent.

This would cause a bug in which once a build reached the post-processing
state, and its cloud-provider was set, the status could not be updated
anymore, as the cloud-provider would be set and further updates are
rejected by the platform.

To avoid this problem, we only transmit the status when doing a status
update, and no other fields along with it.

* internal: publicise CompleteBuild function

The markBuildComplete private function used to be called from a final
status update to DONE, through the UpdateBuildStatus function.

The problem being that the (now) CompleteBuild function not only updates
the status of the build, but also all its metadata.

For consistency, we remove the indirection, and explicitely call
CompleteBuild when we want to finish a build.

* internal: block status updates on DONE builds
2022-07-05 14:37:39 -04:00
Wilken Rivera f752f8dd63 Put in dev mode 2022-06-21 17:51:54 -04:00
Wilken Rivera c4823d1174 Update CHANGELOG.md
Fix a few formatting issues.
2022-06-21 17:41:12 -04:00
Wilken Rivera f0e24a249b Cut release v1.8.2 v1.8.2 2022-06-21 13:01:18 -04:00
Wilken Rivera 172724e466 Bump to go1.17.11 2022-06-21 13:01:18 -04:00
Wilken Rivera 8d3d4e9b54 Update CHANGELOG for 1.8.2
* Add gh-11854 to changelog
2022-06-21 13:01:18 -04:00
Sylvia Moss b849ace27b Fail HCP datasources for revoked iteration (#11854) 2022-06-21 17:24:41 +02:00
Wilken Rivera 64ee27cb49 Fix typo in release yaml 2022-06-14 21:31:27 -04:00
Wilken Rivera d34c6fee03 Update permission to allow publishing release 2022-06-14 21:26:56 -04:00
Wilken Rivera 10306d4187 Fix permissions for nightly-release.yml 2022-06-14 20:36:48 -04:00
Wilken Riveraandneilnaveen cc5898022a update action permissions (#11837)
* chore: Set permissions for GitHub actions

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

Signed-off-by: neilnaveen <[email protected]>

* Update permissions for newly added actions

* Remove deleted actions

Co-authored-by: neilnaveen <[email protected]>
2022-06-14 12:08:39 -04:00