If this fails:

if you can do ls  packer/api-clients/database.yml

is because the file is not there


seems the path should be

 app/packer/api-clients/database.yml



On Fri, Mar 9, 2018 at 6:20 PM, <an...@vnda.com.br> wrote:

> Hi Alvaro,
>
> My current directory is like this:
>
> api_v1
> ├── template.json
> ├── app
> │   ├── bin
> │   ├── config
> │   ├── packer
> │   │   ├── api-clients
> │   │   │   └── database.yml
> │   ├── lib
> │   ├── log
> │   ├── ...
>
>
> Notice that the template.json (Packer template) is OUTSIDE of my packer
> folder.
>
> I'm running packer build this way: ./packer build ami.json
>
> from within API_V1 folder.
>
>
>
> On Friday, March 9, 2018 at 2:09:03 PM UTC-3, Alvaro Miranda Aguilera
> wrote:
>>
>> Hello
>>
>> whats your current directory ?
>>
>> from where you run packer?
>>
>>
>> are you running this like
>>
>> packer build template.json
>> packer build ../template.son
>>
>>
>>
>> On Fri, Mar 9, 2018 at 6:02 PM, <an...@vnda.com.br> wrote:
>>
>>> I have a File Provisioner configured on my packer template json:
>>>
>>> "provisioners": [{
>>>         "type": "file",
>>>         "source": "packer/api-clients/database.yml",
>>>         "destination": "/tmp/api-clients-database.yml"
>>>     },
>>>
>>>
>>> The code below doesn't work when I'm trying to build an AMI on Amazon
>>> AWS, it always says:
>>>
>>>
>>> Bad source 'packer/api-clients/database.yml': stat 
>>> packer/api-clients/database.yml: no such file or directory
>>>
>>>
>>> * Bad source '/codebuild/output/src257534780/src/github.com/vnda/api_v2/
>>> packer/api-clients/database.yml': stat /codebuild/output/src257534780
>>> /src/github.com/vnda/api_v2/packer/api-clients/database.yml: not a
>>> directory
>>>
>>>
>>> If I do this:
>>>
>>>
>>> "source": "api-clients/database.yml",
>>>
>>>
>>> It works like a charm. But I must have all my Packer files inside of a
>>> packer folder within my app folder for organization purposes.
>>>
>>> What am I doing wrong?
>>>
>>>
>>> My app folder is like this:
>>>
>>>
>>> api_v1
>>> ├── template.json
>>> ├── app
>>> │   ├── bin
>>> │   ├── config
>>> │   ├── packer
>>> │   │   ├── api-clients
>>> │   │   │   └── database.yml
>>> │   ├── lib
>>> │   ├── log
>>> │   ├── ...
>>>
>>>
>>> It seems that it has something to do with Relative Paths / Absolute
>>> Paths on Packer but I couldn't figure out what is wrong...
>>>
>>>
>>> Thanks in advance,
>>>
>>>
>>> Andre
>>>
>>> --
>>> 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 packer-tool...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/packer-tool/7b4a8839-daff-46e0-a26d-154171bf6acb%40googlegroups.com
>>> <https://groups.google.com/d/msgid/packer-tool/7b4a8839-daff-46e0-a26d-154171bf6acb%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>> Alvaro
>>
>> --
> 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 packer-tool+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/packer-tool/aa42ae4e-9069-4611-8e48-7f2e8b422af6%40googlegroups.com
> <https://groups.google.com/d/msgid/packer-tool/aa42ae4e-9069-4611-8e48-7f2e8b422af6%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Alvaro

-- 
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 packer-tool+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/packer-tool/CAHqq0ew3fd_C8Q89XpG_7V7kEb89WSBYcPJ61Dvb5-%3D4iAfAKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to