semaphore_api 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 83e49148997488d3d6767b0196608a34ed75f1b3
4
- data.tar.gz: a22df7d3163c1ede429b885d05d36894aad9cd4e
3
+ metadata.gz: 8b7d2e14a3b0f7271815d1a4e7e213ea733f6746
4
+ data.tar.gz: 809d3879dd177a85785511bfbbb7278bb6e8a2ae
5
5
  SHA512:
6
- metadata.gz: 6b812ef0163ceaa3583ae4b8e7802a4160f9701685d8783a0c61116413aedfc8e6fd49b19d4f0a0bec5c882d616ffb748567cba8a05b2c308297c865b007d7e1
7
- data.tar.gz: c46f4d1a2d5e40878ad4f9a82b8eb799f27abbce313c8ab29412da92042d0474e5e5e709343a5b0d1a8bcf9f0301d7077710c22d3149a2c53884efbcabc41a74
6
+ metadata.gz: 30d6ec3c63590e3103c71e10e46ac7aa0be07b2e7884c9d97c13b6b7d696cb1805430d07f0f898f7676721fdcbfebca97150fb91bf643434ad140bf9c05f2fa3
7
+ data.tar.gz: f92140098faf456952e27b72a0b110cf3e48baa00472c6d6679c31ccf886a59a4c7a1d6d588ee7374a4a985cf0458c0293b3c71f8e440c2a6b3b6a5e6ef1df18
@@ -33,6 +33,18 @@ module SemaphoreApi
33
33
  response.body
34
34
  end
35
35
 
36
+ def put(path, options = {})
37
+ response = agent.put("/api/v1/#{path}", options.merge(:auth_token => @auth_token))
38
+
39
+ response.body
40
+ end
41
+
42
+ def delete(path, options = {})
43
+ response = agent.delete("/api/v1/#{path}", options.merge(:auth_token => @auth_token))
44
+
45
+ response.body
46
+ end
47
+
36
48
  def agent
37
49
  @agent ||= Zoid::Agent.new(end_point)
38
50
  end
@@ -10,6 +10,14 @@ module SemaphoreApi
10
10
  get "/projects/#{project_hash_id}/#{branch_id}/builds/#{build_number}/log"
11
11
  end
12
12
 
13
+ def launch_build(project_hash_id, branch_id, options = {})
14
+ post "/projects/#{project_hash_id}/#{branch_id}/build"
15
+ end
16
+
17
+ def stop_build(project_hash_id, branch_id, build_number, options = {})
18
+ post "/projects/#{project_hash_id}/#{branch_id}/builds/#{build_number}/stop"
19
+ end
20
+
13
21
  end
14
22
  end
15
23
  end
@@ -10,6 +10,14 @@ module SemaphoreApi
10
10
  get "/projects/#{project_hash_id}/servers/#{server_id}/deploys/#{deploy_number}/log"
11
11
  end
12
12
 
13
+ def launch_deploy(project_hash_id, branch_id, build_number, server_id, depoy_number, options = {})
14
+ post "/projects/#{project_hash_id}/#{branch_id}/builds/#{build_number}/deploy/#{server_id}", options
15
+ end
16
+
17
+ def stop_deploy(project_hash_id, branch_id, deploy_number, options = {})
18
+ post "/projects/#{project_hash_id}/#{branch_id}/deploys/#{deploy_number}/stop", options
19
+ end
20
+
13
21
  end
14
22
  end
15
23
  end
@@ -10,6 +10,14 @@ module SemaphoreApi
10
10
  post "/projects/#{project_hash_id}/hooks", options
11
11
  end
12
12
 
13
+ def edit_webhook(project_hash_id, webhook_id, options = {})
14
+ put "/projects/#{project_hash_id}/hooks/#{webhook_id}", options
15
+ end
16
+
17
+ def delete_webhook(project_hash_id, webhook_id, options = {})
18
+ delete "/projects/#{project_hash_id}/hooks/#{webhook_id}", options
19
+ end
20
+
13
21
  end
14
22
  end
15
23
  end
@@ -1,3 +1,3 @@
1
1
  module SemaphoreApi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "zoid", "~> 0.2"
21
+ spec.add_dependency "zoid", "~> 0.3"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.9"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semaphore_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Sarcevic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0.2'
19
+ version: '0.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0.2'
26
+ version: '0.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement