vagrant-rebuild 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f89150b555d5e66035a9d768a1ff4bec90a13719
4
+ data.tar.gz: 8fcd88a2e00fba370689e4e63240f45f55e74b8d
5
+ SHA512:
6
+ metadata.gz: b2eb15aa9d8c32db292ec338996d4f9eaad08f538e42139187968619f1ea3075904690399be7091350458fdb936c2b9cdd6d1bb3779e590304bfaff70aa4fbb1
7
+ data.tar.gz: e15e30373eaf2193e6ba0bfd85fb22a225e8f2009f54f3a9565e54dfe2e0ee237e8deccecbc19f1b89adef26ddf64811f11446300f970d1764364e28959fec4f
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ .DS_Store
2
+ /.vagrant/
3
+ /vendor/
4
+ /.bundle/
5
+ /.yardoc
6
+ /Gemfile.lock
7
+ /_yardoc/
8
+ /coverage/
9
+ /doc/
10
+ /pkg/
11
+ /spec/reports/
12
+ /tmp/
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source "https://rubygems.org"
2
+
3
+ group :development do
4
+ gem "vagrant", git: "https://github.com/mitchellh/vagrant.git"
5
+ end
6
+
7
+ group :plugins do
8
+ gem "vagrant-rebuild", path: "."
9
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,106 @@
1
+ GIT
2
+ remote: https://github.com/mitchellh/vagrant.git
3
+ revision: bac5d039db438cc6528cac5213416a91490a40ed
4
+ specs:
5
+ vagrant (1.7.4.dev)
6
+ bundler (>= 1.5.2, <= 1.10.5)
7
+ childprocess (~> 0.5.0)
8
+ erubis (~> 2.7.0)
9
+ hashicorp-checkpoint (~> 0.1.1)
10
+ i18n (>= 0.6.0, <= 0.8.0)
11
+ listen (~> 3.0.2)
12
+ log4r (~> 1.1.9, < 1.1.11)
13
+ net-scp (~> 1.1.0)
14
+ net-sftp (~> 2.1)
15
+ net-ssh (>= 2.6.6, < 2.10.0)
16
+ nokogiri (= 1.6.3.1)
17
+ rb-kqueue (~> 0.2.0)
18
+ rest-client (>= 1.6.0, < 2.0)
19
+ wdm (~> 0.1.0)
20
+ winrm (~> 1.3)
21
+ winrm-fs (~> 0.2.0)
22
+
23
+ PATH
24
+ remote: .
25
+ specs:
26
+ vagrant-rebuild (0.1.1)
27
+
28
+ GEM
29
+ remote: https://rubygems.org/
30
+ specs:
31
+ builder (3.2.2)
32
+ childprocess (0.5.6)
33
+ ffi (~> 1.0, >= 1.0.11)
34
+ domain_name (0.5.24)
35
+ unf (>= 0.0.5, < 1.0.0)
36
+ erubis (2.7.0)
37
+ ffi (1.9.10)
38
+ gssapi (1.2.0)
39
+ ffi (>= 1.0.1)
40
+ gyoku (1.3.1)
41
+ builder (>= 2.1.2)
42
+ hashicorp-checkpoint (0.1.4)
43
+ http-cookie (1.0.2)
44
+ domain_name (~> 0.5)
45
+ httpclient (2.6.0.1)
46
+ i18n (0.7.0)
47
+ listen (3.0.2)
48
+ rb-fsevent (>= 0.9.3)
49
+ rb-inotify (>= 0.9)
50
+ little-plugger (1.1.3)
51
+ log4r (1.1.10)
52
+ logging (1.8.2)
53
+ little-plugger (>= 1.1.3)
54
+ multi_json (>= 1.8.4)
55
+ mime-types (2.6.1)
56
+ mini_portile (0.6.0)
57
+ multi_json (1.11.2)
58
+ net-scp (1.1.2)
59
+ net-ssh (>= 2.6.5)
60
+ net-sftp (2.1.2)
61
+ net-ssh (>= 2.6.5)
62
+ net-ssh (2.9.2)
63
+ netrc (0.10.3)
64
+ nokogiri (1.6.3.1)
65
+ mini_portile (= 0.6.0)
66
+ nori (2.6.0)
67
+ rb-fsevent (0.9.5)
68
+ rb-inotify (0.9.5)
69
+ ffi (>= 0.5.0)
70
+ rb-kqueue (0.2.4)
71
+ ffi (>= 0.5.0)
72
+ rest-client (1.8.0)
73
+ http-cookie (>= 1.0.2, < 2.0)
74
+ mime-types (>= 1.16, < 3.0)
75
+ netrc (~> 0.7)
76
+ rubyntlm (0.4.0)
77
+ rubyzip (1.1.7)
78
+ unf (0.1.4)
79
+ unf_ext
80
+ unf_ext (0.0.7.1)
81
+ uuidtools (2.1.5)
82
+ wdm (0.1.1)
83
+ winrm (1.3.3)
84
+ builder (>= 2.1.2)
85
+ gssapi (~> 1.2)
86
+ gyoku (~> 1.0)
87
+ httpclient (~> 2.2, >= 2.2.0.2)
88
+ logging (~> 1.6, >= 1.6.1)
89
+ nori (~> 2.0)
90
+ rubyntlm (~> 0.4.0)
91
+ uuidtools (~> 2.1.2)
92
+ winrm-fs (0.2.0)
93
+ erubis (~> 2.7)
94
+ logging (~> 1.6, >= 1.6.1)
95
+ rubyzip (~> 1.1)
96
+ winrm (~> 1.3.0)
97
+
98
+ PLATFORMS
99
+ ruby
100
+
101
+ DEPENDENCIES
102
+ vagrant!
103
+ vagrant-rebuild!
104
+
105
+ BUNDLED WITH
106
+ 1.10.5
data/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ Copyright (c) 2015, SimpliSafe
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice, this
8
+ list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright notice,
11
+ this list of conditions and the following disclaimer in the documentation
12
+ and/or other materials provided with the distribution.
13
+
14
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
18
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
20
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
21
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
22
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24
+
data/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # Rebuild
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/rebuild`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'vagrant-rebuild'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install vagrant-rebuild
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake false` to run the rebuilds. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/rebuild.
36
+
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/Vagrantfile ADDED
@@ -0,0 +1,71 @@
1
+ # -*- mode: ruby -*-
2
+ # vi: set ft=ruby :
3
+
4
+ # All Vagrant configuration is done below. The "2" in Vagrant.configure
5
+ # configures the configuration version (we support older styles for
6
+ # backwards compatibility). Please don't change it unless you know what
7
+ # you're doing.
8
+ Vagrant.configure(2) do |config|
9
+ # The most common configuration options are documented and commented below.
10
+ # For a complete reference, please see the online documentation at
11
+ # https://docs.vagrantup.com.
12
+
13
+ # Every Vagrant development environment requires a box. You can search for
14
+ # boxes at https://atlas.hashicorp.com/search.
15
+ config.vm.box = "puppetlabs/centos-7.0-64-puppet"
16
+
17
+ # Disable automatic box update checking. If you disable this, then
18
+ # boxes will only be checked for updates when the user runs
19
+ # `vagrant box outdated`. This is not recommended.
20
+ # config.vm.box_check_update = false
21
+
22
+ # Create a forwarded port mapping which allows access to a specific port
23
+ # within the machine from a port on the host machine. In the example below,
24
+ # accessing "localhost:8080" will access port 80 on the guest machine.
25
+ # config.vm.network "forwarded_port", guest: 80, host: 8080
26
+
27
+ # Create a private network, which allows host-only access to the machine
28
+ # using a specific IP.
29
+ # config.vm.network "private_network", ip: "192.168.33.10"
30
+
31
+ # Create a public network, which generally matched to bridged network.
32
+ # Bridged networks make the machine appear as another physical device on
33
+ # your network.
34
+ # config.vm.network "public_network"
35
+
36
+ # Share an additional folder to the guest VM. The first argument is
37
+ # the path on the host to the actual folder. The second argument is
38
+ # the path on the guest to mount the folder. And the optional third
39
+ # argument is a set of non-required options.
40
+ # config.vm.synced_folder "../data", "/vagrant_data"
41
+
42
+ # Provider-specific configuration so you can fine-tune various
43
+ # backing providers for Vagrant. These expose provider-specific options.
44
+ # Example for VirtualBox:
45
+ #
46
+ # config.vm.provider "virtualbox" do |vb|
47
+ # # Display the VirtualBox GUI when booting the machine
48
+ # vb.gui = true
49
+ #
50
+ # # Customize the amount of memory on the VM:
51
+ # vb.memory = "1024"
52
+ # end
53
+ #
54
+ # View the documentation for the provider you are using for more
55
+ # information on available options.
56
+
57
+ # Define a Vagrant Push strategy for pushing to Atlas. Other push strategies
58
+ # such as FTP and Heroku are also available. See the documentation at
59
+ # https://docs.vagrantup.com/v2/push/atlas.html for more information.
60
+ # config.push.define "atlas" do |push|
61
+ # push.app = "YOUR_ATLAS_USERNAME/YOUR_APPLICATION_NAME"
62
+ # end
63
+
64
+ # Enable provisioning with a shell script. Additional provisioners such as
65
+ # Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
66
+ # documentation for more information about their specific syntax and use.
67
+ # config.vm.provision "shell", inline: <<-SHELL
68
+ # sudo apt-get update
69
+ # sudo apt-get install -y apache2
70
+ # SHELL
71
+ end
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vagrant-rebuild"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/lib/command.rb ADDED
@@ -0,0 +1,88 @@
1
+ require 'vagrant'
2
+
3
+ module Rebuild
4
+ class Command < Vagrant.plugin("2", :command)
5
+ include Vagrant::Util::SafePuts
6
+
7
+ def self.synopsis
8
+ "stops and deletes all traces of the vagrant machine then starts and provisions the vagrant environment"
9
+ end
10
+
11
+ def execute
12
+ require Vagrant.source_root.join("plugins/commands/destroy/command")
13
+ require Vagrant.source_root.join("plugins/commands/up/command")
14
+
15
+ destroy_args = []
16
+ up_args = []
17
+
18
+ options = {}
19
+ options[:force] = false
20
+
21
+ opts = OptionParser.new do |o|
22
+ o.banner = "Usage: vagrant rebuild [options] [name]"
23
+ o.separator ""
24
+ o.separator "Options:"
25
+ o.separator ""
26
+
27
+ o.on("-f", "--force", "Destroy without confirmation.") do
28
+ destroy_args.push('-f')
29
+ end
30
+
31
+ o.on("--provider PROVIDER", String,
32
+ "Back the machine with a specific provider") do |provider|
33
+ up_args.push("--provider")
34
+ up_args.push("#{provider}")
35
+ end
36
+
37
+ o.on("--destroy-on-error",
38
+ "Destroy machine if any fatal error happens (default to true)") do |destroy|
39
+ up_args.push("--destroy-on-error")
40
+ end
41
+
42
+ o.on("--no-destroy-on-error",
43
+ "WIll not destroy machine if any fatal error happens (default to true)") do |destroy|
44
+ up_args.push("--no-destroy-on-error")
45
+ end
46
+
47
+ o.on("--parallel",
48
+ "Enable parallelism if provider supports it") do |parallel|
49
+ up_args.push("--parallel")
50
+ end
51
+
52
+ o.on("--no-parallel",
53
+ "Disable parallelism if provider supports it") do |parallel|
54
+ up_args.push("--no-parallel")
55
+ end
56
+
57
+ o.on("--provision", "Enable provisioning") do |p|
58
+ up_args.push("--provision")
59
+ end
60
+
61
+ o.on("--no-provision", "Disable provisioning") do |p|
62
+ up_args.push("--no-provision")
63
+ end
64
+
65
+ o.on("--provision-with x,y,z", Array,
66
+ "Enable only certain provisioners, by type.") do |list|
67
+ up_args.push("--provision-with")
68
+ up_args.push(list.join(','))
69
+ end
70
+
71
+ end
72
+
73
+ argv = parse_options(opts)
74
+ return if ! argv
75
+
76
+ destroy_args.concat(argv)
77
+ up_args.concat(argv)
78
+
79
+ destroy = VagrantPlugins::CommandDestroy::Command.new(destroy_args, @env)
80
+ destroy.execute
81
+
82
+ up = VagrantPlugins::CommandUp::Command.new(up_args, @env)
83
+ up.execute
84
+
85
+ return 0
86
+ end
87
+ end
88
+ end
@@ -0,0 +1,3 @@
1
+ module Rebuild
2
+ VERSION = "0.1.1"
3
+ end
@@ -0,0 +1,14 @@
1
+ require "vagrant-rebuild/version"
2
+
3
+ module Rebuild
4
+ class Rebuild < Vagrant.plugin("2")
5
+ name "vagrant-rebuild"
6
+ description "stops and deletes all traces of the vagrant machine then starts and provisions the vagrant environment"
7
+
8
+ command "rebuild" do
9
+ #require_relative "vagrant-rebuild"
10
+ require File.expand_path("../command", __FILE__)
11
+ Command
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-rebuild/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-rebuild"
8
+ spec.version = Rebuild::VERSION
9
+ spec.authors = ['Kevin Cormier', 'Garin Bedian']
10
+ spec.email = ['kevin.cormier@simplisafe.com', 'garin.bedian@simplisafe.com']
11
+
12
+ spec.summary = "Stops and deletes all traces of the vagrant machine then starts and provisions the vagrant environment"
13
+ spec.homepage = "http://example.com"
14
+
15
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
16
+ # delete this section to allow pushing this gem to any host.
17
+ if spec.respond_to?(:metadata)
18
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
19
+ else
20
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
21
+ end
22
+
23
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(vagrant-rebuild|spec|features)/}) }
24
+ spec.bindir = "exe"
25
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
+ spec.require_paths = ["lib"]
27
+
28
+ spec.add_development_dependency "bundler", "~> 1.10"
29
+ spec.add_development_dependency "rake", "~> 10.0"
30
+ end
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-rebuild
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Kevin Cormier
8
+ - Garin Bedian
9
+ autorequire:
10
+ bindir: exe
11
+ cert_chain: []
12
+ date: 2015-07-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - ~>
19
+ - !ruby/object:Gem::Version
20
+ version: '1.10'
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ version: '1.10'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rake
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ~>
33
+ - !ruby/object:Gem::Version
34
+ version: '10.0'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ~>
40
+ - !ruby/object:Gem::Version
41
+ version: '10.0'
42
+ description:
43
+ email:
44
+ - kevin.cormier@simplisafe.com
45
+ - garin.bedian@simplisafe.com
46
+ executables: []
47
+ extensions: []
48
+ extra_rdoc_files: []
49
+ files:
50
+ - .gitignore
51
+ - Gemfile
52
+ - Gemfile.lock
53
+ - LICENSE
54
+ - README.md
55
+ - Rakefile
56
+ - Vagrantfile
57
+ - bin/console
58
+ - bin/setup
59
+ - lib/command.rb
60
+ - lib/vagrant-rebuild.rb
61
+ - lib/vagrant-rebuild/version.rb
62
+ - vagrant-rebuild.gemspec
63
+ homepage: http://example.com
64
+ licenses: []
65
+ metadata:
66
+ allowed_push_host: 'TODO: Set to ''http://mygemserver.com'''
67
+ post_install_message:
68
+ rdoc_options: []
69
+ require_paths:
70
+ - lib
71
+ required_ruby_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ requirements:
78
+ - - '>='
79
+ - !ruby/object:Gem::Version
80
+ version: '0'
81
+ requirements: []
82
+ rubyforge_project:
83
+ rubygems_version: 2.0.14
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Stops and deletes all traces of the vagrant machine then starts and provisions
87
+ the vagrant environment
88
+ test_files: []