circleci 1.1.0 → 2.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +268 -82
- data/lib/circleci.rb +1 -0
- data/lib/circleci/api_project_resource.rb +32 -0
- data/lib/circleci/build.rb +6 -96
- data/lib/circleci/config.rb +8 -8
- data/lib/circleci/project.rb +27 -275
- data/lib/circleci/projects.rb +1 -1
- data/lib/circleci/recent_builds.rb +1 -18
- data/lib/circleci/user.rb +4 -29
- metadata +7 -6
- metadata.gz.sig +0 -0
data/lib/circleci.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module CircleCi
|
3
|
+
##
|
4
|
+
#
|
5
|
+
# Class for interacting with project API resources
|
6
|
+
class ApiProjectResource < ApiResource
|
7
|
+
VALID_VCS_TYPES = %w[github bitbucket].freeze
|
8
|
+
DEFAULT_VCS_TYPE = VALID_VCS_TYPES.first.freeze
|
9
|
+
|
10
|
+
attr_reader :build, :vcs_type
|
11
|
+
|
12
|
+
##
|
13
|
+
#
|
14
|
+
# Initialize a new Project API interaction
|
15
|
+
#
|
16
|
+
# @param username [String] - The vcs username or org name for project
|
17
|
+
# @param project [String] - The project name
|
18
|
+
# @param vcs_type [String] - The vcs type i.e. github or bitbucket
|
19
|
+
# @param build [String] - The build number for a project
|
20
|
+
# @param conf [CircleCi::Config] - Optional config to use for request
|
21
|
+
# @return [CircleCi::Project]
|
22
|
+
def initialize(username = nil, project = nil, vcs_type = nil, build = nil, conf = nil)
|
23
|
+
super(username, project, conf)
|
24
|
+
@vcs_type = VALID_VCS_TYPES.include?(vcs_type) ? vcs_type : DEFAULT_VCS_TYPE
|
25
|
+
@build = build
|
26
|
+
end
|
27
|
+
|
28
|
+
def base_path
|
29
|
+
"/project/#{vcs_type}/#{username}/#{project}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/circleci/build.rb
CHANGED
@@ -3,104 +3,14 @@ module CircleCi
|
|
3
3
|
##
|
4
4
|
#
|
5
5
|
# Class for interacting with and managing builds
|
6
|
-
class Build <
|
7
|
-
attr_reader :build
|
8
|
-
##
|
9
|
-
#
|
10
|
-
# Initialize a Build object to interact with the Build API
|
11
|
-
#
|
12
|
-
# @param config [CircleCi::Config] - Defaults to [default_config] if not provided
|
13
|
-
# @param username [String] - User or org name who owns project
|
14
|
-
# @param project [String] - Name of project
|
15
|
-
# @param build [String] - Build ID
|
16
|
-
# @return [CircleCi::Build] - A Build object
|
17
|
-
def initialize(username, project, build, conf = nil)
|
18
|
-
super(username, project, conf)
|
19
|
-
@build = build
|
20
|
-
end
|
21
|
-
|
22
|
-
##
|
23
|
-
#
|
24
|
-
# Deprecated class methods
|
25
|
-
class << self
|
26
|
-
##
|
27
|
-
#
|
28
|
-
# Get artifacts for a specific build of a project
|
29
|
-
#
|
30
|
-
# @deprecated Please use instance method of [CircleCi::Build] instead
|
31
|
-
# @param username [String] - User or org name who owns project
|
32
|
-
# @param project [String] - Name of project
|
33
|
-
# @param build [String] - Build ID
|
34
|
-
# @return [CircleCi::Response] - Response object
|
35
|
-
def artifacts(username, project, build)
|
36
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Build#artifacts instead')
|
37
|
-
new(username, project, build, default_config).artifacts
|
38
|
-
end
|
39
|
-
|
40
|
-
##
|
41
|
-
#
|
42
|
-
# Cancel a specific build
|
43
|
-
#
|
44
|
-
# @deprecated Please use instance method of [CircleCi::Build] instead
|
45
|
-
# @param username [String] - User or org name who owns project
|
46
|
-
# @param project [String] - Name of project
|
47
|
-
# @param build [String] - Build ID
|
48
|
-
# @return [CircleCi::Response] - Response object
|
49
|
-
def cancel(username, project, build)
|
50
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Build#cancel instead')
|
51
|
-
new(username, project, build, default_config).cancel
|
52
|
-
end
|
53
|
-
|
54
|
-
##
|
55
|
-
#
|
56
|
-
# Get a specific build for a project
|
57
|
-
#
|
58
|
-
# @deprecated Please use instance method of [CircleCi::Build] instead
|
59
|
-
# @param username [String] - User or org name who owns project
|
60
|
-
# @param project [String] - Name of project
|
61
|
-
# @param build [String] - Build ID
|
62
|
-
# @return [CircleCi::Response] - Response object
|
63
|
-
def get(username, project, build)
|
64
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Build#get instead')
|
65
|
-
new(username, project, build, default_config).get
|
66
|
-
end
|
67
|
-
|
68
|
-
##
|
69
|
-
#
|
70
|
-
# Kick off a retry of a specific build
|
71
|
-
#
|
72
|
-
# @deprecated Please use instance method of [CircleCi::Build] instead
|
73
|
-
# @param username [String] - User or org name who owns project
|
74
|
-
# @param project [String] - Name of project
|
75
|
-
# @param build [String] - Build ID
|
76
|
-
# @return [CircleCi::Response] - Response object
|
77
|
-
def retry(username, project, build)
|
78
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Build#retry instead')
|
79
|
-
new(username, project, build, default_config).retry
|
80
|
-
end
|
81
|
-
|
82
|
-
##
|
83
|
-
#
|
84
|
-
# Get tests for a specific build of a project
|
85
|
-
#
|
86
|
-
# @deprecated Please use instance method of [CircleCi::Build] instead
|
87
|
-
# @param username [String] - User or org name who owns project
|
88
|
-
# @param project [String] - Name of project
|
89
|
-
# @param build [String] - Build ID
|
90
|
-
# @return [CircleCi::Response] - Response object
|
91
|
-
def tests(username, project, build)
|
92
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Build#tests instead')
|
93
|
-
new(username, project, build, default_config).tests
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
6
|
+
class Build < ApiProjectResource
|
97
7
|
##
|
98
8
|
#
|
99
9
|
# Get artifacts for a specific build of a project
|
100
10
|
#
|
101
11
|
# @return [CircleCi::Response] - Response object
|
102
12
|
def artifacts
|
103
|
-
CircleCi.request(
|
13
|
+
CircleCi.request(conf, "#{base_path}/#{build}/artifacts").get
|
104
14
|
end
|
105
15
|
|
106
16
|
##
|
@@ -109,7 +19,7 @@ module CircleCi
|
|
109
19
|
#
|
110
20
|
# @return [CircleCi::Response] - Response object
|
111
21
|
def cancel
|
112
|
-
CircleCi.request(
|
22
|
+
CircleCi.request(conf, "#{base_path}/#{build}/cancel").post
|
113
23
|
end
|
114
24
|
|
115
25
|
##
|
@@ -118,7 +28,7 @@ module CircleCi
|
|
118
28
|
#
|
119
29
|
# @return [CircleCi::Response] - Response object
|
120
30
|
def get
|
121
|
-
CircleCi.request(
|
31
|
+
CircleCi.request(conf, "#{base_path}/#{build}").get
|
122
32
|
end
|
123
33
|
|
124
34
|
##
|
@@ -127,7 +37,7 @@ module CircleCi
|
|
127
37
|
#
|
128
38
|
# @return [CircleCi::Response] - Response object
|
129
39
|
def retry
|
130
|
-
CircleCi.request(
|
40
|
+
CircleCi.request(conf, "#{base_path}/#{build}/retry").post
|
131
41
|
end
|
132
42
|
|
133
43
|
##
|
@@ -136,7 +46,7 @@ module CircleCi
|
|
136
46
|
#
|
137
47
|
# @return [CircleCi::Response] - Response object
|
138
48
|
def tests
|
139
|
-
CircleCi.request(
|
49
|
+
CircleCi.request(conf, "#{base_path}/#{build}/tests").get
|
140
50
|
end
|
141
51
|
end
|
142
52
|
end
|
data/lib/circleci/config.rb
CHANGED
@@ -5,7 +5,7 @@ module CircleCi
|
|
5
5
|
# Config class used internally.
|
6
6
|
# Configure API calls using CircleCi.configure
|
7
7
|
class Config
|
8
|
-
DEFAULT_VERSION = 'v1'.freeze
|
8
|
+
DEFAULT_VERSION = 'v1.1'.freeze
|
9
9
|
DEFAULT_HOST = 'https://circleci.com'.freeze
|
10
10
|
DEFAULT_URI = "#{DEFAULT_HOST}/api/#{DEFAULT_VERSION}".freeze
|
11
11
|
DEFAULT_PORT = 443
|
@@ -33,18 +33,18 @@ module CircleCi
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def proxy_userinfo?
|
36
|
-
|
36
|
+
proxy_user && proxy_pass
|
37
37
|
end
|
38
38
|
|
39
|
-
def
|
40
|
-
|
39
|
+
def proxy_to_port
|
40
|
+
proxy_port ? proxy_port : 80
|
41
41
|
end
|
42
42
|
|
43
43
|
def proxy_uri
|
44
|
-
return unless @proxy &&
|
45
|
-
host_uri = URI.parse(
|
46
|
-
userinfo = proxy_userinfo? ? "#{
|
47
|
-
URI.parse("#{host_uri.scheme}://#{userinfo}#{host_uri.host}:#{
|
44
|
+
return unless @proxy && proxy_host
|
45
|
+
host_uri = URI.parse(proxy_host)
|
46
|
+
userinfo = proxy_userinfo? ? "#{proxy_user}:#{proxy_pass}@" : ''
|
47
|
+
URI.parse("#{host_uri.scheme}://#{userinfo}#{host_uri.host}:#{proxy_to_port}#{host_uri.path}")
|
48
48
|
end
|
49
49
|
end
|
50
50
|
end
|
data/lib/circleci/project.rb
CHANGED
@@ -3,265 +3,18 @@ module CircleCi
|
|
3
3
|
##
|
4
4
|
#
|
5
5
|
# Class for interacting with Projects
|
6
|
-
|
7
|
-
class Project < ApiResource
|
6
|
+
class Project < ApiProjectResource
|
8
7
|
##
|
9
8
|
#
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Projects#get instead')
|
20
|
-
CircleCi::Projects.new.get
|
21
|
-
end
|
22
|
-
|
23
|
-
##
|
24
|
-
#
|
25
|
-
# Build the latest master push for this project
|
26
|
-
#
|
27
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
28
|
-
# @param username [String] - User or org name who owns project
|
29
|
-
# @param project [String] - Name of project
|
30
|
-
# @return [CircleCi::Response] - Response object
|
31
|
-
def build(username, project)
|
32
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#build instead')
|
33
|
-
new(username, project, default_config).build
|
34
|
-
end
|
35
|
-
|
36
|
-
##
|
37
|
-
#
|
38
|
-
# Build the latest push for this branch of a specific project
|
39
|
-
#
|
40
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
41
|
-
# @param username [String] - User or org name who owns project
|
42
|
-
# @param project [String] - Name of project
|
43
|
-
# @param branch [String] - Name of branch
|
44
|
-
# @param body [Hash] - Optional post body with build parameters
|
45
|
-
# @return [CircleCi::Response] - Response object
|
46
|
-
def build_branch(username, project, branch, params = {}, body = {})
|
47
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#build_branch instead')
|
48
|
-
new(username, project, default_config).build_branch(branch, params, body)
|
49
|
-
end
|
50
|
-
|
51
|
-
##
|
52
|
-
#
|
53
|
-
# Add a ssh key to a build
|
54
|
-
#
|
55
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
56
|
-
# @param username [String] - User or org name who owns project
|
57
|
-
# @param project [String] - Name of project
|
58
|
-
# @param build [String] - Build number
|
59
|
-
# @param key [String] - The ssh private key
|
60
|
-
# @param hostname [String] - The hostname identified by the key
|
61
|
-
# @return [CircleCi::Response] - Response object
|
62
|
-
def build_ssh_key(username, project, build, key, hostname)
|
63
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#build_ssh_key instead')
|
64
|
-
new(username, project, default_config).build_ssh_key(build, key, hostname)
|
65
|
-
end
|
66
|
-
|
67
|
-
##
|
68
|
-
#
|
69
|
-
# Clear the build cache for a specific project
|
70
|
-
#
|
71
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
72
|
-
# @param username [String] - User or org name who owns project
|
73
|
-
# @param project [String] - Name of project
|
74
|
-
# @return [CircleCi::Response] - Response object
|
75
|
-
def clear_cache(username, project)
|
76
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#clear_cache instead')
|
77
|
-
new(username, project, default_config).clear_cache
|
78
|
-
end
|
79
|
-
|
80
|
-
##
|
81
|
-
#
|
82
|
-
# Delete a checkout key for a project
|
83
|
-
#
|
84
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
85
|
-
# @param username [String] - User or org name who owns project
|
86
|
-
# @param project [String] - Name of project
|
87
|
-
# @param fingerprint [String] - Fingerprint of a checkout key
|
88
|
-
# @return [CircleCi::Response] - Response object
|
89
|
-
def delete_checkout_key(username, project, fingerprint)
|
90
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#delete_checkout_key instead')
|
91
|
-
new(username, project, default_config).delete_checkout_key(fingerprint)
|
92
|
-
end
|
93
|
-
|
94
|
-
##
|
95
|
-
#
|
96
|
-
# Enable a project in CircleCI. Causes a CircleCI SSH key to be added to
|
97
|
-
# the GitHub. Requires admin privilege to the repository.
|
98
|
-
#
|
99
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
100
|
-
# @param username [String] - User or org name who owns project
|
101
|
-
# @param project [String] - Name of project
|
102
|
-
# @return [CircleCi::Response] - Response object
|
103
|
-
def enable(username, project)
|
104
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#enable instead')
|
105
|
-
new(username, project, default_config).enable
|
106
|
-
end
|
107
|
-
|
108
|
-
##
|
109
|
-
#
|
110
|
-
# Get the project envvars
|
111
|
-
#
|
112
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
113
|
-
# @param username [String] - User or org name who owns project
|
114
|
-
# @param project [String] - Name of project
|
115
|
-
# @return [CircleCi::Response] - Response object
|
116
|
-
def envvar(username, project)
|
117
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#envvar instead')
|
118
|
-
new(username, project, default_config).envvar
|
119
|
-
end
|
120
|
-
|
121
|
-
##
|
122
|
-
#
|
123
|
-
# @deprecated Please use [CircleCi::Project#envvar]
|
124
|
-
def envvars(username, project)
|
125
|
-
default_config.logger.warn('[Deprecated] CircleCi::Project#envvars is deprecated please use CircleCi::Project#envvar')
|
126
|
-
envvar username, project
|
127
|
-
end
|
128
|
-
|
129
|
-
##
|
130
|
-
#
|
131
|
-
# Follow the project
|
132
|
-
#
|
133
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
134
|
-
# @param username [String] - User or org name who owns project
|
135
|
-
# @param project [String] - Name of project
|
136
|
-
# @return [CircleCi::Response] - Response object
|
137
|
-
def follow(username, project)
|
138
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#follow instead')
|
139
|
-
new(username, project, default_config).follow
|
140
|
-
end
|
141
|
-
|
142
|
-
##
|
143
|
-
#
|
144
|
-
# Get a checkout key for a project
|
145
|
-
#
|
146
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
147
|
-
# @param username [String] - User or org name who owns project
|
148
|
-
# @param project [String] - Name of project
|
149
|
-
# @param fingerprint [String] - Fingerprint of a checkout key
|
150
|
-
# @return [CircleCi::Response] - Response object
|
151
|
-
def get_checkout_key(username, project, fingerprint)
|
152
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#get_checkout_key instead')
|
153
|
-
new(username, project, default_config).get_checkout_key(fingerprint)
|
154
|
-
end
|
155
|
-
|
156
|
-
##
|
157
|
-
#
|
158
|
-
# Get a list of checkout keys for project
|
159
|
-
#
|
160
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
161
|
-
# @param username [String] - User or org name who owns project
|
162
|
-
# @param project [String] - Name of project
|
163
|
-
# @return [CircleCi::Response] - Response object
|
164
|
-
def list_checkout_keys(username, project)
|
165
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#list_checkout_keys instead')
|
166
|
-
new(username, project, default_config).list_checkout_keys
|
167
|
-
end
|
168
|
-
|
169
|
-
##
|
170
|
-
#
|
171
|
-
# Create a checkout key for a project
|
172
|
-
#
|
173
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
174
|
-
# @param username [String] - User or org name who owns project
|
175
|
-
# @param project [String] - Name of project
|
176
|
-
# @param type [String] - The type of key to create. Can be 'deploy-key' or 'github-user-key'.
|
177
|
-
# @return [CircleCi::Response] - Response object
|
178
|
-
def new_checkout_key(username, project, type)
|
179
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#new_checkout_key instead')
|
180
|
-
new(username, project, default_config).new_checkout_key(type)
|
181
|
-
end
|
182
|
-
|
183
|
-
##
|
184
|
-
#
|
185
|
-
# Get all recent builds for a specific project
|
186
|
-
#
|
187
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
188
|
-
# @param username [String] - User or org name who owns project
|
189
|
-
# @param project [String] - Name of project
|
190
|
-
# @param params [Hash] - Parameters for builds (limit, offset, filter)
|
191
|
-
# @return [CircleCi::Response] - Response object
|
192
|
-
def recent_builds(username, project, params = {})
|
193
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#recent_builds instead')
|
194
|
-
new(username, project, default_config).recent_builds(params)
|
195
|
-
end
|
196
|
-
|
197
|
-
##
|
198
|
-
#
|
199
|
-
# Get all recent builds for a specific branch of a project
|
200
|
-
#
|
201
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
202
|
-
# @param username [String] - User or org name who owns project
|
203
|
-
# @param project [String] - Name of project
|
204
|
-
# @param branch [String] - Name of branch
|
205
|
-
# @return [CircleCi::Response] - Response object
|
206
|
-
def recent_builds_branch(username, project, branch)
|
207
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#recent_builds_branch instead')
|
208
|
-
new(username, project, default_config).recent_builds_branch(branch)
|
209
|
-
end
|
210
|
-
|
211
|
-
##
|
212
|
-
#
|
213
|
-
# Get the project configuration
|
214
|
-
#
|
215
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
216
|
-
# @param username [String] - User or org name who owns project
|
217
|
-
# @param project [String] - Name of project
|
218
|
-
# @return [CircleCi::Response] - Response object
|
219
|
-
def settings(username, project)
|
220
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#settings instead')
|
221
|
-
new(username, project, default_config).settings
|
222
|
-
end
|
223
|
-
|
224
|
-
##
|
225
|
-
#
|
226
|
-
# Sets an envvar for a project
|
227
|
-
#
|
228
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
229
|
-
# @param username [String] - User or org name who owns project
|
230
|
-
# @param project [String] - Name of project
|
231
|
-
# @param envvar [Hash] - {name: 'foo', value: 'bar'}
|
232
|
-
# @return [CircleCi::Response] - Response object
|
233
|
-
def set_envvar(username, project, envvar)
|
234
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#add_envvar instead')
|
235
|
-
new(username, project, default_config).add_envvar(envvar)
|
236
|
-
end
|
237
|
-
|
238
|
-
##
|
239
|
-
#
|
240
|
-
# Add a ssh key to a project
|
241
|
-
#
|
242
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
243
|
-
# @param username [String] - User or org name who owns project
|
244
|
-
# @param project [String] - Name of project
|
245
|
-
# @param key [String] - The ssh private key
|
246
|
-
# @param hostname [String] - The hostname identified by the key
|
247
|
-
# @return [CircleCi::Response] - Response object
|
248
|
-
def ssh_key(username, project, key, hostname)
|
249
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#ssh_key instead')
|
250
|
-
new(username, project, default_config).ssh_key(key, hostname)
|
251
|
-
end
|
252
|
-
|
253
|
-
##
|
254
|
-
#
|
255
|
-
# Unfollow the project
|
256
|
-
#
|
257
|
-
# @deprecated Please use instance method of [CircleCi::Project] instead
|
258
|
-
# @param username [String] - User or org name who owns project
|
259
|
-
# @param project [String] - Name of project
|
260
|
-
# @return [CircleCi::Response] - Response object
|
261
|
-
def unfollow(username, project)
|
262
|
-
default_config.logger.warn('[Deprecated] Use instance method CircleCi::Project#unfollow instead')
|
263
|
-
new(username, project, default_config).unfollow
|
264
|
-
end
|
9
|
+
# Initialize a new Project API interaction
|
10
|
+
#
|
11
|
+
# @param username [String] - The vcs username or org name for project
|
12
|
+
# @param project [String] - The project name
|
13
|
+
# @param vcs_type [String] - The vcs type i.e. github or bitbucket
|
14
|
+
# @param conf [CircleCi::Config] - Optional config to use for request
|
15
|
+
# @return [CircleCi::Project]
|
16
|
+
def initialize(username = nil, project = nil, vcs_type = nil, conf = nil)
|
17
|
+
super(username, project, vcs_type, nil, conf)
|
265
18
|
end
|
266
19
|
|
267
20
|
##
|
@@ -270,7 +23,7 @@ module CircleCi
|
|
270
23
|
#
|
271
24
|
# @return [CircleCi::Response] - Response object
|
272
25
|
def build
|
273
|
-
CircleCi.request(
|
26
|
+
CircleCi.request(conf, base_path).post
|
274
27
|
end
|
275
28
|
|
276
29
|
##
|
@@ -282,7 +35,7 @@ module CircleCi
|
|
282
35
|
# @param body [Hash] - Optional post body with build parameters
|
283
36
|
# @return [CircleCi::Response] - Response object
|
284
37
|
def build_branch(branch, params = {}, body = {})
|
285
|
-
CircleCi.request(
|
38
|
+
CircleCi.request(conf, "#{base_path}/tree/#{branch}", params).post(body)
|
286
39
|
end
|
287
40
|
|
288
41
|
##
|
@@ -295,7 +48,7 @@ module CircleCi
|
|
295
48
|
# @return [CircleCi::Response] - Response object
|
296
49
|
def build_ssh_key(build, key, hostname)
|
297
50
|
body = { hostname: hostname, private_key: key }
|
298
|
-
CircleCi.request(
|
51
|
+
CircleCi.request(conf, "#{base_path}/#{build}/ssh-users").post(body)
|
299
52
|
end
|
300
53
|
|
301
54
|
##
|
@@ -304,7 +57,7 @@ module CircleCi
|
|
304
57
|
#
|
305
58
|
# @return [CircleCi::Response] - Response object
|
306
59
|
def clear_cache
|
307
|
-
CircleCi.request(
|
60
|
+
CircleCi.request(conf, "#{base_path}/build-cache").delete
|
308
61
|
end
|
309
62
|
|
310
63
|
##
|
@@ -314,7 +67,7 @@ module CircleCi
|
|
314
67
|
# @param fingerprint [String] - Fingerprint of a checkout key
|
315
68
|
# @return [CircleCi::Response] - Response object
|
316
69
|
def delete_checkout_key(fingerprint)
|
317
|
-
CircleCi.request(
|
70
|
+
CircleCi.request(conf, "#{base_path}/checkout-key/#{fingerprint}").delete
|
318
71
|
end
|
319
72
|
|
320
73
|
##
|
@@ -324,7 +77,7 @@ module CircleCi
|
|
324
77
|
#
|
325
78
|
# @return [CircleCi::Response] - Response object
|
326
79
|
def enable
|
327
|
-
CircleCi.request(
|
80
|
+
CircleCi.request(conf, "#{base_path}/enable").post
|
328
81
|
end
|
329
82
|
|
330
83
|
##
|
@@ -333,7 +86,7 @@ module CircleCi
|
|
333
86
|
#
|
334
87
|
# @return [CircleCi::Response] - Response object
|
335
88
|
def envvar
|
336
|
-
CircleCi.request(
|
89
|
+
CircleCi.request(conf, "#{base_path}/envvar").get
|
337
90
|
end
|
338
91
|
|
339
92
|
##
|
@@ -342,7 +95,7 @@ module CircleCi
|
|
342
95
|
#
|
343
96
|
# @return [CircleCi::Response] - Response object
|
344
97
|
def follow
|
345
|
-
CircleCi.request(
|
98
|
+
CircleCi.request(conf, "#{base_path}/follow").post
|
346
99
|
end
|
347
100
|
|
348
101
|
##
|
@@ -352,7 +105,7 @@ module CircleCi
|
|
352
105
|
# @param fingerprint [String] - Fingerprint of a checkout key
|
353
106
|
# @return [CircleCi::Response] - Response object
|
354
107
|
def get_checkout_key(fingerprint)
|
355
|
-
CircleCi.request(
|
108
|
+
CircleCi.request(conf, "#{base_path}/checkout-key/#{fingerprint}").get
|
356
109
|
end
|
357
110
|
|
358
111
|
##
|
@@ -361,7 +114,7 @@ module CircleCi
|
|
361
114
|
#
|
362
115
|
# @return [CircleCi::Response] - Response object
|
363
116
|
def list_checkout_keys
|
364
|
-
CircleCi.request(
|
117
|
+
CircleCi.request(conf, "#{base_path}/checkout-key").get
|
365
118
|
end
|
366
119
|
|
367
120
|
##
|
@@ -371,7 +124,7 @@ module CircleCi
|
|
371
124
|
# @param type [String] - The type of key to create. Can be 'deploy-key' or 'github-user-key'.
|
372
125
|
# @return [CircleCi::Response] - Response object
|
373
126
|
def new_checkout_key(type)
|
374
|
-
CircleCi.request(
|
127
|
+
CircleCi.request(conf, "#{base_path}/checkout-key").post(type: type)
|
375
128
|
end
|
376
129
|
|
377
130
|
##
|
@@ -381,7 +134,7 @@ module CircleCi
|
|
381
134
|
# @param params [Hash] - Parameters for builds (limit, offset, filter)
|
382
135
|
# @return [CircleCi::Response] - Response object
|
383
136
|
def recent_builds(params = {})
|
384
|
-
CircleCi.request(
|
137
|
+
CircleCi.request(conf, base_path, params).get
|
385
138
|
end
|
386
139
|
|
387
140
|
##
|
@@ -391,7 +144,7 @@ module CircleCi
|
|
391
144
|
# @param branch [String] - Name of branch
|
392
145
|
# @return [CircleCi::Response] - Response object
|
393
146
|
def recent_builds_branch(branch)
|
394
|
-
CircleCi.request(
|
147
|
+
CircleCi.request(conf, "#{base_path}/tree/#{branch}").get
|
395
148
|
end
|
396
149
|
|
397
150
|
##
|
@@ -400,7 +153,7 @@ module CircleCi
|
|
400
153
|
#
|
401
154
|
# @return [CircleCi::Response] - Response object
|
402
155
|
def settings
|
403
|
-
CircleCi.request(
|
156
|
+
CircleCi.request(conf, "#{base_path}/settings").get
|
404
157
|
end
|
405
158
|
|
406
159
|
##
|
@@ -410,7 +163,7 @@ module CircleCi
|
|
410
163
|
# @param envvar [Hash] - {name: 'foo', value: 'bar'}
|
411
164
|
# @return [CircleCi::Response] - Response object
|
412
165
|
def add_envvar(envvar)
|
413
|
-
CircleCi.request(
|
166
|
+
CircleCi.request(conf, "#{base_path}/envvar").post(envvar)
|
414
167
|
end
|
415
168
|
|
416
169
|
##
|
@@ -422,7 +175,7 @@ module CircleCi
|
|
422
175
|
# @return [CircleCi::Response] - Response object
|
423
176
|
def ssh_key(key, hostname)
|
424
177
|
body = { hostname: hostname, private_key: key }
|
425
|
-
CircleCi.request(
|
178
|
+
CircleCi.request(conf, "#{base_path}/ssh-key").post(body)
|
426
179
|
end
|
427
180
|
|
428
181
|
##
|
@@ -431,8 +184,7 @@ module CircleCi
|
|
431
184
|
#
|
432
185
|
# @return [CircleCi::Response] - Response object
|
433
186
|
def unfollow
|
434
|
-
CircleCi.request(
|
187
|
+
CircleCi.request(conf, "#{base_path}/unfollow").post
|
435
188
|
end
|
436
189
|
end
|
437
|
-
# rubocop:enable Metrics/ClassLength
|
438
190
|
end
|