github.com/hashicorp/packer@v1.14.3/command/test-fixtures/build-only/template.pkr.hcl (about)

     1  source "file" "chocolate" {
     2    content = "chocolate"
     3    target = "chocolate.txt"
     4  }
     5  
     6  source "file" "vanilla" {
     7    content = "vanilla"
     8    target = "vanilla.txt"
     9  }
    10  
    11  source "file" "cherry" {
    12    content = "cherry"
    13    target = "cherry.txt"
    14  }
    15  
    16  
    17  build {
    18    sources = [
    19      "sources.file.chocolate",
    20      "sources.file.vanilla",
    21      "sources.file.cherry",
    22    ]
    23  
    24    post-processor "shell-local" {
    25      name = "apple"
    26      inline = [ "echo apple > apple.txt" ]
    27    }
    28  
    29    post-processor "shell-local" {
    30      name = "peach"
    31      inline = [ "echo apple > peach.txt" ]
    32    }
    33  
    34    post-processor "shell-local" {
    35      name = "pear"
    36      inline = [ "echo apple > pear.txt" ]
    37    }
    38  
    39    post-processor "shell-local" {
    40      name = "banana"
    41      inline = [ "echo apple > banana.txt" ]
    42    }
    43  
    44    post-processor "shell-local" {
    45      only = ["file.vanilla"]
    46      name = "tomato"
    47      inline = [ "echo apple > tomato.txt" ]
    48    }
    49  
    50    post-processor "shell-local" {
    51      only = ["file.chocolate"]
    52      inline = [ "echo apple > unnamed.txt" ]
    53    }
    54  }