-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
50a3565
commit caf8466
Showing
14 changed files
with
261 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
command/test-fixtures/provisioners/provisioner-only-except.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} | ||
] | ||
} |
31 changes: 31 additions & 0 deletions
31
command/test-fixtures/provisioners/provisioner-only-except.pkr.hcl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.