lita-heroku 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lita/handlers/heroku.rb +8 -2
- data/lita-heroku.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 073e7ba90eaebb8c3031c8b9df00133ade6d605d
|
4
|
+
data.tar.gz: 2d8b509bcce5eb696b2b54109a90bcbbca93cb77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cabebea9a2a7f97701702c599b27357d32af7444edede9720c8f4297f70d5823a96d274e180af5c47aaabd4d1d0f7881dcf6bafb08b5fe4a8979552867b539f
|
7
|
+
data.tar.gz: 895648e6de44a6d5f88a5c1b9c7224ef004261e8e63cbf4bb058cf2fc563a6697b27f8f725bb9369b7cfedb78a819a1ef6b03773cf338f9be454d41ea1c202c7
|
data/lib/lita/handlers/heroku.rb
CHANGED
@@ -5,6 +5,7 @@ module Lita
|
|
5
5
|
class Heroku < Handler
|
6
6
|
config :oauth_token, required: true
|
7
7
|
config :app_prefix
|
8
|
+
config :bitly_access_token
|
8
9
|
|
9
10
|
route(/^hk\s+([^ ]+)\s+(.+)/, :heroku_cmd, command: true, help: {
|
10
11
|
"hk [app name] [command]" => "example: 'lita hk production ps'",
|
@@ -52,10 +53,15 @@ module Lita
|
|
52
53
|
build_response = `curl -s "https://kolkrabbi.herokuapp.com/apps/#{app_id}/github/push" -H "Authorization: Bearer #{bearer}" -d '{"branch":"#{branch}"}'`
|
53
54
|
build_response = JSON.parse build_response
|
54
55
|
|
56
|
+
$stdout.puts build_response
|
55
57
|
if build_response.key?("build") && build_response["build"]["status"] == "pending"
|
56
|
-
|
58
|
+
response_text = "Deploying #{branch} to #{app_name}. "
|
59
|
+
if config.bitly_access_token
|
60
|
+
bitly_response = JSON.parse `curl -sGX GET --data-urlencode "longUrl=#{build_response["build"]["output_stream_url"]}" "https://api-ssl.bitly.com/v3/shorten?access_token=#{config.bitly_access_token}"`
|
61
|
+
response_text += "Build output at: #{bitly_response['data']['url']}."
|
62
|
+
end
|
63
|
+
response.reply response_text
|
57
64
|
else
|
58
|
-
$stdout.puts build_response
|
59
65
|
response.reply("Deploy could not be started. Response: #{build_response}")
|
60
66
|
end
|
61
67
|
end
|
data/lita-heroku.gemspec
CHANGED