teamcity_ruby 0.0.3 → 0.0.4

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.
Files changed (17) hide show
  1. data/lib/teamcity_ruby/vcs_root.rb +10 -4
  2. data/lib/teamcity_ruby/version.rb +1 -1
  3. data/spec/cassettes/TeamcityRuby_BuildConfiguration/an_existing_build_configuration/has_a_build_step_added_to_it.yml +103 -103
  4. data/spec/cassettes/TeamcityRuby_BuildConfiguration/an_existing_build_configuration/has_a_build_trigger_added_to_it.yml +93 -93
  5. data/spec/cassettes/TeamcityRuby_BuildConfiguration/an_existing_build_configuration/has_a_vcs_root_attached_to_it_with_specific_checkout_rules.yml +106 -106
  6. data/spec/cassettes/TeamcityRuby_BuildConfiguration/an_existing_build_configuration/has_settings_definitions.yml +104 -104
  7. data/spec/cassettes/TeamcityRuby_BuildConfiguration/fetches_a_specific_build_configuration_by_id.yml +80 -80
  8. data/spec/cassettes/TeamcityRuby_BuildConfiguration/lists_all_build_configurations.yml +116 -116
  9. data/spec/cassettes/TeamcityRuby_Project/creates_a_project_copying_its_settings_from_a_source_project.yml +93 -93
  10. data/spec/cassettes/TeamcityRuby_Project/creates_a_project_with_a_parent_project.yml +48 -48
  11. data/spec/cassettes/TeamcityRuby_Project/destroys_a_specific_project.yml +64 -64
  12. data/spec/cassettes/TeamcityRuby_Project/fetches_a_specific_project_by_id_locator.yml +64 -64
  13. data/spec/cassettes/TeamcityRuby_Project/fetches_a_specific_project_by_name_locator.yml +56 -56
  14. data/spec/cassettes/TeamcityRuby_Project/lists_all_projects_including_root_built_in_on_TeamCity_.yml +68 -68
  15. data/spec/cassettes/TeamcityRuby_VcsRoot/lists_all_vcs_roots.yml +50 -50
  16. data/spec/teamcity_ruby/vcs_root_spec.rb +21 -0
  17. metadata +3 -3
@@ -2,18 +2,23 @@ module TeamcityRuby
2
2
  class VcsRoot
3
3
  extend TeamcityRuby::Resource
4
4
 
5
- VCS_TYPES = { :git => 'jetbrains.git' }
5
+ VCS_TYPES = { :git => 'jetbrains.git', :svn => 'svn' }
6
6
 
7
7
  DEFAULT_PROJECT = "_Root"
8
- DEFAULT_VCS_TYPE = :git
8
+ DEFAULT_VCS_TYPE = "jetbrains.git"
9
9
 
10
- attr_reader :teamcity_id, :name, :parent_id
10
+ attr_reader :teamcity_id, :name, :parent_id, :vcs_type
11
11
 
12
12
  url_path "/vcs-roots"
13
13
  resource_name "vcs-root"
14
14
 
15
15
  def self.create(options = {}, &block)
16
- vcs_type = VCS_TYPES[options.fetch(:type) { DEFAULT_VCS_TYPE }]
16
+ vcs_type = if options[:vcs_type]
17
+ VCS_TYPES[options[:vcs_type]] || options[:vcs_type]
18
+ else
19
+ DEFAULT_VCS_TYPE
20
+ end
21
+
17
22
  project_id = options.fetch(:project_id) { DEFAULT_PROJECT }
18
23
 
