Commit graph

18818 commits

Author SHA1 Message Date
karthik P
09682a5def doc update for powershell execution change 2025-06-03 00:17:17 +05:30
Karthik P
089df02532
Powershell Provisioner Error Handling (#13334)
* WIP Testing Approach

* WIP Testing Approach

* WIP Testing Approach Work

* WIP Testing Approach

* adding acceptance test for windows Amazon EBS.

* modify wrapper string to use Set-Variable

* fixing unit tests

* cleanup

* updated approach to use -file instead of inline powershell execution.

* adding more scenarios for acceptance test.

* using writeString for file directly.

* changing variable name

* updating test case. cleanup.

* updating test case

* updating test case

* updating test case - nested try catch

* adding unit test for None Execution Policy

* adding unit test for None Execution Policy

* fix test case
2025-04-25 11:23:32 +05:30
Lucas Bajolet
fe6eba27f2 go.mod: bump golang.net/x/net to v0.36.0
Previous version was v0.33.0, which was detected vulnerable to
GO-2025-3503.
This is unlikely to be a bug that causes significant security concerns,
but we fix that with this commit regardless.
2025-04-22 15:07:45 -04:00
Anurag Sharma
a5ac97f5d2
docs: issues when temp is noexec 2025-04-17 10:38:16 +05:30
Anurag Sharma
d155ec0815 fix note not showing up 2025-04-15 15:31:15 +05:30
Anurag Sharma
1a8dd4b63f revert changes to debugging mdx 2025-04-15 15:10:17 +05:30
Anurag Sharma
80379bae09 docs: improve clarity on TMPDIR usage during plugin installation 2025-04-15 15:03:21 +05:30
Karthik P
8e36b92ce3
Preserve User-Defined Variable File Order (#13350)
* modifying the for loop to preserver user inputted variable files preference

* adding test cases

* pr comments + refactoring the for loop for better readability.

* pr comments + refactoring the for loop for better readability.

* pr comments | handling default case

* adding additional test case

* fixing test cases

* fixing test cases. creating a subdirectory to add a test case for both hcl and json auto var files

* adding test case for json auto var file
2025-04-15 10:35:16 +05:30
Karthik P
51eeadba3d
feat: add sum, startswith and endswith functions
This commit adds 3 new HCL2 functions:

* `sum`: computes the sum of a collection of numerical values
* `startswith`: checks if a string has another as prefix
* `endswith`: checks if a string has another as suffix
2025-04-14 11:49:36 -04:00
Anurag Sharma
8ea6e51add reformat the file 2025-04-10 13:23:28 +05:30
Anurag Sharma
cab5be8ecf docs: issues when temp is noexec 2025-04-10 13:12:43 +05:30
tanmay-hc
1d02f14871
Merge pull request #13351 from hashicorp/ssh-doc-update
Added Documentation Comments for SSH Tunnel flags
2025-04-09 12:51:40 +05:30
Tanmay Jain
fe92097451 Added Documentaion Comments for SSH Tunnel flags 2025-04-07 17:42:49 +05:30
trujillo-adam
35eed086c1
Replace .io links with devdot links (#13335)
* replace .io links with devdot links

* update links in website docs readme
2025-03-28 07:10:47 -07:00
Anurag Sharma
d4ebc48b89 packer_test: build acc test for shell provisioner in linux only
atm darwin and windows have issues with the shell provisioner tests.
2025-03-20 16:22:32 -04:00
Anurag Sharma
7a5fc2525a packer_test: added shell provisioner test with empty inline list 2025-03-20 16:22:32 -04:00
Anurag Sharma
d3988669ea provisioner: refactored the inline script creation 2025-03-20 16:22:32 -04:00
Anurag Sharma
689024a57f provisioner: added invalid shebang test in packer_test 2025-03-20 16:22:32 -04:00
Anurag Sharma
36f6b3644f add more context for config variable usage 2025-03-20 16:22:32 -04:00
Anurag Sharma
8e75537601 check for shebang after whole script is interpolated 2025-03-20 16:22:32 -04:00
Anurag Sharma
cb110b263b packer_test: added inline shebang test cases for shell provisioner 2025-03-20 16:22:32 -04:00
Anurag Sharma
dfa0a4e8bb provisioner: deleted outdated inline unit tests 2025-03-20 16:22:32 -04:00
Anurag Sharma
ee74751181 moved the logic to provision method 2025-03-20 16:22:32 -04:00
Anurag Sharma
f21b2c8e9b test(provisioner): add test for shebang within inline script 2025-03-20 16:22:32 -04:00
Anurag Sharma
e8c2f7b3b0 fix: take only first line from the script 2025-03-20 16:22:32 -04:00
Anurag Sharma
c1db3bf8fa provisioner: set InlineShebang based on Inline content 2025-03-20 16:22:32 -04:00
Tanmay Jain
cceac7f462 UPDATE: Removing the UseSequentialEvaluation flag from Fix subcommand 2025-03-11 16:52:48 -04:00
Tanmay Jain
0e49825a82 UPDATE: Added the UseSequentialEvaluation flag to the Console Test 2025-03-11 16:52:48 -04:00
Tanmay Jain
0e8668eb5f BUG: Fixed Packer Console's UseSequentialEval flag 2025-03-11 16:52:48 -04:00
Martin Grogan
b1417b7f5c hcp: use GetHCPPackerRegistryBlock in the hcl module 2025-03-11 14:49:59 -04:00
Martin Grogan
5e6e1a2217 hcl: add get GetHCPPackerRegistry method to PackerConfig
This method will be used to validate and fetch the correct
HCPPackerRefistry block to be used in HCP build

hcl: check for multiple HCP Packer registry block

hcl: support for top level HCP Packer Registry

hcl: deprecation warning for build block based hcp config
2025-03-11 14:49:59 -04:00
Martin Grogan
86c8902b81 hcl: add packer_registry at root schema 2025-03-11 14:49:59 -04:00
Lucas Bajolet
8a5c6addec Makefile: bump golangci-lint to 1.60.1
Since we bumped the Go version for the project to 1.23.2, we need to
also bump the golangci-lint project to 1.60.1 in order to support it.
2025-03-07 11:18:41 -05:00
Lucas Bajolet
963eb5fc78 .go-version: bump to 1.23.2
Since the last go.mod updates require Go 1.23 and above, we bump the Go
version we use to run Packer builds.
2025-03-06 15:07:46 -05:00
Lucas Bajolet
ec7bc08a62 go.mod: bump dependencies to fix vulnerabilities
golang.org/x/crypto: v0.35.0 - GO-2025-3487
github.com/go-jose/go-jose/v4: v4.0.5 - GO-2025-3485
golang.org/x/oauth2: v0.27.0 - GO-2025-3488
2025-03-06 15:07:46 -05:00
Lucas Bajolet
2157f7fe41 .github: bump backport assistant to 0.5.3
The backport assistant bot fails all the time on the current version.
While it's not clear what's the reason of the failure, this commit
bumps the version of the assistant from 0.3.4 to 0.5.3 in an attempt to
fix that problem.
2025-03-06 14:48:49 -05:00
Karthik P
1896739a4c
docs: add installing plugins from a compiled binary example 2025-03-06 12:06:03 -05:00
Tanmay Jain
736a6cbc98 UPDATE: Added a note for adding forward slash while copying files 2025-03-03 16:52:08 -05:00
Martin Grogan
43383a22e2 docs: add PACKER_GETTER_READ_TIMEOUT in config 2025-03-03 16:45:04 -05:00
Martin Grogan
cc610bc006 hcp: give a proper error when using conflicting build name
It was possible to put the same source 2 times in the build and when
using HCP, it would error eventually since they are considered the same
build from HCP side
2025-03-03 15:44:29 -05:00
karthik P
f574090609 Adding darwin/386 as part of unsupported GOOS/GOARCH pair. 2025-02-20 11:43:28 -05:00
Lucas Bajolet
62befd70bf hcp: replace packersdk.Build by *CoreBuild
As the rest of the build process was updated to remove references to the
Build interface exposed by the SDK, we change the usage of such types in
the hcp internal package, so they are typed with *CoreBuild too.
2025-02-13 16:06:02 -05:00
Lucas Bajolet
98198b5af8 packer: make GetBuilds return *[]CoreBuild
The GetBuilds function, available on both HCL2 and legacy JSON
configuration objects, used to return the Build interface.
This typing by interface is not useful in this instance, since all the
uses of `GetBuilds' are self-contained within Packer, and we're never
using any other implementation for it than `*CoreBuild`.

We've been relying on the dynamic type for all the builds being
*CoreBuild in some places of the code, so to avoid potential surprises
in the future, we'll change the signature now so it returns only
concrete types.
2025-02-13 16:06:02 -05:00
Martin Grogan
3cc908eea6
Merge pull request #13287 from hashicorp/tsccr-auto-pinning/trusted/2025-02-01
tsccr: pin action refs to latest trusted
2025-02-12 16:12:55 -05:00
Martin Grogan
f730e7d916
Merge pull request #13298 from hashicorp/dependabot/go_modules/github.com/hashicorp/hcp-sdk-go-0.136.0
build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.135.0 to 0.136.0
2025-02-12 16:07:23 -05:00
Martin Grogan
032ee5af4d
Merge pull request #13293 from sbraz/hcl2_upgrade_command
website: fix repeated word in link to hcl2_upgrade command doc
2025-02-12 16:06:33 -05:00
dependabot[bot]
c0d13348b8
build(deps): bump github.com/hashicorp/hcp-sdk-go
Bumps [github.com/hashicorp/hcp-sdk-go](https://github.com/hashicorp/hcp-sdk-go) from 0.135.0 to 0.136.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.135.0...v0.136.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] <support@github.com>
2025-02-12 19:28:33 +00:00
Martin Grogan
d3ac8a810c
Merge pull request #13289 from hashicorp/dependabot/go_modules/github.com/hashicorp/hcp-sdk-go-0.135.0
build(deps): bump github.com/hashicorp/hcp-sdk-go from 0.131.0 to 0.135.0
2025-02-12 10:24:44 -05:00
Rose M Koron
af6dbb2280
Merge pull request #13291 from hashicorp/RK/adjust-codeowners 2025-02-06 16:12:55 -08:00
Louis Sautier
665ee15689
website: fix repeated word in link to hcl2_upgrade command doc
Fixed to match what was done in
website/content/partials/from-1.5/beta-hcl2-note.mdx.

Signed-off-by: Louis Sautier <sautier.louis@gmail.com>
2025-02-06 21:37:28 +01:00