vagrant-tagprovision 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f0519d319d2c7188b7b1bec7f9ea0b2c423e6b7b
4
+ data.tar.gz: 8e83ad5565da905854521690eaf9353777a447cb
5
+ SHA512:
6
+ metadata.gz: e0c7582d9819ad7161e6a8526e7e74a48551fe124b80e2981e3a6795d08e24091a448bef2ee21e7c779a40a4ccd1f8c1fe20876bae0dc7e7226a74744a56ef68
7
+ data.tar.gz: 803adcdcfd6c44336f5b71c375ce7a989158a92ef55a8b81e3f3591c354fe89b30b7691e8f7aaa41f98031c1e387003a231b3c4086d449a417403bcce4557321
data/.gitignore ADDED
@@ -0,0 +1,19 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
18
+ .vagrant
19
+ vendor/bundle
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vagrant-TagProvision.gemspec
4
+ gemspec
5
+
6
+ group :development do
7
+ gem "vagrant", :git => "git://github.com/mitchellh/vagrant.git"
8
+ end
9
+ #
10
+ # group :plugins do
11
+ # gem "vagrant-tagprovision", path: "."
12
+ # end
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Brett Swift
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # Vagrant Pushbullet
2
+
3
+ This gem is a [Vagrant](http://www.vagrantup.com/) plugin that adds Pushbullet notifications to configured devices.
4
+
5
+ ## Setup Pushbullet
6
+
7
+ * First get a Pushbullet Account, and add devices to it.
8
+ - [Pushbullet.com](https://www.pushbullet.com/)
9
+ * Download the *iOS* app, *Chrome* plugin, *Android* app, and more. Add those to your Pushbullet account.
10
+ * Get your HTTP API Token: http://pushbullet.com/account
11
+
12
+ ## Install Plugin
13
+
14
+ ```bash
15
+ $ vagrant plugin install vagrant-pushbullet
16
+ ```
17
+
18
+ ## Plugin Usage
19
+
20
+ This plugin is configured purely by a configuration file in your home directory.
21
+ The plugin will create this file for you, but you will have to edit it manually (for now).
22
+
23
+ `~/.vagrant.d/pushbullet.rb`
24
+ ```ruby
25
+ module PushbulletConfig
26
+ TOKEN = "replace this text with token from pushbullet.com/account" #required
27
+ DEVICES = ['asdfasdfasdf','asdfasdfasdf'] #optional
28
+ end
29
+ ```
30
+
31
+ Run `vagrant pushbullet-config` to retrieve your Device ID's. Add those to the DEVICES array in the config file to limit which devices are notified.
32
+
33
+
34
+ ## Notifications
35
+
36
+ A notification is sent after these commands complete:
37
+
38
+ * note there is currently a bug where if an exception occurs in the provisioning, the notification is not sent.
39
+
40
+ - `vagrant up`
41
+ - `vagrant reload --provision`
42
+ - `vagrant provision`
43
+
44
+ ## Contributing
45
+
46
+ * use feature branches please. Prefer feature/your_feature_name
47
+ * submit pull requests to the `develop` branch
48
+
49
+
50
+ ## Author
51
+
52
+ Brett Swift
53
+
54
+ ## Kudos
55
+
56
+ [tcnksm](https://twitter.com/deeeet)
57
+ - for his vagrant-pushover plugin. This plugin is modeled after his.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ require "bundler/gem_tasks"
2
+ require 'rubygems'
3
+ require 'bundler/setup'
4
+
5
+ version = VagrantPlugins::Tagprovision::VERSION
6
+
7
+ desc "Install your plugin to your system vagrant."
8
+ task :install_plugin do
9
+ Rake::Task[:build].execute
10
+ system("/usr/bin/vagrant plugin install pkg/vagrant-tagprovision-#{version}.gem")
11
+ end
12
+
13
+ task :uninstall_plugin do
14
+ system("/usr/bin/vagrant plugin uninstall vagrant-tagprovision")
15
+ end
16
+
17
+ Bundler::GemHelper.install_tasks
18
+
19
+ # alias
20
+ task :i => :install_plugin
21
+ task :u => :uninstall_plugin
22
+
data/Vagrantfile ADDED
@@ -0,0 +1,5 @@
1
+ Vagrant.configure("2") do |config|
2
+ config.vm.box = "precise64"
3
+ config.vm.box_url = "http://files.vagrantup.com/precise64.box"
4
+ config.vm.provision :shell, inline: "echo 'Testing Notifications to Pushbullet'"
5
+ end
@@ -0,0 +1,41 @@
1
+ require "net/https"
2
+
3
+ module VagrantPlugins
4
+ module Tagprovision
5
+ class Action
6
+
7
+ def initialize(app,env)
8
+ @app = app
9
+ @ui = env[:ui]
10
+ @machine = env[:machine].name.to_s
11
+ @machinfo = env[:machine]
12
+ end
13
+
14
+ def call(env)
15
+ # Before machine action
16
+ state = env[:machine].state.id
17
+
18
+ # Execute machine action
19
+ @app.call(env)
20
+
21
+ # After execute machine action
22
+ action = env[:machine_action]
23
+ provision = env[:provision_enabled]
24
+
25
+ case action
26
+ when :up
27
+ client.push_note(iden, "Vagrant Hook Up: #{@machine}", '')
28
+ when :reload
29
+ client.push_note(iden, "Vagrant Hook Reload: #{@machine}", '')
30
+ when :provision
31
+ client.push_note(iden, "Vagrant Hoo Provision: #{@machine}", '')
32
+ end
33
+ end
34
+
35
+ def notification(config, config_file)
36
+
37
+ end
38
+ end
39
+ end
40
+ end
41
+
@@ -0,0 +1,43 @@
1
+ begin
2
+ require "vagrant"
3
+ rescue LoadError
4
+ raise "The Vagrant Tagprovision plugin must be run within Vagrant."
5
+ end
6
+
7
+ module VagrantPlugins
8
+ module Tagprovision
9
+
10
+ class Plugin < Vagrant.plugin("2")
11
+ name "Tagprovision"
12
+ description <<-DESC
13
+ This plugin tags the git repo when a server is provisioned.
14
+ DESC
15
+
16
+ #TODO replace this with 'set token' that takes a param.
17
+ command "tagprovision-config" do
18
+ require_relative "command"
19
+ Command
20
+ end
21
+
22
+ action_hook("Tagprovision_hook", :machine_action_up) do |hook|
23
+ require_relative "action"
24
+ hook.prepend(Action)
25
+ end
26
+
27
+ action_hook("Tagprovision_hook", :machine_action_provision) do |hook|
28
+ require_relative "action"
29
+ hook.prepend(Action)
30
+ end
31
+
32
+ action_hook("Tagprovision_hook", :machine_action_reload) do |hook|
33
+ require_relative "action"
34
+ hook.prepend(Action)
35
+ end
36
+
37
+ config(:Tagprovision) do
38
+ require_relative "config"
39
+ Config
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,5 @@
1
+ module VagrantPlugins
2
+ module Tagprovision
3
+ VERSION = "0.0.4"
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ require "pathname"
2
+ require "vagrant-tagprovision/version"
3
+ require "vagrant-tagprovision/plugin"
4
+
5
+ module VagrantPlugins
6
+ module Tagprovision
7
+
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'vagrant-tagprovision/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "vagrant-tagprovision"
8
+ spec.version = VagrantPlugins::Tagprovision::VERSION
9
+ spec.authors = ["jimrobinson"]
10
+ spec.email = ["jscrobinson@gmail.com"]
11
+ spec.summary = %q{Vagrant plugin that tags a git repo when servers are provisioned. }
12
+ spec.description = %q{Vagrant plugin that tags a git repo when servers are provisioned. }
13
+ spec.homepage = "https://github.com/jscrobinson/vagrant-tagprovision"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.5"
21
+ spec.add_development_dependency "rake"
22
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vagrant-tagprovision
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ platform: ruby
6
+ authors:
7
+ - jimrobinson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-01-08 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.5'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.5'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: 'Vagrant plugin that tags a git repo when servers are provisioned. '
42
+ email:
43
+ - jscrobinson@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - Gemfile
50
+ - LICENSE.txt
51
+ - README.md
52
+ - Rakefile
53
+ - Vagrantfile
54
+ - lib/vagrant-tagprovision.rb
55
+ - lib/vagrant-tagprovision/action.rb
56
+ - lib/vagrant-tagprovision/plugin.rb
57
+ - lib/vagrant-tagprovision/version.rb
58
+ - vagrant-tagprovision.gemspec
59
+ homepage: https://github.com/jscrobinson/vagrant-tagprovision
60
+ licenses:
61
+ - MIT
62
+ metadata: {}
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ required_rubygems_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ requirements: []
78
+ rubyforge_project:
79
+ rubygems_version: 2.4.5.1
80
+ signing_key:
81
+ specification_version: 4
82
+ summary: Vagrant plugin that tags a git repo when servers are provisioned.
83
+ test_files: []