Skip to content

Latest commit

 

History

History
114 lines (81 loc) · 3.44 KB

DEVNOTES.md

File metadata and controls

114 lines (81 loc) · 3.44 KB

Developer notes for vagrant-vbox-snapshot

Forking and hacking on vagrant-vbox-snapshot

# fork vagrant-vbox-snapshot on github.com, and clone locally
cd ~/code # or wherever you like to put coding projects
git clone git@github.com/USERNAME/vagrant-vbox-snapshot.git
cd vagrant-vbox-snapshot

# create a new branch for your work
git checkout -b FEATURE_NAME

bundle install # not 100% sure this is necessary
# hack away...
# then test, possibly modifying Vagrantfile to suit scenario
vagrant up 
vagrant snapshot take TEST1  # and so on...

# then commit, push, and create pull request

Reviewing a pull request

git clone https://github.com/dergachev/vagrant-vbox-snapshot.git
cd vagrant-vbox-snapshot

# installs vagrant gem for local development
NOKOGIRI_USE_SYSTEM_LIBRARIES=1 bundle install

# consider branching if you aren't sure about merging it (not the case here, of course!)
# git checkout -b dubious-pull-request
git pull https://github.com/fgrehm/vagrant-vbox-snapshot multi-vm-environments-support

# test, fix stuff, etc (inside the locally installed bundle)
bundle exec vagrant up
bundle exec vagrant snapshot go

# push (merge into master if necessary)
git push -u origin master

Pushing out a new release of the gem

Do a local build:

vim lib/vagrant-vbox-snapshot/version.rb +/VERSION # increment version counter, eg to 0.0.3
gem build vagrant-vbox-snapshot.gemspec # creates vagrant-vbox-snapshot-0.0.3.gem  

Test the local build:

# test the gem locally, in a random vagrant project
cd ~/code/screengif
vagrant plugin uninstall vagrant-vbox-snapshot
vagrant plugin install ~/code/vagrant-vbox-snapshot/vagrant-vbox-snapshot-VERSION.gem # replace VERSION with 0.0.3
vagrant plugin list | grep snapshot   # ensure that correct version is installed
vagrant snapshot list -h   # quick sanity check
vagrant plugin uninstall vagrant-vbox-snapshot   # cleanup

Now commit and tag:

cd ~/code/vagrant-vbox-snapshot

vim CHANGELOG.txt        # update CHANGELOG
# git commit everything

gem push vagrant-vbox-snapshot-0.0.3.gem
git tag vN.N.N     # eg v0.0.3
git push --tags

Test installing from rubygems

cd ~/code/screengif
vagrant plugin install vagrant-vbox-snapshot

Updating to vagrant 1.1 plugin API

Resources:

Example code:

Vagrant source code:

other ideas related to snapshots