19
24
  attributes = {
@@ -31,6 +36,7 @@ module TeamcityRuby
31
36
  def initialize(options = {})
32
37
  @teamcity_id = options["id"]
33
38
  @name = options["name"]
39
+ @vcs_type = options["vcsName"]
34
40
  end
35
41
 
36
42
  def destroy!
@@ -1,3 +1,3 @@
1
1
  module TeamcityRuby
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -16,28 +16,28 @@ http_interactions:
16
16
  code: 200
17
17
  message: OK
18
18
  headers:
19
- Date:
20
- - Fri, 23 May 2014 04:53:05 GMT
21
- Server:
22
- - Apache-Coyote/1.1
23
19
  Cache-Control:
24
20
  - no-cache
25
21
  - no-store
26
- Pragma:
27
- - no-cache
28
- Transfer-Encoding:
29
- - chunked
30
- Content-Type:
31
- - application/json
32
22
  Set-Cookie:
33
23
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
34
- - TCSESSIONID=2D698BF97148A32AD66D0DF7991662E8; Path=/; HttpOnly
24
+ - TCSESSIONID=E1E960CC6710CDDA6C7D152617A7CE9C; Path=/; HttpOnly
35
25
  Expires:
36
26
  - Thu, 01 Jan 1970 00:00:00 GMT
27
+ Transfer-Encoding:
28
+ - chunked
29
+ Server:
30
+ - Apache-Coyote/1.1
31
+ Pragma:
32
+ - no-cache
33
+ Date:
34
+ - Fri, 23 May 2014 05:17:08 GMT
35
+ Content-Type:
36
+ - application/json
37
37
  body:
38
38
  string: "{\"project\":[{\"id\":\"_Root\",\"name\":\"<Root project>\",\"href\":\"/httpAuth/app/rest/projects/id:_Root\",\"archived\":false,\"webUrl\":\"http://localhost:8111/project.html?projectId=_Root\"},{\"id\":\"SampleProject\",\"name\":\"Sample Project\",\"href\":\"/httpAuth/app/rest/projects/id:SampleProject\",\"archived\":false,\"webUrl\":\"http://localhost:8111/project.html?projectId=SampleProject\",\"parentProjectId\":\"_Root\"}]}"
39
39
  http_version:
40
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
40
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
41
41
  - request:
42
42
  method: delete
43
43
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/projects/id:_Root
@@ -53,31 +53,31 @@ http_interactions:
53
53
  code: 403
54
54
  message: Forbidden
55
55
  headers:
56
- Date:
57
- - Fri, 23 May 2014 04:53:05 GMT
58
- Server:
59
- - Apache-Coyote/1.1
60
56
  Cache-Control:
61
57
  - no-cache
62
58
  - no-store
63
- Pragma:
64
- - no-cache
65
- Transfer-Encoding:
66
- - chunked
67
- Content-Type:
68
- - text/plain
69
59
  Set-Cookie:
70
60
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
71
- - TCSESSIONID=81FF80F5DB64848D0986CD9C8ACE7D0F; Path=/; HttpOnly
61
+ - TCSESSIONID=7FF924BD0D659CAB71E209B10E358A50; Path=/; HttpOnly
72
62
  Expires:
73
63
  - Thu, 01 Jan 1970 00:00:00 GMT
64
+ Transfer-Encoding:
65
+ - chunked
66
+ Server:
67
+ - Apache-Coyote/1.1
68
+ Pragma:
69
+ - no-cache
70
+ Date:
71
+ - Fri, 23 May 2014 05:17:08 GMT
72
+ Content-Type:
73
+ - text/plain
74
74
  body:
75
75
  string: |-
76
76
  Error has occurred during request processing (Forbidden).
77
77
  Error: jetbrains.buildServer.serverSide.auth.AccessDeniedException: Root project cannot be removed
78
78
  Access denied. Check the user has enough permissions to perform the operation.
79
79
  http_version:
80
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
80
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
81
81
  - request:
82
82
  method: delete
83
83
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/projects/id:SampleProject
@@ -93,24 +93,24 @@ http_interactions:
93
93
  code: 204
94
94
  message: No Content
95
95
  headers:
96
- Date:
97
- - Fri, 23 May 2014 04:53:05 GMT
98
- Server:
99
- - Apache-Coyote/1.1
100
96
  Cache-Control:
101
97
  - no-cache
102
98
  - no-store
103
- Pragma:
104
- - no-cache
105
99
  Set-Cookie:
106
100
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
107
- - TCSESSIONID=ADA29B601AEC7768C7C998B6DF4FE26B; Path=/; HttpOnly
101
+ - TCSESSIONID=0DE0280FFB470CC07E5A64C317730619; Path=/; HttpOnly
108
102
  Expires:
109
103
  - Thu, 01 Jan 1970 00:00:00 GMT
104
+ Server:
105
+ - Apache-Coyote/1.1
106
+ Pragma:
107
+ - no-cache
108
+ Date:
109
+ - Fri, 23 May 2014 05:17:08 GMT
110
110
  body:
111
111
  string: ""
112
112
  http_version:
113
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
113
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
114
114
  - request:
115
115
  method: get
116
116
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/vcs-roots
@@ -126,28 +126,28 @@ http_interactions:
126
126
  code: 200
127
127
  message: OK
128
128
  headers:
129
- Date:
130
- - Fri, 23 May 2014 04:53:05 GMT
131
- Server:
132
- - Apache-Coyote/1.1
133
129
  Cache-Control:
134
130
  - no-cache
135
131
  - no-store
136
- Pragma:
137
- - no-cache
138
- Transfer-Encoding:
139
- - chunked
140
- Content-Type:
141
- - application/json
142
132
  Set-Cookie:
143
133
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
144
- - TCSESSIONID=52628BEE7788339FEB0125DAFDB96B5F; Path=/; HttpOnly
134
+ - TCSESSIONID=CDF97D90D6F55F56EF3B6E0B8C62BA38; Path=/; HttpOnly
145
135
  Expires:
146
136
  - Thu, 01 Jan 1970 00:00:00 GMT
137
+ Transfer-Encoding:
138
+ - chunked
139
+ Server:
140
+ - Apache-Coyote/1.1
141
+ Pragma:
142
+ - no-cache
143
+ Date:
144
+ - Fri, 23 May 2014 05:17:08 GMT
145
+ Content-Type:
146
+ - application/json
147
147
  body:
148
148
  string: "{\"count\":1,\"vcs-root\":[{\"id\":\"Root_SampleVcsRoot\",\"name\":\"Sample VCS Root\",\"href\":\"/httpAuth/app/rest/vcs-roots/id:Root_SampleVcsRoot\"}]}"
149
149
  http_version:
150
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
150
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
151
151
  - request:
152
152
  method: delete
153
153
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/vcs-roots/id:Root_SampleVcsRoot
@@ -163,24 +163,24 @@ http_interactions:
163
163
  code: 204
164
164
  message: No Content
165
165
  headers:
166
- Date:
167
- - Fri, 23 May 2014 04:53:05 GMT
168
- Server:
169
- - Apache-Coyote/1.1
170
166
  Cache-Control:
171
167
  - no-cache
172
168
  - no-store
173
- Pragma:
174
- - no-cache
175
169
  Set-Cookie:
176
170
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
177
- - TCSESSIONID=1115525828587CC955BA4BF950BD72EA; Path=/; HttpOnly
171
+ - TCSESSIONID=39075F50C8913764E7B7FCD7C3BECA5F; Path=/; HttpOnly
178
172
  Expires:
179
173
  - Thu, 01 Jan 1970 00:00:00 GMT
174
+ Server:
175
+ - Apache-Coyote/1.1
176
+ Pragma:
177
+ - no-cache
178
+ Date:
179
+ - Fri, 23 May 2014 05:17:08 GMT
180
180
  body:
181
181
  string: ""
182
182
  http_version:
183
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
183
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
184
184
  - request:
185
185
  method: post
186
186
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/projects
@@ -196,28 +196,28 @@ http_interactions:
196
196
  code: 200
197
197
  message: OK
198
198
  headers:
199
- Date:
200
- - Fri, 23 May 2014 04:53:05 GMT
201
- Server:
202
- - Apache-Coyote/1.1
203
199
  Cache-Control:
204
200
  - no-cache
205
201
  - no-store
206
- Pragma:
207
- - no-cache
208
- Transfer-Encoding:
209
- - chunked
210
- Content-Type:
211
- - application/json
212
202
  Set-Cookie:
213
203
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
214
- - TCSESSIONID=E714CECF3031B7BDE06A4A42EA89A651; Path=/; HttpOnly
204
+ - TCSESSIONID=976964A7D33A7C62AE428032AC43E9BC; Path=/; HttpOnly
215
205
  Expires:
216
206
  - Thu, 01 Jan 1970 00:00:00 GMT
207
+ Transfer-Encoding:
208
+ - chunked
209
+ Server:
210
+ - Apache-Coyote/1.1
211
+ Pragma:
212
+ - no-cache
213
+ Date:
214
+ - Fri, 23 May 2014 05:17:08 GMT
215
+ Content-Type:
216
+ - application/json
217
217
  body:
218
218
  string: "{\"id\":\"SampleProject\",\"name\":\"Sample Project\",\"href\":\"/httpAuth/app/rest/projects/id:SampleProject\",\"archived\":false,\"webUrl\":\"http://localhost:8111/project.html?projectId=SampleProject\",\"parentProjectId\":\"_Root\"}"
219
219
  http_version:
220
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
220
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
221
221
  - request:
222
222
  method: post
223
223
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/projects/id:SampleProject/buildTypes
@@ -233,33 +233,33 @@ http_interactions:
233
233
  code: 200
234
234
  message: OK
235
235
  headers:
236
- Date:
237
- - Fri, 23 May 2014 04:53:05 GMT
238
- Server:
239
- - Apache-Coyote/1.1
240
236
  Cache-Control:
241
237
  - no-cache
242
238
  - no-store
243
- Pragma:
244
- - no-cache
245
- Transfer-Encoding:
246
- - chunked
247
- Content-Type:
248
- - application/json
249
239
  Set-Cookie:
250
240
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
251
- - TCSESSIONID=AA893ACBE11F4490C012D4EA660B6083; Path=/; HttpOnly
241
+ - TCSESSIONID=ECF102B9B4167DD5EBF4C088CA99ABCA; Path=/; HttpOnly
252
242
  Expires:
253
243
  - Thu, 01 Jan 1970 00:00:00 GMT
244
+ Transfer-Encoding:
245
+ - chunked
246
+ Server:
247
+ - Apache-Coyote/1.1
248
+ Pragma:
249
+ - no-cache
250
+ Date:
251
+ - Fri, 23 May 2014 05:17:08 GMT
252
+ Content-Type:
253
+ - application/json
254
254
  body:
255
255
  string: "{\"id\":\"SampleProject_SampleBuildConfiguration\",\"name\":\"Sample Build Configuration\",\"href\":\"/httpAuth/app/rest/buildTypes/id:SampleProject_SampleBuildConfiguration\",\"webUrl\":\"http://localhost:8111/viewType.html?buildTypeId=SampleProject_SampleBuildConfiguration\",\"paused\":false,\"project\":{\"id\":\"SampleProject\",\"name\":\"Sample Project\",\"href\":\"/httpAuth/app/rest/projects/id:SampleProject\",\"archived\":false,\"webUrl\":\"http://localhost:8111/project.html?projectId=SampleProject\",\"parentProjectId\":\"_Root\"},\"builds\":{\"href\":\"/httpAuth/app/rest/buildTypes/id:SampleProject_SampleBuildConfiguration/builds/\"},\"vcs-root-entries\":{\"vcs-root-entry\":[]},\"settings\":{\"property\":[{\"name\":\"allowExternalStatus\",\"value\":\"false\"},{\"name\":\"artifactRules\",\"value\":\"\"},{\"name\":\"buildNumberCounter\",\"value\":\"1\"},{\"name\":\"buildNumberPattern\",\"value\":\"%build.counter%\"},{\"name\":\"checkoutDirectory\"},{\"name\":\"checkoutMode\",\"value\":\"ON_SERVER\"},{\"name\":\"cleanBuild\",\"value\":\"false\"},{\"name\":\"enableHangingBuildsDetection\",\"value\":\"true\"},{\"name\":\"executionTimeoutMin\",\"value\":\"0\"},{\"name\":\"maximumNumberOfBuilds\",\"value\":\"0\"},{\"name\":\"shouldFailBuildIfTestsFailed\",\"value\":\"true\"},{\"name\":\"shouldFailBuildOnAnyErrorMessage\",\"value\":\"false\"},{\"name\":\"shouldFailBuildOnBadExitCode\",\"value\":\"true\"},{\"name\":\"shouldFailBuildOnOOMEOrCrash\",\"value\":\"true\"},{\"name\":\"showDependenciesChanges\",\"value\":\"false\"},{\"name\":\"vcsLabelingBranchFilter\",\"value\":\"+:<default>\"}]},\"parameters\":{\"property\":[]},\"steps\":{\"step\":[]},\"features\":{\"feature\":[]},\"triggers\":{\"trigger\":[]},\"snapshot-dependencies\":{\"snapshot-dependency\":[]},\"artifact-dependencies\":{\"artifact-dependency\":[]},\"agent-requirements\":{\"agent-requirement\":[]}}"
256
256
  http_version:
257
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
257
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
258
258
  - request:
259
259
  method: post
260
260
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/buildTypes/id:SampleProject_SampleBuildConfiguration/steps
261
261
  body:
262
- string: "{\"properties\":{\"property\":[{\"value\":\"verify\",\"name\":\"goals\"}]},\"type\":\"Maven\",\"name\":\"Sample Step\"}"
262
+ string: "{\"type\":\"Maven\",\"name\":\"Sample Step\",\"properties\":{\"property\":[{\"value\":\"verify\",\"name\":\"goals\"}]}}"
263
263
  headers:
264
264
  Accept:
265
265
  - application/json
@@ -270,28 +270,28 @@ http_interactions:
270
270
  code: 200
271
271
  message: OK
272
272
  headers:
273
- Date:
274
- - Fri, 23 May 2014 04:53:05 GMT
275
- Server:
276
- - Apache-Coyote/1.1
277
273
  Cache-Control:
278
274
  - no-cache
279
275
  - no-store
280
- Pragma:
281
- - no-cache
282
- Transfer-Encoding:
283
- - chunked
284
- Content-Type:
285
- - application/json
286
276
  Set-Cookie:
287
277
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
288
- - TCSESSIONID=7B9E3297FEA4E9F1861522AE1F8B6EB9; Path=/; HttpOnly
278
+ - TCSESSIONID=CA3D08DBAC75FBD2BEED86D58D5A1F95; Path=/; HttpOnly
289
279
  Expires:
290
280
  - Thu, 01 Jan 1970 00:00:00 GMT
281
+ Transfer-Encoding:
282
+ - chunked
283
+ Server:
284
+ - Apache-Coyote/1.1
285
+ Pragma:
286
+ - no-cache
287
+ Date:
288
+ - Fri, 23 May 2014 05:17:08 GMT
289
+ Content-Type:
290
+ - application/json
291
291
  body:
292
- string: "{\"id\":\"RUNNER_46\",\"name\":\"Sample Step\",\"type\":\"Maven\",\"properties\":{\"property\":[{\"name\":\"goals\",\"value\":\"verify\"}]}}"
292
+ string: "{\"id\":\"RUNNER_47\",\"name\":\"Sample Step\",\"type\":\"Maven\",\"properties\":{\"property\":[{\"name\":\"goals\",\"value\":\"verify\"}]}}"
293
293
  http_version:
294
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
294
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT
295
295
  - request:
296
296
  method: get
297
297
  uri: http://teamcity:teamcity@localhost:8111/httpAuth/app/rest/buildTypes/id:SampleProject_SampleBuildConfiguration/steps
@@ -307,25 +307,25 @@ http_interactions:
307
307
  code: 200
308
308
  message: OK
309
309
  headers:
310
- Date:
311
- - Fri, 23 May 2014 04:53:05 GMT
312
- Server:
313
- - Apache-Coyote/1.1
314
310
  Cache-Control:
315
311
  - no-cache
316
312
  - no-store
317
- Pragma:
318
- - no-cache
319
- Transfer-Encoding:
320
- - chunked
321
- Content-Type:
322
- - application/json
323
313
  Set-Cookie:
324
314
  - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
325
- - TCSESSIONID=74AC86D09833CEB4071576A3B6DC8673; Path=/; HttpOnly
315
+ - TCSESSIONID=F5C6B7778E6B2D10973D8A8E78CE327F; Path=/; HttpOnly
326
316
  Expires:
327
317
  - Thu, 01 Jan 1970 00:00:00 GMT
318
+ Transfer-Encoding:
319
+ - chunked
320
+ Server:
321
+ - Apache-Coyote/1.1
322
+ Pragma:
323
+ - no-cache
324
+ Date:
325
+ - Fri, 23 May 2014 05:17:08 GMT
326
+ Content-Type:
327
+ - application/json
328
328
  body:
329
- string: "{\"step\":[{\"id\":\"RUNNER_46\",\"name\":\"Sample Step\",\"type\":\"Maven\",\"properties\":{\"property\":[{\"name\":\"goals\",\"value\":\"verify\"}]}}]}"
329
+ string: "{\"step\":[{\"id\":\"RUNNER_47\",\"name\":\"Sample Step\",\"type\":\"Maven\",\"properties\":{\"property\":[{\"name\":\"goals\",\"value\":\"verify\"}]}}]}"
330
330
  http_version:
331
- recorded_at: Fri, 23 May 2014 04:53:06 GMT
331
+ recorded_at: Fri, 23 May 2014 05:17:09 GMT