lita-travis-announcer 0.1.0 → 1.0.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f7791db49ad0004ef4a23e9297afd0b163f34ea
|
4
|
+
data.tar.gz: 32f2326e4e94e837d03be5df53b1f516918f3d0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190d7489f9d58f94e25660fb6e49e3c21cca241c81f9153c68f804860ff9557f344d1ab5b5eea56ed0142aa6250c363e29bd9ecf8277d306daef6c9268eb35f5
|
7
|
+
data.tar.gz: 5fb1c98e19cd41b75da80925a968cf8e59fb9a262fb9a77521f3fa856436b040079efb6d529f7d1370f364aed22e34634a49ad1a4540069d6df8f798ec67cc6e
|
data/Rakefile
CHANGED
@@ -4,7 +4,7 @@ module Lita
|
|
4
4
|
module Handlers
|
5
5
|
class TravisAnnouncer < Handler
|
6
6
|
|
7
|
-
config :travis_room, default: '
|
7
|
+
config :travis_room, default: 'shell'
|
8
8
|
|
9
9
|
http.post '/travis-announcer/travis', :travis_webhook
|
10
10
|
|
@@ -17,17 +17,13 @@ module Lita
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def handle_travis_build(hook)
|
20
|
-
if hook.
|
21
|
-
|
22
|
-
else
|
23
|
-
announce "it was a bad build."
|
24
|
-
end
|
20
|
+
announce '*Broken build!*' if hook.broken?
|
21
|
+
announce hook.notification_string
|
25
22
|
end
|
26
23
|
|
27
24
|
def announce(message)
|
28
|
-
|
29
|
-
|
30
|
-
robot.send_message Source.new(room: '#general'), msg
|
25
|
+
Lita.logger.debug "Received announcement: #{message}"
|
26
|
+
robot.send_message Source.new(room: '#general'), message
|
31
27
|
end
|
32
28
|
|
33
29
|
Lita.register_handler(self)
|
data/lib/lita/travis_webhook.rb
CHANGED
@@ -16,6 +16,14 @@ module Lita
|
|
16
16
|
status_message
|
17
17
|
end
|
18
18
|
|
19
|
+
def repo_name
|
20
|
+
repository.fetch 'name'
|
21
|
+
end
|
22
|
+
|
23
|
+
def notification_string
|
24
|
+
"*#{description}* [#{repo_name}] >> #{message} >> (#{compare_url})"
|
25
|
+
end
|
26
|
+
|
19
27
|
def working?
|
20
28
|
%w[Pending Passed Fixed].include? status_message
|
21
29
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |spec|
|
2
2
|
spec.name = 'lita-travis-announcer'
|
3
|
-
spec.version = '
|
3
|
+
spec.version = '1.0.0'
|
4
4
|
spec.authors = ['Daniel J. Pritchett']
|
5
5
|
spec.email = ['dpritchett@gmail.com']
|
6
6
|
spec.description = 'Chatops tools for announcing and deploying successful software builds'
|
@@ -0,0 +1,53 @@
|
|
1
|
+
{
|
2
|
+
"variables": [],
|
3
|
+
"info": {
|
4
|
+
"name": "lita travis hooks DEV",
|
5
|
+
"_postman_id": "40acfb2c-40c9-fcc3-f86c-8177e3fc6444",
|
6
|
+
"description": "",
|
7
|
+
"schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
|
8
|
+
},
|
9
|
+
"item": [
|
10
|
+
{
|
11
|
+
"name": "Travis Bad Build",
|
12
|
+
"request": {
|
13
|
+
"url": "localhost:8080/travis-announcer/travis",
|
14
|
+
"method": "POST",
|
15
|
+
"header": [],
|
16
|
+
"body": {
|
17
|
+
"mode": "formdata",
|
18
|
+
"formdata": [
|
19
|
+
{
|
20
|
+
"key": "payload",
|
21
|
+
"value": "{\n \"id\": 375024421,\n \"number\": \"56\",\n \"config\": {\n \"os\": \"linux\",\n \"rvm\": [\n \"2.3.3\"\n ],\n \"dist\": \"trusty\",\n \"group\": \"stable\",\n \".result\": \"configured\",\n \"language\": \"ruby\",\n \"services\": [\n \"redis-server\"\n ],\n \"notifications\": {\n \"webhooks\": [\n \"http:\\/\\/bookbot.pritchettbots.com\\/shipit\\/travis\",\n \"http:\\/\\/7c7e83e9.ngrok.io\\/shipit\\/travis\"\n ]\n }\n },\n \"type\": \"push\",\n \"state\": \"failed\",\n \"status\": 1,\n \"result\": 1,\n \"status_message\": \"Failed\",\n \"result_message\": \"Failed\",\n \"started_at\": \"2018-05-04T18:47:46Z\",\n \"finished_at\": \"2018-05-04T18:49:41Z\",\n \"duration\": 115,\n \"build_url\": \"https:\\/\\/travis-ci.org\\/dpritchett\\/ruby-bookbot\\/builds\\/375024421\",\n \"commit_id\": 112089127,\n \"commit\": \"64794d01af723add0f895383c1fa67cdfb865da3\",\n \"base_commit\": \"64794d01af723add0f895383c1fa67cdfb865da3\",\n \"head_commit\": null,\n \"branch\": \"djp\\/broken-build-for-travis\",\n \"message\": \"purposefully breaking the build for a travis fixture generation\",\n \"compare_url\": \"https:\\/\\/github.com\\/dpritchett\\/ruby-bookbot\\/commit\\/64794d01af72\",\n \"committed_at\": \"2018-05-04T18:47:26Z\",\n \"author_name\": \"Daniel J. Pritchett\",\n \"author_email\": \"dpritchett@gmail.com\",\n \"committer_name\": \"Daniel J. Pritchett\",\n \"committer_email\": \"dpritchett@gmail.com\",\n \"pull_request\": false,\n \"pull_request_number\": null,\n \"pull_request_title\": null,\n \"tag\": null,\n \"repository\": {\n \"id\": 12787622,\n \"name\": \"ruby-bookbot\",\n \"owner_name\": \"dpritchett\",\n \"url\": null\n },\n \"matrix\": [\n {\n \"id\": 375024422,\n \"repository_id\": 12787622,\n \"parent_id\": 375024421,\n \"number\": \"56.1\",\n \"state\": \"failed\",\n \"config\": {\n \"os\": \"linux\",\n \"rvm\": \"2.3.3\",\n \"dist\": \"trusty\",\n \"group\": \"stable\",\n \".result\": \"configured\",\n \"language\": \"ruby\",\n \"services\": [\n \"redis-server\"\n ],\n \"notifications\": {\n \"webhooks\": [\n \"http:\\/\\/bookbot.pritchettbots.com\\/shipit\\/travis\",\n \"http:\\/\\/7c7e83e9.ngrok.io\\/shipit\\/travis\"\n ]\n }\n },\n \"status\": 1,\n \"result\": 1,\n \"commit\": \"64794d01af723add0f895383c1fa67cdfb865da3\",\n \"branch\": \"djp\\/broken-build-for-travis\",\n \"message\": \"purposefully breaking the build for a travis fixture generation\",\n \"compare_url\": \"https:\\/\\/github.com\\/dpritchett\\/ruby-bookbot\\/commit\\/64794d01af72\",\n \"started_at\": null,\n \"finished_at\": null,\n \"committed_at\": \"2018-05-04T18:47:26Z\",\n \"author_name\": \"Daniel J. Pritchett\",\n \"author_email\": \"dpritchett@gmail.com\",\n \"committer_name\": \"Daniel J. Pritchett\",\n \"committer_email\": \"dpritchett@gmail.com\",\n \"allow_failure\": false\n }\n ]\n}\n",
|
22
|
+
"description": "",
|
23
|
+
"type": "text"
|
24
|
+
}
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"description": "It wa sa bad build."
|
28
|
+
},
|
29
|
+
"response": []
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"name": "Travis Good Build",
|
33
|
+
"request": {
|
34
|
+
"url": "localhost:8080/travis-announcer/travis",
|
35
|
+
"method": "POST",
|
36
|
+
"header": [],
|
37
|
+
"body": {
|
38
|
+
"mode": "formdata",
|
39
|
+
"formdata": [
|
40
|
+
{
|
41
|
+
"key": "payload",
|
42
|
+
"value": "{\n \"id\": 375009707,\n \"number\": \"55\",\n \"config\": {\n \"os\": \"linux\",\n \"rvm\": [\n \"2.3.3\"\n ],\n \"dist\": \"trusty\",\n \"group\": \"stable\",\n \".result\": \"configured\",\n \"language\": \"ruby\",\n \"services\": [\n \"redis-server\"\n ],\n \"notifications\": {\n \"webhooks\": [\n \"http:\\/\\/bookbot.pritchettbots.com\\/shipit\\/travis\",\n \"http:\\/\\/7c7e83e9.ngrok.io\\/shipit\\/travis\"\n ]\n }\n },\n \"type\": \"push\",\n \"state\": \"passed\",\n \"status\": 0,\n \"result\": 0,\n \"status_message\": \"Passed\",\n \"result_message\": \"Passed\",\n \"started_at\": \"2018-05-04T18:12:31Z\",\n \"finished_at\": \"2018-05-04T18:14:52Z\",\n \"duration\": 141,\n \"build_url\": \"https:\\/\\/travis-ci.org\\/dpritchett\\/ruby-bookbot\\/builds\\/375009707\",\n \"commit_id\": 112084793,\n \"commit\": \"7379b6e92f7dc9328953d03d207732852c6e9401\",\n \"base_commit\": \"7379b6e92f7dc9328953d03d207732852c6e9401\",\n \"head_commit\": null,\n \"branch\": \"master\",\n \"message\": \"Trying out some travis magic\",\n \"compare_url\": \"https:\\/\\/github.com\\/dpritchett\\/ruby-bookbot\\/compare\\/632250aff63e...7379b6e92f7d\",\n \"committed_at\": \"2018-05-04T18:12:21Z\",\n \"author_name\": \"Daniel J. Pritchett\",\n \"author_email\": \"dpritchett@gmail.com\",\n \"committer_name\": \"Daniel J. Pritchett\",\n \"committer_email\": \"dpritchett@gmail.com\",\n \"pull_request\": false,\n \"pull_request_number\": null,\n \"pull_request_title\": null,\n \"tag\": null,\n \"repository\": {\n \"id\": 12787622,\n \"name\": \"ruby-bookbot\",\n \"owner_name\": \"dpritchett\",\n \"url\": null\n },\n \"matrix\": [\n {\n \"id\": 375009708,\n \"repository_id\": 12787622,\n \"parent_id\": 375009707,\n \"number\": \"55.1\",\n \"state\": \"passed\",\n \"config\": {\n \"os\": \"linux\",\n \"rvm\": \"2.3.3\",\n \"dist\": \"trusty\",\n \"group\": \"stable\",\n \".result\": \"configured\",\n \"language\": \"ruby\",\n \"services\": [\n \"redis-server\"\n ],\n \"notifications\": {\n \"webhooks\": [\n \"http:\\/\\/bookbot.pritchettbots.com\\/shipit\\/travis\",\n \"http:\\/\\/7c7e83e9.ngrok.io\\/shipit\\/travis\"\n ]\n }\n },\n \"status\": 0,\n \"result\": 0,\n \"commit\": \"7379b6e92f7dc9328953d03d207732852c6e9401\",\n \"branch\": \"master\",\n \"message\": \"Trying out some travis magic\",\n \"compare_url\": \"https:\\/\\/github.com\\/dpritchett\\/ruby-bookbot\\/compare\\/632250aff63e...7379b6e92f7d\",\n \"started_at\": null,\n \"finished_at\": null,\n \"committed_at\": \"2018-05-04T18:12:21Z\",\n \"author_name\": \"Daniel J. Pritchett\",\n \"author_email\": \"dpritchett@gmail.com\",\n \"committer_name\": \"Daniel J. Pritchett\",\n \"committer_email\": \"dpritchett@gmail.com\",\n \"allow_failure\": false\n }\n ]\n}\n",
|
43
|
+
"description": "",
|
44
|
+
"type": "text"
|
45
|
+
}
|
46
|
+
]
|
47
|
+
},
|
48
|
+
"description": "We did it!"
|
49
|
+
},
|
50
|
+
"response": []
|
51
|
+
}
|
52
|
+
]
|
53
|
+
}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lita-travis-announcer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Pritchett
|
@@ -116,6 +116,7 @@ files:
|
|
116
116
|
- spec/fixtures/travis_success.json
|
117
117
|
- spec/lita/handlers/travis_announcer_spec.rb
|
118
118
|
- spec/lita/travis_webhook_spec.rb
|
119
|
+
- spec/postman/lita-travis-hooks-dev.postman_collection
|
119
120
|
- spec/spec_helper.rb
|
120
121
|
- templates/.gitkeep
|
121
122
|
homepage: https://github.com/dpritchett/lita-travis-announcer
|
@@ -148,4 +149,5 @@ test_files:
|
|
148
149
|
- spec/fixtures/travis_success.json
|
149
150
|
- spec/lita/handlers/travis_announcer_spec.rb
|
150
151
|
- spec/lita/travis_webhook_spec.rb
|
152
|
+
- spec/postman/lita-travis-hooks-dev.postman_collection
|
151
153
|
- spec/spec_helper.rb
|