lmars/packer-post-processor-vagrant-s3

Missing box_name folder in S3

spkane opened this issue · 5 comments

The document seems to suggest that I should see resulting file paths like:

https://s3.amazonaws.com/my-s3-bucket/vagrant/boxes/my-cool-project/0.0.1/my-cool-project.box

However, I am actually seeing this:

https://s3.amazonaws.com/my-s3-bucket/vagrant/boxes/0.0.1/my-cool-project.box

Any idea what is going on? It seems like the box_name setting is not being used. Does the box_name directory need to exists already?

My template definition looks like this:

      {
        "type":     "vagrant-s3",
        "only": ["ebs-vagrant",
                 "ami-vagrant",
                 "vb",
                 "vmware"],
        "region":   "us-east-1",
        "bucket":   my-bucket",
        "acl":      "private",
        "manifest": "vagrant/json/{{user `box_name`}}-{{user `cm_tool`}}{{user `append_name`}}.json",
        "box_name": "{{user `box_name`}}-{{user `cm_tool`}}{{user `append_name`}}",
        "box_dir":  "vagrant/boxes",
        "version":  "{{ user `box_version` }}"
      }

So, after looking at the code, I worked around this, by changing my box_dir to read like this:

"box_dir": "vagrant/boxes/{{userbox_name}}-{{usercm_tool}}{{userappend_name}}"

I am not convinced that this is the way it is intended to work according to the documentation, but this seems to achieve the desired effect.

lmars commented

@spkane it looks like the documentation is incorrect, the path in S3 will be something like $BOX_DIR/$VERSION/$BOX_NAME (see here).

Do you want to make a PR to update the docs?

@lmars I had already looked at the code. I just wasn't sure if the code or documentation was the incorrect portion. If I get some time in the next few days, I'll through together a PR.

@lmars Pull Request #21 addresses this issue.

lmars commented

Closed by #21.