Skip to content
This repository was archived by the owner on Nov 8, 2018. It is now read-only.

Commit 3b306df

Browse files
committed
Support no_proxy environment variable
octokit uses faraday for making http_request. There is a long standing issue in faraday to add support for the no_proxy environment variable: lostisland/faraday#247 Unfortuantely it seems like this is going nowhere. A workaround is suggested in this issue: berkshelf/berkshelf#1341 The httpclient (and excon) farady adapter picks up proxy settings from the environment automatically.
1 parent 414e06d commit 3b306df

File tree

7 files changed

+13
-4
lines changed

7 files changed

+13
-4
lines changed

Diff for: Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apk add --update \
88
openssh-client \
99
ruby-json \
1010
ca-certificates
11-
RUN gem install octokit --no-rdoc --no-ri
11+
RUN gem install octokit httpclient --no-rdoc --no-ri
1212

1313
ADD assets/ /opt/resource/
1414
RUN chmod +x /opt/resource/*

Diff for: Gemfile

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
source 'https://rubygems.org'
33

44
gem 'octokit'
5+
gem 'httpclient'
56

67
group :development do
78
gem 'pry'

Diff for: Gemfile.lock

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ GEM
2121
faraday (0.9.2)
2222
multipart-post (>= 1.2, < 3)
2323
http_parser.rb (0.6.0)
24+
httpclient (2.8.0)
2425
method_source (0.8.2)
2526
multi_json (1.11.2)
2627
multipart-post (2.0.0)
@@ -73,6 +74,7 @@ PLATFORMS
7374
ruby
7475

7576
DEPENDENCIES
77+
httpclient
7678
octokit
7779
pry
7880
puffing-billy

Diff for: assets/lib/check.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
require 'rubygems'
55
require 'json'
6-
require 'octokit'
76
require_relative 'common'
7+
require 'octokit'
88

99
repo = Repository.new(name: input['source']['repo'])
1010

Diff for: assets/lib/common.rb

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
# encoding: utf-8
2+
3+
require 'faraday'
4+
# httpclient and excon are the only Faraday adpater which support
5+
# the no_proxy environment variable atm
6+
::Faraday.default_adapter= :httpclient
7+
28
require 'octokit'
39
require 'fileutils'
410

Diff for: assets/lib/in.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
require 'rubygems'
77
require 'json'
8+
require_relative 'common'
89
require 'octokit'
910
require 'English'
10-
require_relative 'common'
1111

1212
def uri
1313
input['source']['uri'] || "https://github.com/#{input['source']['repo']}"

Diff for: assets/lib/out.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
require 'rubygems'
77
require 'json'
8-
require 'octokit'
98
require_relative 'common'
9+
require 'octokit'
1010

1111
raise %(`status` "#{input['params']['status']}" is not supported -- only success, failure, error, or pending) unless %w(success failure error pending).include?(input['params']['status'])
1212
raise '`path` required in `params`' unless input['params'].key?('path')

0 commit comments

Comments
 (0)