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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1e05ebbe3644fdef156548706f3ce2f7158e06a1
4
- data.tar.gz: 5840e0395b15255ba2ada322be9c40e4b86a8f22
3
+ metadata.gz: 073e7ba90eaebb8c3031c8b9df00133ade6d605d
4
+ data.tar.gz: 2d8b509bcce5eb696b2b54109a90bcbbca93cb77
5
5
  SHA512:
6
- metadata.gz: 7eca6ba174da6c57fe1784cc7e7aefce28dd1f815b9958aa2f44af18f587dbbf215f6cbad2bc918668f30ccc224725540df7c093b25fb3fb631dddc700ad34ab
7
- data.tar.gz: 879d9c4ad7eece55978b1f4cb8f1359cac0f63fbcbfa1f3eb46dd0c2244704261fb0b66b417533d0db867888d5a46d4bebafb2b596efdcd7d5c16c2c26eb60d8
6
+ metadata.gz: 6cabebea9a2a7f97701702c599b27357d32af7444edede9720c8f4297f70d5823a96d274e180af5c47aaabd4d1d0f7881dcf6bafb08b5fe4a8979552867b539f
7
+ data.tar.gz: 895648e6de44a6d5f88a5c1b9c7224ef004261e8e63cbf4bb058cf2fc563a6697b27f8f725bb9369b7cfedb78a819a1ef6b03773cf338f9be454d41ea1c202c7
@@ -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
- response.reply("Deploying #{branch} to #{app_name}.")
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
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "lita-heroku"
3
- spec.version = "0.1.6"
3
+ spec.version = "0.1.7"
4
4
  spec.authors = ["Eric Boehs"]
5
5
  spec.email = ["ericboehs@gmail.com"]
6
6
  spec.description = "Lita handler for interacting with Heroku Apps"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lita-heroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Boehs