Hi,

I have a custom Builder running, and it's working, if I use the Builders 
section only.
If I add the provisioners section, the scripts in the provisioners section 
doesn't run.

*Any idea why this is, and how to get the provisioners section to work?*
The scripts are meant to be run on Linux.

Initially, my custom Builder doesn't have any Provisioner or PostProcessor 
built-in.
However, operating under the assumption that perhaps Packer is looking into 
loading Provisioner and PostProcessor from my plugin, I tried using the 
Provisioner and PostProcessor code from Packer, by exporting it into my 
namespace. So plugin.cmdProvisioner became myplugin.Provisioner, and 
plugin.cmdPostProcessor became myplugin.PostProcessor.

Here's my main routine (which is for my custom Builder) before adding 
provisioner and postprocessor:
func main() {
    server, err := plugin.Server()
    if err != nil {
        panic(err)
    }
    server.RegisterBuilder(new(myplugin.Builder))
    server.Serve()
}
The above works, and my Builder can build images successfully

Here's my routine (still inside my own Builder) after adding provisioner 
and postprocessor:
func main() {
    server, err := plugin.Server()
    if err != nil {
        panic(err)
    }
    server.RegisterBuilder(new(myplugin.Builder))
    server.RegisterProvisioner(new(myplugin.Provisioner))
    server.RegisterPostProcessor(new(myplugin.PostProcessor))
    server.Serve()

}

Here's my configuration file:

{
  "min_packer_version": "0.12.0",
  "builders": [{
    ... // omitted as this part is working ///
  }],
  "provisioners": [
    {
    "type": "shell-local",
    "command": "echo Hello World > /home/chuacw/successful.txt"
    }
  ],
  "post-processors": [{
    "type": "manifest",
    "output": "manifests/test-node.json",
    "strip_path": true
  }]
  
}

-- 
This mailing list is governed under the HashiCorp Community Guidelines - 
https://www.hashicorp.com/community-guidelines.html. Behavior in violation of 
those guidelines may result in your removal from this mailing list.

GitHub Issues: https://github.com/mitchellh/packer/issues
IRC: #packer-tool on Freenode
--- 
You received this message because you are subscribed to the Google Groups 
"Packer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/779e5d45-3b30-4848-815d-4435ac930887%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to