knife-github 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MjM5M2RiM2MwOWRlY2U1YmUxMjMwYjk5NTgwOWNiZGQ3ODk3N2JmOA==
4
+ ZjllZDU0NzQ5NTgzNzExYzdiYTlhZGFkZjdiODhlYTUzOWEwZDk4Mw==
5
5
  data.tar.gz: !binary |-
6
- MWQyMjFiNTliYWNkZTcyYjFhY2QzOWVjM2QyNjlkMGE0ZDI5NjgzMw==
6
+ MWJlZTY4ZDkwZWJkZjU3YTUzMzQ3YzA2MmUyMjVjNWRjNjg4NTJmMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZDE3NDk2NTBkODgzNzRlZTIxNzI1ZjI5YzRjYjhiYTQxZDQ2NWZiMWU3OGY2
10
- ZWU0N2Y4YTE0NGNkYTE2ZDY1Y2M2NjdiODM1MzlmMjgxMzliMjlkYTUyMThj
11
- MDM5NDQ1ZTk1NzA5YmMzOTdjN2FmNTM0OGVhYjJlNzNlNzQ4MzE=
9
+ ZTE5YzUyNjNjNWMxNjcxNjQyN2MyNzc0ODI0YTlmMzg0ZGU4NjQ1ODQ3YTQw
10
+ ZTZkMjZjNmM1YTYxZjBmMWU4NGY0MDUxODE3ZjQ3NjA2ZDE4YzlkNzgwYTM5
11
+ ZjI3MzkyNDNjOWFjNDAwYTZkMDJjMjJjZTAyYTg5OGJmOTNiZTA=
12
12
  data.tar.gz: !binary |-
13
- MmRhYTdiZTA3ODAzNWUzMDA4NjRmZDE4MDhmYjFjN2Y2YjlhNGYzOGYyMGM1
14
- OWVlMmRiZDliMDlkMzdmYmMwMjNmZDhmYWEwNTc0ZjE0MzA5ZWIyZWQ3NDlm
15
- OWUxODRlODNkNWYyMDE4MjhmZjVhNzg5MjQ5NTM0Mjk1MGM1OWY=
13
+ OGEyNWI0NzU5NTQyZDYzYmJmZWFjMzk4NzJmYjk0YjQyYTI1MzhhZTQ3MWQ1
14
+ YWY0ZWI2NWRlY2ViZjRiZDcxMzljZWU3MGRiZTk5MWUxZjM5ZTVjMGRlMzVk
15
+ NDQ3MDZjMmRiYzYzOWIxOWM5MjU2ZmIxODUzOTIwYTAzN2RkM2M=
data/README.md CHANGED
@@ -10,7 +10,7 @@ Configurations
10
10
  When working on customer admin machines, it's recommended to used an central configuration file.
11
11
  This file should be created in: /etc/githubrc.rb and can contain any attribute in the following structure:
12
12
 
13
- github_url "https://github.schubergphilis.com"
13
+ github_url "https://github.schubergphilis.com"
14
14
  github_link "ssh"
15
15
  github_organizations [ "TLA-Cookbooks", "SBP-Cookbooks" ]
16
16
 
@@ -37,6 +37,9 @@ Here you can also use the github.com address if you don't have an internal appli
37
37
  Here you specify the organizations that you want to taget when searching for cookbooks.
38
38
  The first entry will have priority over the other entries.
39
39
 
40
+ ###### github_proxy \<optional\>
41
+ You can specify a proxy server in case you don't have direct internet access. If you have defined a proxy, github_link needs to be set to either hhtp or https.
42
+
40
43
  ###### github_link \<optional\>
41
44
  You can specify the link type that you would like to use to download your cookbooks, default is <tt>ssh</tt>.
42
45
  Options are <tt>ssh</tt> <tt>git</tt> <tt>http</tt> <tt>https</tt> <tt>svn</tt>
@@ -52,8 +55,6 @@ Currently the options are: <tt>verify_peer</tt> <tt>verify_none</tt>
52
55
  Token information is required when creating and deleting github repositories.
53
56
  With the command <tt>knife github token create</tt> you are able to create token information.
54
57
 
55
- ###### github_proxy \<optional\>
56
- Used for HTTP communication over a proxy.
57
58
 
58
59
  Other
59
60
  =====
@@ -91,6 +91,14 @@ require 'chef/knife'
91
91
  end
92
92
 
93
93
  github_url = repo[cookbook_name][repo_link]
94
+ token = get_github_token
95
+ if token.nil? || token.empty?
96
+ clone_url = github_url
97
+ else
98
+ uri = URI.parse(github_url)
99
+ uri.userinfo = "#{token}:x-oauth-basic"
100
+ clone_url = URI.join(uri)
101
+ end
94
102
  cookbook_path = get_cookbook_path(cookbook_name)
95
103
  if File.exists?(cookbook_path)
96
104
  ui.info("Processing [ SKIP ] #{cookbook_name}")
@@ -98,7 +106,8 @@ require 'chef/knife'
98
106
  else
99
107
  ui.info("Processing [ CLONE ] #{cookbook_name}")
100
108
  Chef::Log.info("Cloning repository to: #{cookbook_path}")
101
- shell_out!("git clone #{github_url} #{cookbook_path}")
109
+ Chef::Log.debug("Using url: #{clone_url}")
110
+ shell_out!("git clone #{clone_url} #{cookbook_path}")
102
111
  end
103
112
  end
104
113
 
@@ -1,6 +1,6 @@
1
1
  module Knife
2
2
  module Github
3
- VERSION = "0.1.6"
3
+ VERSION = "0.1.7"
4
4
  MAJOR, MINOR, TINY = VERSION.split('.')
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-github
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sander Botman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-12-29 00:00:00.000000000 Z
12
+ date: 2014-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mixlib-versioning