teamcity-ruby-client 0.1.0 → 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.
Files changed (40) hide show
  1. checksums.yaml +8 -8
  2. data/README.md +4 -0
  3. data/lib/teamcity/client.rb +2 -0
  4. data/lib/teamcity/client/build_types.rb +92 -0
  5. data/lib/teamcity/client/common.rb +13 -2
  6. data/lib/teamcity/client/projects.rb +82 -3
  7. data/lib/teamcity/client/vcs_roots.rb +62 -0
  8. data/lib/teamcity/configuration.rb +10 -2
  9. data/lib/teamcity/connection.rb +1 -0
  10. data/lib/teamcity/request.rb +10 -9
  11. data/lib/teamcity/version.rb +1 -1
  12. data/spec/cassettes/BuildTypes/DELETE/_delete_agent_requirement/should_delete_the_agent_requirement.yml +38 -0
  13. data/spec/cassettes/BuildTypes/DELETE/_delete_buildtype_parameter/should_delete_a_buildtype_parameter.yml +38 -0
  14. data/spec/cassettes/BuildTypes/POST/_attach_vcs_root/should_attach_a_vcs_root_to_a_buildtype.yml +45 -0
  15. data/spec/cassettes/BuildTypes/POST/_create_agent_requirement/should_create_an_agent_requirement_for_a_buildtype.yml +45 -0
  16. data/spec/cassettes/BuildTypes/PUT/_set_buildtype_field/should_pause_a_project.yml +40 -0
  17. data/spec/cassettes/BuildTypes/PUT/_set_buildtype_field/should_set_a_projects_description.yml +40 -0
  18. data/spec/cassettes/BuildTypes/PUT/_set_buildtype_field/should_set_the_buildtype_name.yml +40 -0
  19. data/spec/cassettes/BuildTypes/PUT/_set_buildtype_parameter/should_set_a_buildtype_parameter.yml +40 -0
  20. data/spec/cassettes/Projects/DELETE/_delete_project/should_delete_a_project.yml +79 -0
  21. data/spec/cassettes/Projects/DELETE/_delete_project_parameter/should_delete_a_project_parameter.yml +38 -0
  22. data/spec/cassettes/Projects/POST/_copy_project/should_copy_a_project.yml +86 -0
  23. data/spec/cassettes/Projects/POST/_create_project/should_create_a_project.yml +44 -0
  24. data/spec/cassettes/Projects/PUT/_set_project_field/should_archive_a_project.yml +40 -0
  25. data/spec/cassettes/Projects/PUT/_set_project_field/should_set_a_projects_description.yml +40 -0
  26. data/spec/cassettes/Projects/PUT/_set_project_field/should_set_a_projects_name.yml +40 -0
  27. data/spec/cassettes/Projects/PUT/_set_project_field/should_un-archive_a_project.yml +50 -0
  28. data/spec/cassettes/Projects/PUT/_set_project_parameter/should_set_a_project_parameter.yml +40 -0
  29. data/spec/cassettes/VCSRoots/GET/_vcs_root_details/should_fetch_the_vcs_root_details.yml +44 -0
  30. data/spec/cassettes/VCSRoots/GET/_vcs_roots/should_fetch_vcs_roots.yml +44 -0
  31. data/spec/cassettes/VCSRoots/POST/_create_vcs_root/should_create_a_shared_vcs_root.yml +45 -0
  32. data/spec/cassettes/VCSRoots/POST/_create_vcs_root/should_create_a_vcs_root_that_is_only_shared_within_a_project.yml +48 -0
  33. data/spec/spec_helper.rb +9 -0
  34. data/spec/teamcity/api_spec.rb +2 -0
  35. data/spec/teamcity/client/buildtypes_spec.rb +79 -6
  36. data/spec/teamcity/client/projects_spec.rb +85 -7
  37. data/spec/teamcity/client/vcs_roots_spec.rb +64 -0
  38. data/spec/teamcity_spec.rb +26 -0
  39. data/teamcity-ruby-client.gemspec +2 -1
  40. metadata +62 -3
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects
6
+ body:
7
+ encoding: US-ASCII
8
+ string: test-create-project
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=A8DCC1CA6ACA6730F8D61927FC3268D3; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Content-Type:
34
+ - application/json
35
+ Transfer-Encoding:
36
+ - chunked
37
+ Date:
38
+ - Thu, 02 May 2013 02:23:21 GMT
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! '{"description":"","archived":false,"webUrl":"http://localhost:8111/project.html?projectId=project8","id":"project8","name":"test-create-project","href":"/httpAuth/app/rest/7.0/projects/id:project8","buildTypes":null,"templates":null,"parameters":null}'
42
+ http_version:
43
+ recorded_at: Thu, 02 May 2013 02:23:21 GMT
44
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects/project21/archived
6
+ body:
7
+ encoding: US-ASCII
8
+ string: 'true'
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 204
19
+ message: No Content
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=2156B978C22B9367FA02E60A38A60BE6; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Date:
34
+ - Mon, 06 May 2013 14:11:07 GMT
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ''
38
+ http_version:
39
+ recorded_at: Mon, 06 May 2013 14:11:08 GMT
40
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects/project21/description
6
+ body:
7
+ encoding: US-ASCII
8
+ string: description-changed-by-test
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 204
19
+ message: No Content
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=81E969C0654E55874C873D34DE486051; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Date:
34
+ - Mon, 06 May 2013 14:11:07 GMT
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ''
38
+ http_version:
39
+ recorded_at: Mon, 06 May 2013 14:11:08 GMT
40
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects/project21/name
6
+ body:
7
+ encoding: US-ASCII
8
+ string: project-change-by-test
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 204
19
+ message: No Content
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=26A6850433EBD88598BE1436AEFD5C95; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Date:
34
+ - Mon, 06 May 2013 14:11:07 GMT
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ''
38
+ http_version:
39
+ recorded_at: Mon, 06 May 2013 14:11:07 GMT
40
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects/projecdt21/archived
6
+ body:
7
+ encoding: US-ASCII
8
+ string: 'false'
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 404
19
+ message: Not Found
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=97CD69C5D9B0D0B4FBB695C50116D1DC; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Content-Type:
34
+ - text/plain
35
+ Transfer-Encoding:
36
+ - chunked
37
+ Date:
38
+ - Mon, 06 May 2013 14:13:22 GMT
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! 'Error has occurred during request processing (Not Found).
42
+
43
+ Error: jetbrains.buildServer.server.rest.errors.NotFoundException: No project
44
+ found by locator ''projecdt21''. Project cannot be found by name or id ''projecdt21''.
45
+
46
+ Could not find the entity requested. Check the reference is correct and the
47
+ user has permissions to access the entity.'
48
+ http_version:
49
+ recorded_at: Mon, 06 May 2013 14:13:22 GMT
50
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,40 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: put
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/projects/project2/parameters/set-this-parameter
6
+ body:
7
+ encoding: US-ASCII
8
+ string: some-value
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.1.0
14
+ Content-Type:
15
+ - text/plain
16
+ response:
17
+ status:
18
+ code: 204
19
+ message: No Content
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=155B49584EEB5230B10BBAC7DAB270DD; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Date:
34
+ - Fri, 03 May 2013 19:56:03 GMT
35
+ body:
36
+ encoding: US-ASCII
37
+ string: ''
38
+ http_version:
39
+ recorded_at: Fri, 03 May 2013 19:56:03 GMT
40
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/vcs-roots/id:1
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.2.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=21898D5DEC5FD7973C78F960725A1256; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Content-Type:
34
+ - application/json
35
+ Transfer-Encoding:
36
+ - chunked
37
+ Date:
38
+ - Mon, 06 May 2013 18:14:22 GMT
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! '{"id":1,"name":"teamcity ruby client","vcsName":"jetbrains.git","shared":true,"status":"FINISHED","lastChecked":"20130506T141359-0400","properties":{"property":[{"name":"agentCleanFilesPolicy","value":"ALL_UNTRACKED"},{"name":"agentCleanPolicy","value":"ON_BRANCH_CHANGE"},{"name":"authMethod","value":"PRIVATE_KEY_DEFAULT"},{"name":"branch","value":"master"},{"name":"ignoreKnownHosts","value":"true"},{"name":"submoduleCheckout","value":"CHECKOUT"},{"name":"url","value":"git@github.com:jperry/teamcity-ruby-client.git"},{"name":"usernameStyle","value":"USERID"}]}}'
42
+ http_version:
43
+ recorded_at: Mon, 06 May 2013 18:14:22 GMT
44
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,44 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/vcs-roots
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - TeamCity Ruby Client 0.2.0
14
+ Accept-Encoding:
15
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Server:
22
+ - Apache-Coyote/1.1
23
+ Set-Cookie:
24
+ - JSESSIONID=EB68C7AA38D9B38C86FDF4D53177D074; Path=/; HttpOnly
25
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
26
+ Pragma:
27
+ - no-cache
28
+ Expires:
29
+ - Thu, 01 Jan 1970 00:00:00 GMT
30
+ Cache-Control:
31
+ - no-cache
32
+ - no-store
33
+ Content-Type:
34
+ - application/json
35
+ Transfer-Encoding:
36
+ - chunked
37
+ Date:
38
+ - Mon, 06 May 2013 18:14:22 GMT
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ! '{"vcs-root":[{"id":"1","name":"teamcity ruby client","href":"/httpAuth/app/rest/7.0/vcs-roots/id:1"}]}'
42
+ http_version:
43
+ recorded_at: Mon, 06 May 2013 18:14:22 GMT
44
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,45 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/vcs-roots
6
+ body:
7
+ encoding: US-ASCII
8
+ string: <vcs-root shared="true" name="sharedvcsroot" vcsName="jetbrains.git"><properties><property
9
+ name="branch" value="master"/><property name="url" value="git@github.com:jperry/teamcity-ruby-client.git"/></properties></vcs-root>
10
+ headers:
11
+ Accept:
12
+ - application/json; charset=utf-8
13
+ User-Agent:
14
+ - TeamCity Ruby Client 0.2.0
15
+ Content-Type:
16
+ - application/xml
17
+ response:
18
+ status:
19
+ code: 200
20
+ message: OK
21
+ headers:
22
+ Server:
23
+ - Apache-Coyote/1.1
24
+ Set-Cookie:
25
+ - JSESSIONID=BD1DFD3426A9E8BAF583AF4D36628159; Path=/; HttpOnly
26
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
27
+ Pragma:
28
+ - no-cache
29
+ Expires:
30
+ - Thu, 01 Jan 1970 00:00:00 GMT
31
+ Cache-Control:
32
+ - no-cache
33
+ - no-store
34
+ Content-Type:
35
+ - application/json
36
+ Transfer-Encoding:
37
+ - chunked
38
+ Date:
39
+ - Tue, 07 May 2013 19:13:22 GMT
40
+ body:
41
+ encoding: US-ASCII
42
+ string: ! '{"id":17,"name":"sharedvcsroot","vcsName":"jetbrains.git","shared":true,"status":"NOT_MONITORED","lastChecked":"20130423T104612-0400","properties":{"property":[{"name":"branch","value":"master"},{"name":"url","value":"git@github.com:jperry/teamcity-ruby-client.git"}]}}'
43
+ http_version:
44
+ recorded_at: Tue, 07 May 2013 19:13:23 GMT
45
+ recorded_with: VCR 2.4.0
@@ -0,0 +1,48 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: http://teamcity-ruby-client:teamcity@localhost:8111/httpAuth/app/rest/7.0/vcs-roots
6
+ body:
7
+ encoding: US-ASCII
8
+ string: <vcs-root projectLocator="project2" name="testvcsroot" vcsName="jetbrains.git"><properties><property
9
+ name="branch" value="master"/><property name="url" value="git@github.com:jperry/teamcity-ruby-client.git"/><property
10
+ name="authMethod" value="PRIVATE_KEY_DEFAULT"/><property name="ignoreKnownHosts"
11
+ value="true"/></properties></vcs-root>
12
+ headers:
13
+ Accept:
14
+ - application/json; charset=utf-8
15
+ User-Agent:
16
+ - TeamCity Ruby Client 0.2.0
17
+ Content-Type:
18
+ - application/xml
19
+ response:
20
+ status:
21
+ code: 200
22
+ message: OK
23
+ headers:
24
+ Server:
25
+ - Apache-Coyote/1.1
26
+ Set-Cookie:
27
+ - JSESSIONID=1BC5794E42A8D6EC7062370DCBB89C88; Path=/; HttpOnly
28
+ - RememberMe=""; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; HttpOnly
29
+ Pragma:
30
+ - no-cache
31
+ Expires:
32
+ - Thu, 01 Jan 1970 00:00:00 GMT
33
+ Cache-Control:
34
+ - no-cache
35
+ - no-store
36
+ Content-Type:
37
+ - application/json
38
+ Transfer-Encoding:
39
+ - chunked
40
+ Date:
41
+ - Tue, 07 May 2013 19:13:22 GMT
42
+ body:
43
+ encoding: US-ASCII
44
+ string: ! '{"id":16,"name":"testvcsroot","vcsName":"jetbrains.git","shared":false,"status":"NOT_MONITORED","lastChecked":"20130423T104612-0400","project":{"id":"project2","name":"project
45
+ A","href":"/httpAuth/app/rest/7.0/projects/id:project2"},"properties":{"property":[{"name":"authMethod","value":"PRIVATE_KEY_DEFAULT"},{"name":"branch","value":"master"},{"name":"ignoreKnownHosts","value":"true"},{"name":"url","value":"git@github.com:jperry/teamcity-ruby-client.git"}]}}'
46
+ http_version:
47
+ recorded_at: Tue, 07 May 2013 19:13:23 GMT
48
+ recorded_with: VCR 2.4.0