mirror of
https://github.com/hashicorp/packer.git
synced 2026-06-09 00:32:09 -04:00
The lib name for the common components for writing packer_test suites was not clear, and did not follow the convention established in Packer core and plugins. Therefore this commit does two things: first the lib is renamed into common as to follow this convention, and clearly document which components are common to all tests. Also checkers are placed in a subpackage of common, common/check, so that it is clearer what is meant to be used as checks for a command's execution status after it's been run, as part of Assert.
43 lines
853 B
HCL
43 lines
853 B
HCL
# Copyright (c) HashiCorp, Inc.
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
packer {
|
|
required_plugins {
|
|
scaffolding = {
|
|
version = ">=v0.1.0"
|
|
source = "github.com/hashicorp/scaffolding"
|
|
}
|
|
}
|
|
}
|
|
|
|
source "scaffolding-my-builder" "foo-example" {
|
|
mock = local.foo
|
|
}
|
|
|
|
source "scaffolding-my-builder" "bar-example" {
|
|
mock = local.bar
|
|
}
|
|
|
|
build {
|
|
sources = [
|
|
"source.scaffolding-my-builder.foo-example",
|
|
]
|
|
|
|
source "source.scaffolding-my-builder.bar-example" {
|
|
name = "bar"
|
|
}
|
|
|
|
provisioner "scaffolding-my-provisioner" {
|
|
only = ["scaffolding-my-builder.foo-example"]
|
|
mock = "foo: ${local.foo}"
|
|
}
|
|
|
|
provisioner "scaffolding-my-provisioner" {
|
|
only = ["scaffolding-my-builder.bar"]
|
|
mock = "bar: ${local.bar}"
|
|
}
|
|
|
|
post-processor "scaffolding-my-post-processor" {
|
|
mock = "post-processor mock-config"
|
|
}
|
|
}
|