Commit graph

662 commits

Author SHA1 Message Date
Wilken Rivera
d6a5234412 Unregister packer-image-iteration datasource
This change temporarily renames the type of the packer-image-iteration
datasource to prevent it from being automatically registered by the
Packer plugin tooling. The datasource is fully functional, but not quite
ready for full usage. It will be updated in a future release.
2021-09-14 14:25:48 -04:00
Wilken Rivera
b10df3abb7
Update HCP Packer registry image extraction, validation, publishing logic for registry capable plugins (#11221)
* Update handling of registry artifacts

This change uses the github.com/hashicorp/packer-plgin-sdk/packer/registryimage for querying
Artifact State for HCP Registry Image metadata. To handle the conversion
of the RPC response, mapstructure was introduced to conversion state
data into an registryimage.Image before publishing to a image bucket.

* Update to use registry image from packersdk

* Rename internal registry service pkg

* Update vendored plugins to latest version

* The latest release of Amazon, GoogleCompute, and Azure have support
  for publishing images to the HCP Packer registry.
2021-09-13 21:07:54 -04:00
Megan Marsh
48de1fc7da allow datasources to use other datasources
create a null data source for testing. We can choose to document if we want to, but it's a convenience for us

add a test to catch cyclic datasource dependency, update tests to include out of order data sources, and update the code to clean up the returned diagnostics generated from the recursive evaluation

PR review comments
2021-09-03 16:10:39 -07:00
Megan Marsh
fd80f8da8c Add two new data sources -- hcp-packer-iteration and hcp-packer-image. These data sources together will allow users to query hcp_packer for the image_ids they need to use as source images to their builds, with a simple UI and clear outputs.
add quick and dirty acceptance test for hcp packer image iteration and hcp packer image data sources
PR review
linting
2021-09-03 15:51:09 -07:00
Adrien Delorme
27d89ac8d4
update all plugins + pin go to go 1.17 (#11237)
* up plugins and get rid of a dependency loop from packer to packer
2021-09-02 12:15:13 +02:00
Megan Marsh
d6792820f4
Merge pull request #11227 from hashicorp/hcp_data_source
Implement hcp packer data source.
2021-08-31 09:33:48 -07:00
Adrien Delorme
c083b53c4f
packer fix: state that the command does not work for hcl files (#11238) 2021-08-31 16:12:47 +02:00
Adrien Delorme
d25373a8d6
move inspec provisioner out (#11230) 2021-08-31 12:07:26 +02:00
Adrien Delorme
acb01cb800
move salt-masterless provisioner out (#11229)
* move salt-masterless provisioner out
* go get github.com/hashicorp/packer-plugin-salt
2021-08-31 12:07:10 +02:00
Megan Marsh
980deeb684 Implement hcp packer data source. This is a rough copy of the terraform provider's data source, to make beta user experience consistent across both sources 2021-08-27 12:03:55 -07:00
Adrien Delorme
eb8e302941
hcl2_upgrade: special case: vsphere fix (#11216)
* fix typo

* hcl2_upgrade: special case linux_options and network_interface to block instead of maps

* Update hcl2_upgrade_test.go

* Update hcl2_upgrade_test.go

remove unused code

* hcl2_upgrade: support strftime too (#11220)

* hcl2_upgrade strftime function
* create legacy_strftime.mdx
2021-08-25 14:20:08 +02:00
Adrien Delorme
57f37c99ea
avoid hcl2_upgrade panic when file does not exist (#11206) 2021-08-13 16:08:12 +02:00
Wilken Rivera
a534c743cf
HCP Packer registry enabled Packer client (#11154)
* Add working registry pkg

* Add custom error for handling the loading of PAR environment variables

* Working Publish to Build, with proper error handling for bucket names

* Update hcp-sdk-go to use branch instead of mod replace directive

* Update Packer build status configuration

* Add support for HCP_PACKER_BUILD_FINGERPRINT env

* Add support for publishing one or more PARtifacts from a single build

* add git shas to this branch

* Add ability to set provider name if available

* Add working RegistryBuilder type

* Add RegistryPostProcessor as wrapper post-processor

* When in PAR mode a empty RegistryPostProcessor is added to the end of
  the post-processor list to publish all final image data.

* Add support for updating a build from PAR that is not in a DONE state

* Fix a small issue with creation the initial builds for an empty
  iteration.

* Add PAR URL to post-processor display

* Implement hcp_packer_registry block (#11168)

* Update vendored Amazon plugin to v1.0.1-dev

* Fix panic when running a Packer registry build in a clean directory

* Remove the publishing of post-processor metadata from the registry
  post-processor.

* Remove metadata add from registry_builder

* Update registry builder to skip a build that was found to be DONE

Co-authored-by: Megan Marsh <megan@hashicorp.com>
Co-authored-by: Sylvia Moss <moss@hashicorp.com>
2021-08-05 09:25:19 -04:00
Adrien Delorme
9d0193ac14
add possibility to use variables everywhere in post-processor blocks (#11094)
feature + tests.

Including in:
* name
* only
* except
* keep_input_artifact

Example file:

```hcl
source "null" "example1" {
  communicator = "none"
}

source "null" "example2" {
  communicator = "none"
}

locals {
  except = "null.example1"
}

variable "only" {
  default = "null.example1"
}

build {
  sources = ["source.null.example1", "source.null.example2"]
  post-processor "shell-local" {
    except = [local.except]
    inline = ["echo first post-processor"]
  }

  post-processor "shell-local" {
    only   = [var.only]
    inline = ["echo second post-processor"]
  }
}
```
Ouput:
```shell-session
$ packer build foo.pkr.hcl
null.example1: output will be in this color.
null.example2: output will be in this color.

==> null.example1: Running post-processor:  (type shell-local)
==> null.example2: Running post-processor:  (type shell-local)
==> null.example2 (shell-local): Running local shell script: /var/folders/3k/2gb5ct4s7cncr52_jh2kz6cw0000gq/T/packer-shell201696062
==> null.example1 (shell-local): Running local shell script: /var/folders/3k/2gb5ct4s7cncr52_jh2kz6cw0000gq/T/packer-shell494781572
    null.example1 (shell-local): second post-processor
Build 'null.example1' finished after 61 milliseconds 432 microseconds.
    null.example2 (shell-local): first post-processor
Build 'null.example2' finished after 111 milliseconds 678 microseconds.

==> Wait completed after 111 milliseconds 714 microseconds
```

close #4895
2021-06-15 18:29:26 +02:00
Wilken Rivera
e22346f0fa
Extract ProfitBricks Plugin (#11084)
* Extract ProfitBricks Plugin

* Update CHANGELOG
2021-06-14 17:30:58 -04:00
Sylvia Moss
927093e5c0
improve regex to fix escaping on split function (#11083) 2021-06-14 18:58:32 +02:00
Yoan Blanc
36a7b28b5f
fix: print unchanged formatted file when using stdin (#11047)
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2021-06-03 14:02:42 +02:00
Adrien Delorme
98990fc34e
hcl2_upgrade: allow to hcl2_upgrade with unknown builders, just log errors (#11049) 2021-06-03 13:41:16 +02:00
sylviamoss
444605c127 vendor oneandone 2021-05-25 14:46:44 +02:00
Wilken Rivera
c262467413
Extract Azure plugin components from Packer (#10979)
* Remove Azure plugin components and docs

* Add Azure plugin to vendored_plugins

* Updates Azure to use remote plugin docs

* Revendor packer-plugin-azure at v0.0.2

* Update to new version of the Packer plugin SDK v0.2.1
* Update to the official version of go-getter@v2.0.0
* Update salt provisioner to use new go-getter API

* Update vendored plugins to working versions

This changes fixes an issue with the go.sum for the Azure plugin.
It also revendors the plugins for puppet, chef, and ansible as v0.0.1
of those plugins where not usable.
2021-05-13 16:13:21 -04:00
Adrien Delorme
e60a7e60b9 add test to repro #10975 2021-04-26 17:31:22 +02:00
Adrien Delorme
38837848f9
Breakout yandex (#10970) 2021-04-22 17:03:14 +02:00
Sylvia Moss
bcb25f1916
Extract Tencent Cloud (#10967)
* extract and vendor tencentcloud plugin

* fix fmt
2021-04-22 15:21:34 +02:00
Adrien Delorme
ef612c0eb1
Breakout hcloud (#10966)
* Delete hetzner-cloud.mdx

* delete hcloud builder

* use hcloud plugin

* up mods

* use github.com/hashicorp/packer-plugin-hcloud v0.0.1
2021-04-22 14:52:07 +02:00
Sylvia Moss
972497589e
extract and vendor lxc and lxd (#10965) 2021-04-22 14:21:23 +02:00
Adrien Delorme
2cd296874e
Triton plugin breakout (#10963) 2021-04-22 14:06:30 +02:00
Megan Marsh
f161f2bed2
extract oracle plugin (#10962) 2021-04-22 11:50:00 +02:00
Megan Marsh
6b59525408
remove digitalocean directories, revendor, add to vendored_plugins, regenerate code, and update website paths (#10961) 2021-04-22 11:45:27 +02:00
Megan Marsh
d0a15f9a15
Merge pull request #10956 from hashicorp/extract-converge
Extract converge provisioner
2021-04-21 13:40:15 -07:00
Megan Marsh
af37f53439
Extract vagrant (#10960)
* remove vagrant, rework website

* regenerate command/plugin, and go mod tidy
2021-04-21 16:31:28 -04:00
Wilken Rivera
bb511e9592 Extract converge provisioner 2021-04-21 14:19:34 -04:00
Sylvia Moss
4be2c350bf
extract and vendor ucloud (#10953) 2021-04-21 13:25:04 -04:00
Megan Marsh
b5666b84cd
Extract jdcloud (#10946)
* delete jdcloud builder dir, revendor, regenerate, add to vendored_plugins

* change website pathing

* Extract linode (#10947)

* started extracting linode

* revendor linode

* clean up vendoring
2021-04-21 10:55:41 -04:00
Sylvia Moss
469f033c36
remove and vendor hyperv (#10952) 2021-04-21 16:32:34 +02:00
Sylvia Moss
2db338e322
Extract Hyperone (#10949) 2021-04-21 15:08:38 +02:00
Megan Marsh
9044deeb05 Delete cloudstack dir, revendor 2021-04-20 13:46:11 -07:00
Wilken Rivera
8bf03cbca7 Vendor packer-plugin-puppet 2021-04-20 15:27:21 -04:00
Wilken Rivera
eb6527c8b6 Remove Puppet components and docs 2021-04-20 15:27:21 -04:00
Wilken Rivera
a29f3340c2 Vendor packer-plugin-chef 2021-04-20 15:26:56 -04:00
Wilken Rivera
30bcf44c2c Remove Chef components and docs 2021-04-20 15:25:08 -04:00
Wilken Rivera
987080a409 Remove reference to openstackbuilder 2021-04-20 13:54:57 -04:00
Megan Marsh
6fa213235f extract and revendor
update website nav
2021-04-20 10:17:10 -07:00
Megan Marsh
b54121a72d delete and revendor alicloud plugin 2021-04-20 09:54:45 -07:00
Adrien Delorme
4de2954d01
Scaleway plugin breakout (#10939)
* use vendored scaleway plugin

* wipe out scaleway

* vendor vendors

* use remote docs

* go get github.com/hashicorp/packer-plugin-scaleway@v0.0.1

* empty commit
2021-04-20 11:59:59 -04:00
Sylvia Moss
25a999978b
Remove Parallels plugin (#10936) 2021-04-20 17:46:42 +02:00
Sylvia Moss
d6904502ac
Extract outscale (#10941)
* remove outscale, vendor it and add remote docs

* fix lint

* add community plugin tier

* Update go.mod

* up mods

Co-authored-by: Adrien Delorme <azr@users.noreply.github.com>
2021-04-20 17:18:45 +02:00
Adrien Delorme
d22ba61ae0
ncloud breakout (#10937) 2021-04-20 15:09:11 +02:00
Adrien Delorme
9eaad88ac0
Move proxmox builder out + vendor it (#10930)
* use vendored proxmox builders

* Update docs-nav-data.json

remove proxmox ref

* Update docs-remote-plugins.json

* remove builder/proxmox dir

* remove website/content/docs/builders/proxmox/

* up vendors

* Update modules.txt

* Update HTTPConfig-not-required.mdx

* Update HTTPConfig-not-required.mdx

* tidy mod

* fmt

* Update modules.txt
2021-04-20 14:59:34 +02:00
Megan Marsh
20faaef05c
Merge pull request #10929 from hashicorp/extract_qemu
Extract QEMU plugin
2021-04-19 15:39:44 -07:00
Megan Marsh
d0a4a71da8
Merge pull request #10927 from hashicorp/fix_typo
Fix TEMPATE to TEMPLATE in fmt cmd help text
2021-04-19 09:24:50 -07:00