mirror of https://github.com/hashicorp/packer
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.pull/12246/head
parent
afb59f6593
commit
b2a98664c9
@ -0,0 +1,37 @@
|
||||
{
|
||||
"builders": [
|
||||
{
|
||||
"type": "null",
|
||||
"communicator": "none"
|
||||
},
|
||||
{
|
||||
"type": "null",
|
||||
"name": "packer",
|
||||
"communicator": "none"
|
||||
}
|
||||
],
|
||||
"provisioners": [
|
||||
{
|
||||
"type": "shell-local",
|
||||
"inline": ["echo packer provisioner {{build_name}} and {{build_type}}"],
|
||||
"only": ["packer"]
|
||||
},
|
||||
{
|
||||
"type": "shell-local",
|
||||
"inline": ["echo null provisioner {{build_name}} and {{build_type}}"],
|
||||
"except": ["packer"]
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"type": "shell-local",
|
||||
"inline": ["echo packer post-processor {{build_name}} and {{build_type}}"],
|
||||
"only": ["packer"]
|
||||
},
|
||||
{
|
||||
"type": "shell-local",
|
||||
"inline": ["echo null post-processor {{build_name}} and {{build_type}}"],
|
||||
"except": ["packer"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,31 @@
|
||||
source "null" "packer" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
source "null" "other" {
|
||||
communicator = "none"
|
||||
}
|
||||
|
||||
build {
|
||||
sources = ["sources.null.packer", "null.other"]
|
||||
|
||||
provisioner "shell-local" {
|
||||
inline = ["echo packer provisioner {{build_name}} and {{build_type}}"]
|
||||
only = ["null.packer"]
|
||||
}
|
||||
|
||||
provisioner "shell-local" {
|
||||
inline = ["echo other provisioner {{build_name}} and {{build_type}}"]
|
||||
except = ["null.packer"]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
inline = ["echo packer post-processor {{build_name}} and {{build_type}}"]
|
||||
only = ["null.packer"]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
inline = ["echo other post-processor {{build_name}} and {{build_type}}"]
|
||||
except = ["null.packer"]
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue