lita-snap-ci 1.0.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 +7 -0
- data/.gitignore +19 -0
- data/Gemfile +3 -0
- data/README.md +87 -0
- data/Rakefile +6 -0
- data/lib/lita-snap-ci.rb +12 -0
- data/lib/lita/handlers/snap_ci.rb +45 -0
- data/lib/snap_ci.rb +1 -0
- data/lib/snap_ci/http.rb +20 -0
- data/lib/snap_ci/parser.rb +16 -0
- data/lib/snap_ci/project.rb +63 -0
- data/lib/snap_ci/project_list.rb +23 -0
- data/lita-snap-ci.gemspec +25 -0
- data/locales/en.yml +10 -0
- data/spec/fixtures/api_development.json +107 -0
- data/spec/fixtures/api_master.json +127 -0
- data/spec/fixtures/api_staging.json +107 -0
- data/spec/fixtures/front_master.json +78 -0
- data/spec/fixtures/front_staging.json +81 -0
- data/spec/fixtures/pipelines.json +1 -0
- data/spec/fixtures/snap-ci_report.message +12 -0
- data/spec/fixtures/snap-ci_status.message +4 -0
- data/spec/fixtures/websites_develop.json +107 -0
- data/spec/fixtures/websites_master.json +101 -0
- data/spec/lita/handlers/snap_ci_spec.rb +39 -0
- data/spec/spec_helper.rb +20 -0
- data/spec/support/config.rb +21 -0
- data/spec/support/fixture.rb +37 -0
- data/templates/.gitkeep +0 -0
- metadata +185 -0
@@ -0,0 +1,101 @@
|
|
1
|
+
{
|
2
|
+
"_links": {
|
3
|
+
"self": {
|
4
|
+
"href": ""
|
5
|
+
},
|
6
|
+
"latest": {
|
7
|
+
"href": ""
|
8
|
+
},
|
9
|
+
"oldest": {
|
10
|
+
"href": ""
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"_embedded": {
|
14
|
+
"pipelines": [
|
15
|
+
{
|
16
|
+
"_links": {
|
17
|
+
"self": {
|
18
|
+
"href": ""
|
19
|
+
},
|
20
|
+
"latest": {
|
21
|
+
"href": ""
|
22
|
+
},
|
23
|
+
"oldest": {
|
24
|
+
"href": ""
|
25
|
+
},
|
26
|
+
"next": {
|
27
|
+
"href": ""
|
28
|
+
},
|
29
|
+
"docs": {
|
30
|
+
"href": ""
|
31
|
+
}
|
32
|
+
},
|
33
|
+
"counter": 1,
|
34
|
+
"result": "passed",
|
35
|
+
"commits": [
|
36
|
+
{
|
37
|
+
"_links": {
|
38
|
+
"github": [
|
39
|
+
{
|
40
|
+
"rel": "api",
|
41
|
+
"href": ""
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"rel": "http",
|
45
|
+
"href": ""
|
46
|
+
}
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"sha": "52cddc781f9a0ca8106307ed11455b523f60f133",
|
50
|
+
"short_sha": "52cddc7",
|
51
|
+
"author": "",
|
52
|
+
"message": "",
|
53
|
+
"time": "2016-04-19T06:34:33Z"
|
54
|
+
}
|
55
|
+
],
|
56
|
+
"stages": [
|
57
|
+
{
|
58
|
+
"name": "TEST",
|
59
|
+
"full_name": "otherorg/websites (master) :: TEST",
|
60
|
+
"result": "passed",
|
61
|
+
"duration": 221,
|
62
|
+
"workers": [
|
63
|
+
{
|
64
|
+
"counter": 1,
|
65
|
+
"result": "passed",
|
66
|
+
"duration": 199.91909289360046,
|
67
|
+
"artifacts": [
|
68
|
+
|
69
|
+
],
|
70
|
+
"started_at": "2016-04-19T08:52:16Z",
|
71
|
+
"completed_at": "2016-04-19T08:55:36Z"
|
72
|
+
}
|
73
|
+
],
|
74
|
+
"started_at": "2016-04-19T08:51:55Z",
|
75
|
+
"completed_at": "2016-04-19T08:55:36Z"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"name": "Build",
|
79
|
+
"full_name": "zenmate/websites (master) :: Build",
|
80
|
+
"result": "passed",
|
81
|
+
"duration": 809,
|
82
|
+
"workers": [
|
83
|
+
{
|
84
|
+
"counter": 1,
|
85
|
+
"result": "passed",
|
86
|
+
"duration": 800.1221342086792,
|
87
|
+
"artifacts": [
|
88
|
+
|
89
|
+
],
|
90
|
+
"started_at": "2016-04-19T09:08:52Z",
|
91
|
+
"completed_at": "2016-04-19T09:22:12Z"
|
92
|
+
}
|
93
|
+
],
|
94
|
+
"started_at": "2016-04-19T09:08:43Z",
|
95
|
+
"completed_at": "2016-04-19T09:22:12Z"
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
]
|
100
|
+
}
|
101
|
+
}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Lita::Handlers::SnapCi, lita_handler: true do
|
4
|
+
before do
|
5
|
+
load_config
|
6
|
+
end
|
7
|
+
|
8
|
+
describe 'command `snap-ci report`:' do
|
9
|
+
it 'display a general report' do
|
10
|
+
send_message("snap-ci report")
|
11
|
+
|
12
|
+
load_message_fixture('snap-ci_report').each_line do |line|
|
13
|
+
expect(replies.last).to include(line.delete("\n"))
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'command `snap-ci project`' do
|
19
|
+
context 'with repo format' do
|
20
|
+
it 'displays the project status' do
|
21
|
+
send_message("snap-ci project api")
|
22
|
+
|
23
|
+
load_message_fixture('snap-ci_status').each_line do |line|
|
24
|
+
expect(replies.last).to include(line.delete("\n"))
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context 'with owner/repo format' do
|
30
|
+
it 'displays the project status' do
|
31
|
+
send_message("snap-ci project oneorg/api")
|
32
|
+
|
33
|
+
load_message_fixture('snap-ci_status').each_line do |line|
|
34
|
+
expect(replies.last).to include(line.delete("\n"))
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require "lita-snap-ci"
|
2
|
+
require "lita/rspec"
|
3
|
+
require 'webmock/rspec'
|
4
|
+
|
5
|
+
# Load helpers
|
6
|
+
require_relative 'support/fixture'
|
7
|
+
require_relative 'support/config'
|
8
|
+
|
9
|
+
# A compatibility mode is provided for older plugins upgrading from Lita 3. Since this plugin
|
10
|
+
# was generated with Lita 4, the compatibility mode should be left disabled.
|
11
|
+
Lita.version_3_compatibility_mode = false
|
12
|
+
|
13
|
+
RSpec.configure do |c|
|
14
|
+
c.include Fixture
|
15
|
+
c.include Config
|
16
|
+
|
17
|
+
c.before(:each) do
|
18
|
+
stub_snap_requests
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Config
|
2
|
+
def load_config
|
3
|
+
registry.config.handlers.snap_ci.user = "snapUser"
|
4
|
+
registry.config.handlers.snap_ci.token = "Snap-ci-api-key"
|
5
|
+
registry.config.handlers.snap_ci.projects = [
|
6
|
+
{
|
7
|
+
owner: 'oneorg',
|
8
|
+
repository: 'api',
|
9
|
+
branches: ['development', 'staging', 'master']
|
10
|
+
},{
|
11
|
+
owner: 'oneorg',
|
12
|
+
repository: 'front',
|
13
|
+
branches: ['staging', 'master']
|
14
|
+
},{
|
15
|
+
owner: 'otherorg',
|
16
|
+
repository: 'websites',
|
17
|
+
branches: ['develop' , 'master']
|
18
|
+
}
|
19
|
+
]
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Fixture
|
2
|
+
URL = 'https://api.snap-ci.com/project/'
|
3
|
+
|
4
|
+
def load_json_fixture(name)
|
5
|
+
load_fixture(name + '.json')
|
6
|
+
end
|
7
|
+
|
8
|
+
def load_message_fixture(name)
|
9
|
+
load_fixture(name + '.message')
|
10
|
+
end
|
11
|
+
|
12
|
+
def load_fixture(name)
|
13
|
+
File.read(File.expand_path("spec/fixtures/#{name}"))
|
14
|
+
end
|
15
|
+
|
16
|
+
def stub_snap_requests
|
17
|
+
# Api example
|
18
|
+
stub_request(:get, "#{URL}oneorg/api/branch/development/pipelines").
|
19
|
+
to_return(status: 200, body: load_json_fixture('api_development'))
|
20
|
+
stub_request(:get, "#{URL}oneorg/api/branch/staging/pipelines").
|
21
|
+
to_return(status: 200, body: load_json_fixture('api_staging'))
|
22
|
+
stub_request(:get, "#{URL}oneorg/api/branch/master/pipelines").
|
23
|
+
to_return(status: 200, body: load_json_fixture('api_master'))
|
24
|
+
|
25
|
+
# Front example
|
26
|
+
stub_request(:get, "#{URL}oneorg/front/branch/staging/pipelines").
|
27
|
+
to_return(status: 200, body: load_json_fixture('front_staging'))
|
28
|
+
stub_request(:get, "#{URL}oneorg/front/branch/master/pipelines").
|
29
|
+
to_return(status: 200, body: load_json_fixture('front_master'))
|
30
|
+
|
31
|
+
# Websites example
|
32
|
+
stub_request(:get, "#{URL}otherorg/websites/branch/develop/pipelines").
|
33
|
+
to_return(status: 200, body: load_json_fixture('websites_develop'))
|
34
|
+
stub_request(:get, "#{URL}otherorg/websites/branch/master/pipelines").
|
35
|
+
to_return(status: 200, body: load_json_fixture('websites_master'))
|
36
|
+
end
|
37
|
+
end
|
data/templates/.gitkeep
ADDED
File without changes
|
metadata
ADDED
@@ -0,0 +1,185 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: lita-snap-ci
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Juan Fraire
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-06-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: lita
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.7'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.7'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.3'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry-byebug
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rack-test
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: webmock
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rspec
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 3.0.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 3.0.0
|
111
|
+
description: Snap-ci integration with lita
|
112
|
+
email:
|
113
|
+
- groteck@gmail.com
|
114
|
+
executables: []
|
115
|
+
extensions: []
|
116
|
+
extra_rdoc_files: []
|
117
|
+
files:
|
118
|
+
- ".gitignore"
|
119
|
+
- Gemfile
|
120
|
+
- README.md
|
121
|
+
- Rakefile
|
122
|
+
- lib/lita-snap-ci.rb
|
123
|
+
- lib/lita/handlers/snap_ci.rb
|
124
|
+
- lib/snap_ci.rb
|
125
|
+
- lib/snap_ci/http.rb
|
126
|
+
- lib/snap_ci/parser.rb
|
127
|
+
- lib/snap_ci/project.rb
|
128
|
+
- lib/snap_ci/project_list.rb
|
129
|
+
- lita-snap-ci.gemspec
|
130
|
+
- locales/en.yml
|
131
|
+
- spec/fixtures/api_development.json
|
132
|
+
- spec/fixtures/api_master.json
|
133
|
+
- spec/fixtures/api_staging.json
|
134
|
+
- spec/fixtures/front_master.json
|
135
|
+
- spec/fixtures/front_staging.json
|
136
|
+
- spec/fixtures/pipelines.json
|
137
|
+
- spec/fixtures/snap-ci_report.message
|
138
|
+
- spec/fixtures/snap-ci_status.message
|
139
|
+
- spec/fixtures/websites_develop.json
|
140
|
+
- spec/fixtures/websites_master.json
|
141
|
+
- spec/lita/handlers/snap_ci_spec.rb
|
142
|
+
- spec/spec_helper.rb
|
143
|
+
- spec/support/config.rb
|
144
|
+
- spec/support/fixture.rb
|
145
|
+
- templates/.gitkeep
|
146
|
+
homepage: https://github.com/groteck/lita-snap-ci
|
147
|
+
licenses:
|
148
|
+
- MIT
|
149
|
+
metadata:
|
150
|
+
lita_plugin_type: handler
|
151
|
+
post_install_message:
|
152
|
+
rdoc_options: []
|
153
|
+
require_paths:
|
154
|
+
- lib
|
155
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
requirements:
|
162
|
+
- - ">="
|
163
|
+
- !ruby/object:Gem::Version
|
164
|
+
version: '0'
|
165
|
+
requirements: []
|
166
|
+
rubyforge_project:
|
167
|
+
rubygems_version: 2.4.5.1
|
168
|
+
signing_key:
|
169
|
+
specification_version: 4
|
170
|
+
summary: Lita , Snap-ci, ChatOps
|
171
|
+
test_files:
|
172
|
+
- spec/fixtures/api_development.json
|
173
|
+
- spec/fixtures/api_master.json
|
174
|
+
- spec/fixtures/api_staging.json
|
175
|
+
- spec/fixtures/front_master.json
|
176
|
+
- spec/fixtures/front_staging.json
|
177
|
+
- spec/fixtures/pipelines.json
|
178
|
+
- spec/fixtures/snap-ci_report.message
|
179
|
+
- spec/fixtures/snap-ci_status.message
|
180
|
+
- spec/fixtures/websites_develop.json
|
181
|
+
- spec/fixtures/websites_master.json
|
182
|
+
- spec/lita/handlers/snap_ci_spec.rb
|
183
|
+
- spec/spec_helper.rb
|
184
|
+
- spec/support/config.rb
|
185
|
+
- spec/support/fixture.rb
|