mirror of https://github.com/hashicorp/packer
parent
6e610927da
commit
bfb9df0039
@ -0,0 +1,49 @@
|
||||
source "file" "chocolate" {
|
||||
content = "chocolate"
|
||||
target = "chocolate.txt"
|
||||
}
|
||||
|
||||
source "file" "vanilla" {
|
||||
content = "vanilla"
|
||||
target = "vanilla.txt"
|
||||
}
|
||||
|
||||
source "file" "cherry" {
|
||||
content = "cherry"
|
||||
target = "cherry.txt"
|
||||
}
|
||||
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"sources.file.chocolate",
|
||||
"sources.file.vanilla",
|
||||
"sources.file.cherry",
|
||||
]
|
||||
|
||||
post-processor "shell-local" {
|
||||
name = "apple"
|
||||
inline = [ "echo apple > apple.txt" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
name = "peach"
|
||||
inline = [ "echo apple > peach.txt" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
name = "pear"
|
||||
inline = [ "echo apple > pear.txt" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
only = ["vanilla"]
|
||||
name = "tomato"
|
||||
inline = [ "echo apple > tomato.txt" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
only = ["chocolate"]
|
||||
inline = [ "echo apple > unnamed.txt" ]
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
{
|
||||
"builders":[
|
||||
{
|
||||
"name": "chocolate",
|
||||
"type":"file",
|
||||
"target":"chocolate.txt",
|
||||
"content":"chocolate"
|
||||
},
|
||||
{
|
||||
"type":"file",
|
||||
"name": "vanilla"
|
||||
}
|
||||
],
|
||||
"post-processors": [
|
||||
{
|
||||
"name": "apple",
|
||||
"type": "shell-local",
|
||||
"inline": [ "echo apple 'hello'" ]
|
||||
},
|
||||
{
|
||||
"name": "pear",
|
||||
"type": "shell-local"
|
||||
}
|
||||
],
|
||||
"min_packer_version":"101.0.0"
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
source "file" "chocolate" {
|
||||
content = "chocolate"
|
||||
target = "chocolate.txt"
|
||||
}
|
||||
source "file" "vanilla" {
|
||||
content = "vanilla"
|
||||
}
|
||||
|
||||
build {
|
||||
sources = [
|
||||
"source.file.chocolate",
|
||||
"source.file.vanilla"
|
||||
]
|
||||
|
||||
post-processor "shell-local" {
|
||||
name = "apple"
|
||||
inline = [ "echo apple 'hello'" ]
|
||||
}
|
||||
|
||||
post-processor "shell-local" {
|
||||
name = "pear"
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue