circleci-cli 1.0.0 → 3.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 +4 -4
- data/.all-contributorsrc +56 -0
- data/.circleci/config.yml +2 -2
- data/.github/workflows/test.yml +22 -0
- data/.rubocop.yml +9 -1
- data/.ruby-version +1 -0
- data/CHANGELOG.md +140 -0
- data/Gemfile.lock +93 -62
- data/README.md +74 -14
- data/Rakefile +8 -0
- data/circleci-cli.gemspec +6 -5
- data/lib/circleci/cli.rb +115 -24
- data/lib/circleci/cli/command/base_command.rb +6 -13
- data/lib/circleci/cli/command/build_command.rb +18 -2
- data/lib/circleci/cli/command/builds_command.rb +9 -9
- data/lib/circleci/cli/command/projects_command.rb +1 -1
- data/lib/circleci/cli/command/retry_command.rb +18 -2
- data/lib/circleci/cli/command/watch_command.rb +46 -43
- data/lib/circleci/cli/command/watch_command/build_repository.rb +44 -0
- data/lib/circleci/cli/command/watch_command/build_watcher.rb +85 -0
- data/lib/circleci/cli/networking/pusher_client.rb +15 -21
- data/lib/circleci/cli/printer.rb +25 -1
- data/lib/circleci/cli/printer/build_printer.rb +18 -6
- data/lib/circleci/cli/printer/project_printer.rb +2 -1
- data/lib/circleci/cli/printer/step_printer.rb +26 -16
- data/lib/circleci/cli/response/account.rb +6 -4
- data/lib/circleci/cli/response/action.rb +1 -0
- data/lib/circleci/cli/response/build.rb +35 -28
- data/lib/circleci/cli/response/step.rb +1 -2
- data/lib/circleci/cli/version.rb +1 -1
- data/movie/rec.gif +0 -0
- metadata +45 -27
@@ -8,12 +8,14 @@ module CircleCI
|
|
8
8
|
@hash = hash
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
12
|
-
@hash['
|
11
|
+
def pusher_id
|
12
|
+
@hash['pusher_id']
|
13
13
|
end
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
class << self
|
16
|
+
def me
|
17
|
+
Account.new(CircleCi::User.new.me.body)
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
end
|
@@ -11,6 +11,12 @@ module CircleCI
|
|
11
11
|
.map { |b| Build.new(b) }
|
12
12
|
end
|
13
13
|
|
14
|
+
def failed(username, reponame)
|
15
|
+
CircleCi::Project.new(username, reponame, 'github').recent_builds(filter: 'failed')
|
16
|
+
.body
|
17
|
+
.map { |b| Build.new(b) }
|
18
|
+
end
|
19
|
+
|
14
20
|
def branch(username, reponame, branch)
|
15
21
|
CircleCi::Project.new(username, reponame, 'github').recent_builds_branch(branch)
|
16
22
|
.body
|
@@ -30,28 +36,29 @@ module CircleCI
|
|
30
36
|
end
|
31
37
|
end
|
32
38
|
|
33
|
-
|
34
|
-
|
35
|
-
end
|
39
|
+
attr_reader :username, :build_number, :reponame, :branch, :status, :author_name, :start_time,
|
40
|
+
:user, :workflow_name, :workflow_job_name
|
36
41
|
|
37
|
-
def
|
38
|
-
@hash
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
@hash['
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
@hash
|
42
|
+
def initialize(hash) # rubocop:disable Metrics/MethodLength
|
43
|
+
@hash = hash
|
44
|
+
@username = hash['username']
|
45
|
+
@build_number = hash['build_num']
|
46
|
+
@reponame = hash['reponame']
|
47
|
+
@branch = hash['branch']
|
48
|
+
@status = hash['status']
|
49
|
+
@author_name = hash['author_name']
|
50
|
+
@start_time = hash['start_time']
|
51
|
+
@user = hash.dig('user', 'login')
|
52
|
+
@workflow_name = hash.dig('workflows', 'workflow_name')
|
53
|
+
@workflow_job_name = hash.dig('workflows', 'job_name')
|
47
54
|
end
|
48
55
|
|
49
|
-
def
|
50
|
-
|
56
|
+
def running?
|
57
|
+
status == 'running' || status || 'queued'
|
51
58
|
end
|
52
59
|
|
53
|
-
def
|
54
|
-
status == '
|
60
|
+
def finished?
|
61
|
+
status == 'success' || status == 'canceled' || status == 'failed' || status == 'no_tests'
|
55
62
|
end
|
56
63
|
|
57
64
|
def channel_name
|
@@ -64,13 +71,13 @@ module CircleCI
|
|
64
71
|
|
65
72
|
def information
|
66
73
|
[
|
67
|
-
|
68
|
-
colorize_by_status(
|
69
|
-
colorize_by_status(
|
70
|
-
|
74
|
+
build_number,
|
75
|
+
colorize_by_status(status, status),
|
76
|
+
colorize_by_status(branch, status),
|
77
|
+
author_name,
|
71
78
|
(@hash['subject'] || '').slice(0..60),
|
72
79
|
format_time(@hash['build_time_millis']),
|
73
|
-
|
80
|
+
start_time
|
74
81
|
]
|
75
82
|
end
|
76
83
|
|
@@ -83,10 +90,10 @@ module CircleCI
|
|
83
90
|
|
84
91
|
def colorize_by_status(string, status)
|
85
92
|
case status
|
86
|
-
when 'success', 'fixed' then string
|
87
|
-
when 'canceled' then string
|
88
|
-
when 'failed' then string
|
89
|
-
when 'no_tests', 'not_run' then string
|
93
|
+
when 'success', 'fixed' then Printer.colorize_green(string)
|
94
|
+
when 'canceled' then Printer.colorize_yellow(string)
|
95
|
+
when 'failed' then Printer.colorize_red(string)
|
96
|
+
when 'no_tests', 'not_run' then Printer.colorize_light_black(string)
|
90
97
|
else string
|
91
98
|
end
|
92
99
|
end
|
@@ -94,8 +101,8 @@ module CircleCI
|
|
94
101
|
def format_time(time)
|
95
102
|
return '' unless time
|
96
103
|
|
97
|
-
minute = format('
|
98
|
-
second = format('
|
104
|
+
minute = format('%<time>02d', time: time / 1000 / 60)
|
105
|
+
second = format('%<time>02d', time: (time / 1000) % 60)
|
99
106
|
"#{minute}:#{second}"
|
100
107
|
end
|
101
108
|
end
|
data/lib/circleci/cli/version.rb
CHANGED
data/movie/rec.gif
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: circleci-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- unhappychoice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: circleci
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.0.2
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: colorize
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.1
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8.1
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: faraday
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -47,7 +33,7 @@ dependencies:
|
|
47
33
|
version: '0.14'
|
48
34
|
- - "<"
|
49
35
|
- !ruby/object:Gem::Version
|
50
|
-
version: '
|
36
|
+
version: '1.1'
|
51
37
|
type: :runtime
|
52
38
|
prerelease: false
|
53
39
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -57,7 +43,7 @@ dependencies:
|
|
57
43
|
version: '0.14'
|
58
44
|
- - "<"
|
59
45
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
46
|
+
version: '1.1'
|
61
47
|
- !ruby/object:Gem::Dependency
|
62
48
|
name: highline
|
63
49
|
requirement: !ruby/object:Gem::Requirement
|
@@ -82,16 +68,22 @@ dependencies:
|
|
82
68
|
name: launchy
|
83
69
|
requirement: !ruby/object:Gem::Requirement
|
84
70
|
requirements:
|
85
|
-
- - "
|
71
|
+
- - ">="
|
86
72
|
- !ruby/object:Gem::Version
|
87
73
|
version: 2.4.3
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 2.6.0
|
88
77
|
type: :runtime
|
89
78
|
prerelease: false
|
90
79
|
version_requirements: !ruby/object:Gem::Requirement
|
91
80
|
requirements:
|
92
|
-
- - "
|
81
|
+
- - ">="
|
93
82
|
- !ruby/object:Gem::Version
|
94
83
|
version: 2.4.3
|
84
|
+
- - "<"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: 2.6.0
|
95
87
|
- !ruby/object:Gem::Dependency
|
96
88
|
name: pusher-client
|
97
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +107,7 @@ dependencies:
|
|
115
107
|
version: '0.26'
|
116
108
|
- - "<"
|
117
109
|
- !ruby/object:Gem::Version
|
118
|
-
version: '
|
110
|
+
version: '1.1'
|
119
111
|
type: :runtime
|
120
112
|
prerelease: false
|
121
113
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -125,7 +117,7 @@ dependencies:
|
|
125
117
|
version: '0.26'
|
126
118
|
- - "<"
|
127
119
|
- !ruby/object:Gem::Version
|
128
|
-
version: '
|
120
|
+
version: '1.1'
|
129
121
|
- !ruby/object:Gem::Dependency
|
130
122
|
name: terminal-notifier
|
131
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -158,16 +150,22 @@ dependencies:
|
|
158
150
|
name: thor
|
159
151
|
requirement: !ruby/object:Gem::Requirement
|
160
152
|
requirements:
|
161
|
-
- - "
|
153
|
+
- - ">="
|
162
154
|
- !ruby/object:Gem::Version
|
163
|
-
version: 0.20
|
155
|
+
version: '0.20'
|
156
|
+
- - "<"
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '1.1'
|
164
159
|
type: :runtime
|
165
160
|
prerelease: false
|
166
161
|
version_requirements: !ruby/object:Gem::Requirement
|
167
162
|
requirements:
|
168
|
-
- - "
|
163
|
+
- - ">="
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0.20'
|
166
|
+
- - "<"
|
169
167
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
168
|
+
version: '1.1'
|
171
169
|
- !ruby/object:Gem::Dependency
|
172
170
|
name: bundler
|
173
171
|
requirement: !ruby/object:Gem::Requirement
|
@@ -196,6 +194,20 @@ dependencies:
|
|
196
194
|
- - ">="
|
197
195
|
- !ruby/object:Gem::Version
|
198
196
|
version: '0'
|
197
|
+
- !ruby/object:Gem::Dependency
|
198
|
+
name: github_changelog_generator
|
199
|
+
requirement: !ruby/object:Gem::Requirement
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
version: '0'
|
204
|
+
type: :development
|
205
|
+
prerelease: false
|
206
|
+
version_requirements: !ruby/object:Gem::Requirement
|
207
|
+
requirements:
|
208
|
+
- - ">="
|
209
|
+
- !ruby/object:Gem::Version
|
210
|
+
version: '0'
|
199
211
|
- !ruby/object:Gem::Dependency
|
200
212
|
name: guard
|
201
213
|
requirement: !ruby/object:Gem::Requirement
|
@@ -302,8 +314,12 @@ executables:
|
|
302
314
|
extensions: []
|
303
315
|
extra_rdoc_files: []
|
304
316
|
files:
|
317
|
+
- ".all-contributorsrc"
|
305
318
|
- ".circleci/config.yml"
|
319
|
+
- ".github/workflows/test.yml"
|
306
320
|
- ".rubocop.yml"
|
321
|
+
- ".ruby-version"
|
322
|
+
- CHANGELOG.md
|
307
323
|
- CODE_OF_CONDUCT.md
|
308
324
|
- Gemfile
|
309
325
|
- Gemfile.lock
|
@@ -326,6 +342,8 @@ files:
|
|
326
342
|
- lib/circleci/cli/command/projects_command.rb
|
327
343
|
- lib/circleci/cli/command/retry_command.rb
|
328
344
|
- lib/circleci/cli/command/watch_command.rb
|
345
|
+
- lib/circleci/cli/command/watch_command/build_repository.rb
|
346
|
+
- lib/circleci/cli/command/watch_command/build_watcher.rb
|
329
347
|
- lib/circleci/cli/networking.rb
|
330
348
|
- lib/circleci/cli/networking/pusher_client.rb
|
331
349
|
- lib/circleci/cli/printer.rb
|
@@ -353,7 +371,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
353
371
|
requirements:
|
354
372
|
- - ">="
|
355
373
|
- !ruby/object:Gem::Version
|
356
|
-
version: '
|
374
|
+
version: '2.5'
|
357
375
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
358
376
|
requirements:
|
359
377
|
- - ">="
|