lita-docker-hub 0.1.15 → 0.2.0
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 +8 -8
- data/README.md +2 -0
- data/lib/lita/handlers/docker_hub.rb +3 -4
- data/lib/lita/handlers/version.rb +1 -1
- data/templates/build.erb +1 -1
- data/templates/build.slack.erb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZTEyMTk4ODUxNTVjNDgzN2E2YWUxMzk4NDQyYjA0NjdiZTFjZjBmNQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NDllMjJiMmM5ZGY4MzcwZDU5YWMyMjQxMzJiNWYzZTEzODE1OGE2Mw==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
YzBlMzY4NDMzNjMwOWM1MDk0Yzc2MmMzN2JjNDgzMjFhMzJmMDZlMjA5YjY4
|
|
10
|
+
Zjc3ZTYxYmQ5ZjMwYzJkMDE1NmE4MWJiNWI1ZGYwODIzMmY4OTIyNWFmZDU1
|
|
11
|
+
NmMxMmU5N2IwZjVhNWNmYmVkZTY5M2VkOTkxNzkzMjI2N2E0YWM=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
YWUzYzRjYjI3Y2ZhMTllMzcxNTA2NWU0NWE3YzljYjkxZTE5NWFiNTcxYjJk
|
|
14
|
+
ZjU4MTg4MzFlOTVmNTFiZWNkMzNlZWFiZGIxMDYxMmZlNWE2MDMyY2IxNTIx
|
|
15
|
+
MmNmOTk4NWIyMjBmYjA3YjhjOTFmNzRmOGNiOWVhZjc5MjUyNTU=
|
data/README.md
CHANGED
|
@@ -22,6 +22,8 @@ Lita.configure do |config|
|
|
|
22
22
|
end
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
Make sure that the Lita bot is a member of this room.
|
|
26
|
+
|
|
25
27
|
## Usage
|
|
26
28
|
|
|
27
29
|
In Docker Hub go to the repository that you want to connect with Lita. You should have admin access to the Docker Hub configuration, and it should be an autobuild repository (builds triggered by Github or Bitbucket commits). Open the *Webhooks* tab of the repository and add the following URL:
|
|
@@ -12,24 +12,23 @@ module Lita
|
|
|
12
12
|
repo_name = body.fetch("repository", {}).fetch("repo_name", nil)
|
|
13
13
|
repo_url = body.fetch("repository", {}).fetch("repo_url", nil)
|
|
14
14
|
tag = body.fetch("push_data", {}).fetch("tag", nil)
|
|
15
|
+
pusher = body.fetch("push_data", {}).fetch("pusher", nil)
|
|
15
16
|
pushed_at = body.fetch("push_data", {}).fetch("pushed_at", nil)
|
|
16
17
|
|
|
17
|
-
if repo_name.present? && repo_url.present? && tag.present? && pushed_at.present?
|
|
18
|
+
if repo_name.present? && repo_url.present? && tag.present? && pusher.present? && pushed_at.present?
|
|
18
19
|
build_time = time_interval(Time.at(pushed_at), Time.now)
|
|
19
20
|
|
|
20
21
|
target = find_room_by_name(config.room)
|
|
21
22
|
message = render_template("build", repo_name: repo_name,
|
|
22
23
|
tag: tag,
|
|
24
|
+
pusher: pusher,
|
|
23
25
|
build_time: build_time)
|
|
24
26
|
|
|
25
|
-
Lita.logger.debug target.id
|
|
26
|
-
|
|
27
27
|
case robot.config.robot.adapter
|
|
28
28
|
when :slack
|
|
29
29
|
attachment = ::Lita::Adapters::Slack::Attachment.new(message,
|
|
30
30
|
title: "Docker Hub",
|
|
31
31
|
title_link: repo_url,
|
|
32
|
-
thumb_url: "https://docs.docker.com/v1.6/img/nav/docker-logo-loggedin.png",
|
|
33
32
|
color: "#36a64f")
|
|
34
33
|
robot.chat_service.send_attachment(target, [attachment])
|
|
35
34
|
else
|
data/templates/build.erb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Docker Hub build of <%= @repo_name %>@<%= @tag %> passed in <%= @build_time %>
|
|
1
|
+
Docker Hub build of <%= @repo_name %>@<%= @tag %> by <%= @pusher %> passed in <%= @build_time %>
|
data/templates/build.slack.erb
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Build of
|
|
1
|
+
Build of *<%= @repo_name %>@<%= @tag %>* by <%= @pusher %> passed in <%= @build_time %>
|