lita-heroku 0.1.3 → 0.1.4
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 +4 -4
- data/lib/lita/handlers/heroku.rb +11 -3
- data/lita-heroku.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20b7b82c2a0f0f61ff20c86159ddd6d9d5aa757c
|
4
|
+
data.tar.gz: dd987cf29419a539fb30c6a79f5ed627bbf94632
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d58fe9d81163e010cacdee0baacdd589b04151f9c7add78f4939ab6d492c983b9c8172c6bb4867d2a7830de6548885eff8748c2defa552bfa067b30eff6cf1f
|
7
|
+
data.tar.gz: e8dfc016f34e3b1ac49bf2270acf998a740f100af899b520d97b87fbe844946945c133ff4ff568f469d53c2bb4033fb9672248ce1dc491d4303fb6ee1f53ce2d
|
data/lib/lita/handlers/heroku.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "json"
|
2
|
+
require "open3"
|
2
3
|
module Lita
|
3
4
|
module Handlers
|
4
5
|
class Heroku < Handler
|
@@ -15,7 +16,13 @@ module Lita
|
|
15
16
|
if command == "deploy"
|
16
17
|
heroku_deploy response
|
17
18
|
else
|
18
|
-
|
19
|
+
stdout, stderr, status = Open3.capture3 "#{heroku_bin} #{command} -a #{config.app_prefix}#{environment}"
|
20
|
+
response_text = "```\n"
|
21
|
+
response_text += stdout
|
22
|
+
response_text += stderr
|
23
|
+
response_text += "Exited with status #{status.exitstatus}" unless status.exitstatus.zero?
|
24
|
+
response_text += "```"
|
25
|
+
response.reply response_text
|
19
26
|
end
|
20
27
|
end
|
21
28
|
|
@@ -37,8 +44,9 @@ module Lita
|
|
37
44
|
|
38
45
|
def heroku_deploy(response)
|
39
46
|
bearer = config.oauth_token
|
40
|
-
app_name =
|
41
|
-
|
47
|
+
app_name, branch = response.matches[0][0].split
|
48
|
+
app_name = "#{config.app_prefix}#{app_name}" unless app_name.start_with? config.app_prefix
|
49
|
+
branch ||= "master"
|
42
50
|
|
43
51
|
apps = JSON.parse `curl -s "https://api.heroku.com/apps" -H "Authorization: Bearer #{bearer}" -H 'Accept: application/vnd.heroku+json; version=3'`
|
44
52
|
app = apps.select{|app| app["name"] == app_name }.first
|
data/lita-heroku.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-heroku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Boehs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lita
|