Hi, 


I am using packer 1.0.0 on Windows 10.

 

*Run.bat*

 

Packer build –only mybuilder –var-file=variables_file.json 

Echo %errorlevel%  

<<This always show 0 even if my shell scripts exited with returned code 1. 

Is this expected behavior, if so then how can one catch the errors of SHELL 
and take action in run.bat file ?>>

 

*variables_file.json*

 

{

    "builders": [{

        "type": "null",

        "name": " mybuilder",

        "ssh_host": "{{user ` host`}}",

        "ssh_username": "{{user ` username`}}",

        "ssh_password": "{{user ` password`}}",

        "ssh_timeout" : "{{user `esxi_ssh_timeout`}}"

    }],

    "provisioners": [{

        "type": "shell",

        "only": ["mybuilder"],

        "scripts": [

            "script/testESXi.sh"

        ]

    }

    ]

}

 

*testESXi.sh*

 

#!/bin/sh

 

exit 1;


Regards,

Becky

-- 
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/82f04172-898b-4dd3-8184-f0202aa9bf36%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to