sandstorm-io / vagrant-spk

Packaging tool for Sandstorm, a self-hosting platform for web apps!
Apache License 2.0
55 stars 29 forks source link

Extend setupvm to generate .sandstorm in project subdirectory #182

Open zombiezen opened 8 years ago

zombiezen commented 8 years ago

From an email thread with @paulproteus, it would be really nice to be able to create the .sandstorm directory in a subdirectory of the project directory -- some projects want to keep their packaging scripts in a contrib/ directory, for instance. I'm envisioning this:

$ git clone https://example.com/myproject.git myproject
$ cd myproject
$ vagrant-spk setupvm --subdir=contrib/sandstorm/
# contrib/sandstorm/.sandstorm is created, with the scripts pointing to things in
# /opt/app/contrib/sandstorm/.sandstorm/, and the Vagrantfile including the top-level project.
$ cd contrib/sandstorm
$ vagrant-spk vm up

This way, all that has to change is the scripts that are generated in the directory. The rest of vagrant-spk acts as-is.

paulproteus commented 8 years ago

I'm curious if the following workflow would work instead:

$ git clone https://example.com/myproject.git myproject $ cd myproject $ mkdir -p contrib/sandstorm $ cd contrib/sandstorm $ vagrant-spk setupvm --app-base-dir=../..

contrib/sandstorm/.sandstorm is created, with the scripts pointing to

things in

/opt/app/contrib/sandstorm/.sandstorm/, and the Vagrantfile including the

top-level project. $ vagrant-spk vm up

That would happen to be even easier for us to implement, I think; curious what you think about that Ross.

zombiezen commented 8 years ago

In your proposal, would --app-base-dir ever be something that's not a sequence of ../ path components?

paulproteus commented 8 years ago

I think it would always be a series of "../" path components in my proposal.​ (That way, one can be relatively sure that the app-base-dir is portable across different systems that are "git clone"-ing the same repo.)

zombiezen commented 8 years ago

As a user, I'm more in favor of specifying the subdirectory while cd'd into the project root, since it's far easier for me to type the path I want versus I always mess up sequences of ../. :)

paulproteus commented 8 years ago

Sensible enough!