Okay, i'll create a single template for each build; sounds like we need to 
write a tool that generates the template from a script to get around this. 
Any chance for this to be a feature request the team might take up? 

On Wednesday, March 13, 2019 at 9:48:51 PM UTC-7, Rickard von Essen wrote:
>
> You can't. 
>
> On Thu, Mar 14, 2019, 00:39 Todd Foley <[email protected] <javascript:>> 
> wrote:
>
>> How do you escape a comma in a user variable?
>>
>> This breaks the functionality of the build. this example is based off the 
>> defined example: https://packer.io/docs/builders/docker.html#run_command
>> The only difference is this is going through a user variable, which 
>> breaks because the parsing has no way to escape the comma that has to be 
>> ignored. 
>>
>> {
>>   "variables": {
>>     "changes": "CMD [\"nginx\", \"-g\", \"daemon off;\"]"
>>   },
>>
>>   "builders": [
>>     {
>>       "type": "docker",
>>       "image": "ubuntu:16.04",
>>       "run_command": ["-d", "{{.Image}}"],
>>       "changes":      "{{ user `changes`}}",
>>       "commit": true
>>     }
>>   ],
>>   "post-processors": [
>>     [
>>       {
>>         "type": "docker-tag",
>>         "repository": "my/ubuntu",
>>         "tag": "16.04"
>>       }
>>     ]
>>   ]
>> }
>>
>> -- 
>> 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] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/packer-tool/92180783-e0be-4324-86be-fcee97018201%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/packer-tool/92180783-e0be-4324-86be-fcee97018201%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
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/48be24b2-ac2f-42fc-bd1e-bf225cdbac41%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to