mina-jianliao 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +28 -0
- data/LICENSE.txt +22 -0
- data/README.md +52 -0
- data/Rakefile +1 -0
- data/lib/mina/jianliao.rb +10 -0
- data/lib/mina/jianliao/defaults.rb +9 -0
- data/lib/mina/jianliao/tasks.rb +56 -0
- data/lib/mina/jianliao/version.rb +5 -0
- data/mina-jianliao.gemspec +26 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 89c39f9d9e0b59bc566591b26046086671a5d7ec
|
4
|
+
data.tar.gz: 387c456725eadee8cb37cea209871b30788bfe7d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 643beca4c196f57dead9eaca36a49431f0ce9d63ea5f5deb4d71479b9bfea97905169adfd865b9699303af04f20a8e2d17e06780dce879744d9c1292d0147b14
|
7
|
+
data.tar.gz: 358b5552ea48569835e4ef78dafa2e19d5a4f27e34e6264bb7c2e2946e91e2dd40772ee7baf3afe63b4d981cea7d23cdc6a91ad168618495ff6ed9342b84a23c
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mina-jianliao (0.1.0)
|
5
|
+
mina
|
6
|
+
mina-hooks
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
mina (0.3.7)
|
12
|
+
open4 (~> 1.3.4)
|
13
|
+
rake
|
14
|
+
mina-hooks (0.2.1)
|
15
|
+
mina (~> 0.3)
|
16
|
+
open4 (1.3.4)
|
17
|
+
rake (10.4.2)
|
18
|
+
|
19
|
+
PLATFORMS
|
20
|
+
ruby
|
21
|
+
|
22
|
+
DEPENDENCIES
|
23
|
+
bundler (~> 1.3)
|
24
|
+
mina-jianliao!
|
25
|
+
rake
|
26
|
+
|
27
|
+
BUNDLED WITH
|
28
|
+
1.10.6
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 TAKAyuki_atkwsk
|
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,52 @@
|
|
1
|
+
# Mina::Jianliao
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
gem 'mina-jianliao'
|
8
|
+
|
9
|
+
And then execute:
|
10
|
+
|
11
|
+
$ bundle
|
12
|
+
|
13
|
+
Or install it yourself as:
|
14
|
+
|
15
|
+
$ gem install mina-jianliao
|
16
|
+
|
17
|
+
In your jianliao settings, create new Incomming WebHooks and get WebHooks URL.
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
### Load the recipe
|
22
|
+
Include the recipe in your deploy.rb
|
23
|
+
|
24
|
+
# config/deploy.rb
|
25
|
+
require 'mina/jianliao'
|
26
|
+
|
27
|
+
### Setup Jianliao Details
|
28
|
+
You'll need to setup your jianliao details with an API key, room and subdomain. You can add these as ENV variables or in the config/deploy.rb
|
29
|
+
|
30
|
+
# required
|
31
|
+
set :jianliao_url, "webhook_token" # comes from inbound webhook integration
|
32
|
+
|
33
|
+
# optional
|
34
|
+
set :jianliao_application, "Application Name"
|
35
|
+
set :jianliao_authorname, "Deploy Bot" # displayed as name of message sender
|
36
|
+
|
37
|
+
Or use the ENV variables:
|
38
|
+
|
39
|
+
# required
|
40
|
+
ENV['JIANLIAO_URL'] = ''
|
41
|
+
|
42
|
+
# optional
|
43
|
+
ENV['JIANLIAO_APPLICATION'] = ''
|
44
|
+
ENV['JIANLIAO_AUTHORNAME'] = ''
|
45
|
+
|
46
|
+
## Contributing
|
47
|
+
|
48
|
+
1. Fork it
|
49
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
50
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
51
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
52
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Required
|
2
|
+
set_default :jianliao_url, -> { ENV['JIANLIAO_URL'] }
|
3
|
+
|
4
|
+
# Optional
|
5
|
+
set :jianliao_application, -> { ENV['JIANLIAO_APPLICATION'] || 'application' }
|
6
|
+
set_default :jianliao_authorName, -> { ENV['JIANLIAO_AUTHORNAME'] || 'deploybot' }
|
7
|
+
# Git
|
8
|
+
set_default :deployer, -> { ENV['GIT_AUTHOR_NAME'] || %x[git config user.name].chomp }
|
9
|
+
set_default :deployed_revision, -> { ENV['GIT_COMMIT'] || %x[git rev-parse #{branch}].strip }
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'mina/hooks'
|
2
|
+
require 'json'
|
3
|
+
require 'net/http'
|
4
|
+
|
5
|
+
# Before and after hooks for mina deploy
|
6
|
+
before_mina :deploy, :'jianliao:starting'
|
7
|
+
after_mina :deploy, :'jianliao:finished'
|
8
|
+
|
9
|
+
|
10
|
+
# Jianliao tasks
|
11
|
+
namespace :jianliao do
|
12
|
+
|
13
|
+
task :starting do
|
14
|
+
if jianliao_url
|
15
|
+
set(:start_time, Time.now)
|
16
|
+
else
|
17
|
+
print_local_status "Unable to create Jianliao Announcement, no jianliao details provided."
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
task :finished do
|
22
|
+
if jianliao_url
|
23
|
+
end_time = Time.now
|
24
|
+
start_time = fetch(:start_time)
|
25
|
+
elapsed = end_time.to_i - start_time.to_i
|
26
|
+
|
27
|
+
announcement = "#{announced_deployer} successfully deployed #{announced_application_name} in #{elapsed} seconds."
|
28
|
+
|
29
|
+
post_jianliao_message(announcement)
|
30
|
+
else
|
31
|
+
print_local_status "Unable to create Jianliao Announcement, no jianliao details provided."
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def short_revision
|
36
|
+
deployed_revision[0..7] if deployed_revision
|
37
|
+
end
|
38
|
+
|
39
|
+
def announced_application_name
|
40
|
+
"".tap do |output|
|
41
|
+
output << jianliao_application if jianliao_application
|
42
|
+
output << " (#{short_revision})" if short_revision
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def post_jianliao_message(message)
|
47
|
+
uri = URI(jianliao_url)
|
48
|
+
|
49
|
+
payload = {
|
50
|
+
"authorName" => jianliao_authorname,
|
51
|
+
"text" => message
|
52
|
+
}
|
53
|
+
|
54
|
+
res = Net::HTTP.post_form(uri, payload)
|
55
|
+
end
|
56
|
+
end
|
@@ -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 'mina/jianliao/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mina-jianliao"
|
8
|
+
spec.version = Mina::Jianliao::VERSION
|
9
|
+
spec.authors = ["nickcen"]
|
10
|
+
spec.email = ["cenyongh@gmail.com"]
|
11
|
+
spec.description = %q{Jianliao web hook from mina}
|
12
|
+
spec.summary = %q{Jianliao web hook from mina}
|
13
|
+
spec.homepage = "https://github.com/nickcen/mina-jianliao"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
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_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake", '~> 0'
|
23
|
+
|
24
|
+
spec.add_dependency "mina", '~> 0'
|
25
|
+
spec.add_dependency "mina-hooks", '~> 0'
|
26
|
+
end
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mina-jianliao
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- nickcen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-11-24 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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
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
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mina
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: mina-hooks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Jianliao web hook from mina
|
70
|
+
email:
|
71
|
+
- cenyongh@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- Gemfile
|
77
|
+
- Gemfile.lock
|
78
|
+
- LICENSE.txt
|
79
|
+
- README.md
|
80
|
+
- Rakefile
|
81
|
+
- lib/mina/jianliao.rb
|
82
|
+
- lib/mina/jianliao/defaults.rb
|
83
|
+
- lib/mina/jianliao/tasks.rb
|
84
|
+
- lib/mina/jianliao/version.rb
|
85
|
+
- mina-jianliao.gemspec
|
86
|
+
homepage: https://github.com/nickcen/mina-jianliao
|
87
|
+
licenses:
|
88
|
+
- MIT
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0'
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubyforge_project:
|
106
|
+
rubygems_version: 2.4.8
|
107
|
+
signing_key:
|
108
|
+
specification_version: 4
|
109
|
+
summary: Jianliao web hook from mina
|
110
|
+
test_files: []
|
111
|
+
has_rdoc:
|