shipit-engine 0.8.7 → 0.8.8

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: 74cc484927228d18c31d24f110e2341307e984ef
4
- data.tar.gz: 808334ec6a06615b548eb0e20e47571fb943599d
3
+ metadata.gz: ee64f554f8b69bafd115203bc2cecc33521d5a7a
4
+ data.tar.gz: 7c8029319509f59e820d7923e9ecc6eaf226d8e2
5
5
  SHA512:
6
- metadata.gz: 10ea80eaae7515e6850a8c3e690b1b16da2f99e72760c361ea066186039090df31ec9beac04243421026b61f46c72346402dce98481291aee43f9dd286b51e52
7
- data.tar.gz: 818be40a841487e4d453cfc44ebb9cce0d6b1ba262ebcc1b84a1882af8eccbf50bb65a03c56f25ff68acf214e771e1ff3f2ccb3093ce6790e179b06d6d3de5da
6
+ metadata.gz: 950959a1195778f0e3113db087b7e999866467ad79a095a70843a309f09bd212566e2d91679ee1b72d85854ae2b00a54189b33433051d46461f6aa880652af4e
7
+ data.tar.gz: 5a9a53f97e460c4fc189220b6f028d9a2851bd6298542491a295fe1a7949fe981b3090dee882960b49aa05b275d9a70cfdec0142a761efab06fdd4bb29332f97
@@ -13,6 +13,8 @@ module Shipit
13
13
 
14
14
  create_deployment_on_github!
15
15
  statuses.order(id: :asc).each(&:create_on_github!)
16
+ rescue Octokit::NotFound, Octokit::Forbidden
17
+ # If no one can create the deployment we can only give up
16
18
  end
17
19
 
18
20
  def create_deployment_on_github!
@@ -38,7 +38,11 @@ module Shipit
38
38
  def github_api
39
39
  return Shipit.github_api unless github_access_token
40
40
 
41
- @github_api ||= Octokit::Client.new(access_token: github_access_token)
41
+ @github_api ||= begin
42
+ client = Octokit::Client.new(access_token: github_access_token)
43
+ client.middleware = Shipit.new_faraday_stack
44
+ client
45
+ end
42
46
  end
43
47
 
44
48
  def identifiers_for_ping
data/lib/shipit.rb CHANGED
@@ -83,14 +83,22 @@ module Shipit
83
83
  def github_api
84
84
  @github_api ||= begin
85
85
  client = Octokit::Client.new(github_api_credentials)
86
- client.middleware.use(
86
+ client.middleware = new_faraday_stack
87
+ client
88
+ end
89
+ end
90
+
91
+ def new_faraday_stack
92
+ Faraday::RackBuilder.new do |builder|
93
+ builder.use(
87
94
  Faraday::HttpCache,
88
95
  shared_cache: false,
89
96
  store: Rails.cache,
90
97
  logger: Rails.logger,
91
98
  serializer: NullSerializer,
92
99
  )
93
- client
100
+ builder.use Octokit::Response::RaiseError
101
+ builder.adapter Faraday.default_adapter
94
102
  end
95
103
  end
96
104
 
@@ -1,3 +1,3 @@
1
1
  module Shipit
2
- VERSION = '0.8.7'
2
+ VERSION = '0.8.8'
3
3
  end
Binary file
Binary file
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shipit-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.7
4
+ version: 0.8.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake