mitchellh / vagrant-google

Vagrant provider for GCE.
Apache License 2.0
334 stars 100 forks source link

Added GCE image family handling. #177

Closed jim-raney-physiq closed 7 years ago

jim-raney-physiq commented 7 years ago

I've added "image_family" as an available argument which overrides the image with the latest image from the family. Tested on Linux with both private and public (centos-7) images. I'm unable to run the acceptance tests as I keep getting: stderr: /usr/lib/ruby/vendor_ruby/bundler/source/git.rb:191:in 'rescue in load_spec_files': https://github.com/mitchellh/vagrant-spec.git (at master@e623a56) is not yet checked out. Runbundle installfirst. (Bundler::GitError) even though bundle install was run (I'm not really a ruby programmer).

jim-raney-physiq commented 7 years ago

To set an error condition when both image and image_family were set I had to use a nested if around the setting of image to preserve setting a default image if neither image or image_family were set:

https://github.com/jim-raney-physiq/vagrant-google/blob/98b4ac36ec00bd79b649512bee725236c142c106/lib/vagrant-google/config.rb#L268-L275

If there's a better way to do it I'm all ears.

jim-raney-physiq commented 7 years ago

Just a bump, been a while since I’ve heard anything, would like to get this in to go along with a new Jenkins-driven packer-based pipeline that will deliver updated vagrant boxes to our devs.

Temikus commented 7 years ago

@jim-raney-physiq Acknowledged. Sorry, got a bit overwhelmed in the past couple of weeks. Let me test this.

Temikus commented 7 years ago

Thank you for your patience and huge thanks for the PR. Acceptance looking good:

Finished in 32 minutes 33 seconds (files took 1.6 seconds to load)
8 examples, 0 failures

@erjohnso Please, merge.

jim-raney-physiq commented 7 years ago

Great, thanks.