capistrano3-idobata 0.0.1

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: 28e212e992e0535abf43849c876209d97dae7405
4
+ data.tar.gz: 6c742bc936ba4b5fb0a8991d0d8b96f129a37e06
5
+ SHA512:
6
+ metadata.gz: 7892abe92946c611400550b1cb10e0e5a04dc035cef76fe690ea9aae6cc25014dd27c392dfcc4c22de567fb5fad6891f377c45f22608a0532d3022d620f2be5f
7
+ data.tar.gz: a78b0c43ea711b2a7ed7d15b6046e7e2470c5913cfd79b4157d1b74467cc2aec03bfaa562e1091d8fc9d392e3bf0d45b6fe8dbde63585bbabd7068de9580e490
data/.gitignore ADDED
@@ -0,0 +1,14 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ *.bundle
11
+ *.so
12
+ *.o
13
+ *.a
14
+ mkmf.log
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in capistrano3-idobata.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 kirikiriyamama
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,25 @@
1
+ # Capistrano3::Idobata
2
+
3
+ Send notification of a deployment to Idobata
4
+
5
+ ## Installation
6
+
7
+ ```ruby
8
+ # Gemfile
9
+ gem 'capistrano3-idobata', git: 'git@github.com:spice-life/capistrano3-idobata.git'
10
+
11
+ # Capfile
12
+ require 'capistrano3/idobata'
13
+
14
+ # config/deploy.rb
15
+ set :idobata_hook_url, 'https://idobata.io/hook/generic/XXXXX'
16
+ set :repository_url, "https://github.com/spice-life/capistrano3-idobata"
17
+ ```
18
+
19
+ ## Contributing
20
+
21
+ 1. Fork it ( https://github.com/spice-life/capistrano3-idobata/fork )
22
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
23
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
24
+ 4. Push to the branch (`git push origin my-new-feature`)
25
+ 5. Create a new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ require "bundler/gem_tasks"
2
+
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'capistrano3/idobata/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "capistrano3-idobata"
8
+ spec.version = Capistrano3::Idobata::VERSION
9
+ spec.authors = ["kirikiriyamama"]
10
+ spec.email = ["kirikiriyamama@icloud.com"]
11
+ spec.summary = %q{Send notification of a deployment to Idobata}
12
+ spec.description = %q{Send notification of a deployment to Idobata}
13
+ spec.homepage = ""
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_dependency "capistrano", "~> 3.1"
22
+ spec.add_dependency "idobata", "~> 0.0", ">= 0.0.9"
23
+
24
+ spec.add_development_dependency "bundler", "~> 1.7"
25
+ spec.add_development_dependency "rake", "~> 10.0"
26
+ end
@@ -0,0 +1,5 @@
1
+ module Capistrano3
2
+ module Idobata
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,3 @@
1
+ require 'idobata'
2
+
3
+ load File.join(__dir__, "tasks/idobata.rake")
@@ -0,0 +1,50 @@
1
+ namespace :idobata do
2
+ task :setup do
3
+ Idobata.hook_url = fetch(:idobata_hook_url)
4
+ end
5
+
6
+ namespace :notify do
7
+ task :started do
8
+ message = "#{deployer} started deploying"
9
+ label = [
10
+ { type: :info, text: 'Deploy' },
11
+ { type: :info, text: fetch(:stage) }
12
+ ]
13
+ Idobata::Message.create(format: :html, source: message, label: label)
14
+ end
15
+
16
+ task :finished do
17
+ repository_url = fetch(:repository_url)
18
+ branch_url = "#{repository_url}/tree/#{fetch(:branch)}"
19
+ revision_url = "#{repository_url}/commit/#{fetch(:current_revision)}"
20
+
21
+ message = "Branch <a href='#{branch_url}'>#{fetch(:branch)}</a> "
22
+ message += "(at <a href='#{revision_url}'>#{fetch(:current_revision)}</a>) "
23
+ message += "was deployed by #{deployer}"
24
+ label = [
25
+ { type: :success, text: 'Deploy' },
26
+ { type: :success, text: fetch(:stage) }
27
+ ]
28
+ Idobata::Message.create(format: :html, source: message, label: label)
29
+ end
30
+
31
+ task :failed do
32
+ message = "Deployment by #{deployer} has failed"
33
+ label = [
34
+ { type: :important, text: 'Deploy' },
35
+ { type: :important, text: fetch(:stage) }
36
+ ]
37
+ Idobata::Message.create(format: :html, source: message, label: label)
38
+ end
39
+ end
40
+ end
41
+
42
+ before 'deploy:starting', 'idobata:setup'
43
+
44
+ after 'deploy:started', 'idobata:notify:started'
45
+ after 'deploy:finished', 'idobata:notify:finished'
46
+ after 'deploy:failed', 'idobata:notify:failed'
47
+
48
+ def deployer
49
+ ENV['DEPLOYER'] || `git config user.name`.chomp
50
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: capistrano3-idobata
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - kirikiriyamama
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-01-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: capistrano
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.1'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3.1'
27
+ - !ruby/object:Gem::Dependency
28
+ name: idobata
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.0'
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 0.0.9
37
+ type: :runtime
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - "~>"
42
+ - !ruby/object:Gem::Version
43
+ version: '0.0'
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: 0.0.9
47
+ - !ruby/object:Gem::Dependency
48
+ name: bundler
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "~>"
52
+ - !ruby/object:Gem::Version
53
+ version: '1.7'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "~>"
59
+ - !ruby/object:Gem::Version
60
+ version: '1.7'
61
+ - !ruby/object:Gem::Dependency
62
+ name: rake
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '10.0'
68
+ type: :development
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '10.0'
75
+ description: Send notification of a deployment to Idobata
76
+ email:
77
+ - kirikiriyamama@icloud.com
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - ".gitignore"
83
+ - Gemfile
84
+ - LICENSE.txt
85
+ - README.md
86
+ - Rakefile
87
+ - capistrano3-idobata.gemspec
88
+ - lib/capistrano3/idobata.rb
89
+ - lib/capistrano3/idobata/version.rb
90
+ - lib/capistrano3/tasks/idobata.rake
91
+ homepage: ''
92
+ licenses:
93
+ - MIT
94
+ metadata: {}
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.2.2
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: Send notification of a deployment to Idobata
115
+ test_files: []