Sha256: 1b1dddcf200b6fe3e49145846de75732d6f76c8a2537b174f296b7bbda243e85

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

begin
  require "vagrant"
rescue LoadError
  raise "The vagrant-uplift plugin must be run within Vagrant."
end

module VagrantPlugins::UpliftCheckpoint
  
    # https://superuser.com/questions/701735/run-script-on-host-machine-during-vagrant-up/992220#992220
    class Config < Vagrant.plugin("2", :config)
        attr_accessor :name
    end
  
    class Plugin < Vagrant.plugin("2")
        name "vagrant-uplift-checkpoint"
  
        config(:uplift_checkpoint, :provisioner) do
            Config
        end
  
        provisioner(:uplift_checkpoint) do
            Provisioner
        end
    end
  
    class Provisioner < Vagrant.plugin("2", :provisioner)
  
        def provision
            machine_name    = @machine.name
            checkpoint_name = config.name
          
            dir = ".vagrant/machines/#{machine_name}/virtualbox/.uplift/"
            
            FileUtils.mkdir_p dir
            file_name =File.join(dir, ".checkpoint-#{checkpoint_name}")
  
            File.write(file_name, 'ok')
        end
    end
    
  end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
vagrant-uplift-0.2.1902.49 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.46 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.42 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.40 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.39 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.37 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.32 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.19 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb
vagrant-uplift-0.2.1902.18 lib/vagrant-uplift/plugin-vagrant-uplift-checkpoint.rb