ncss-cookbooks 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +21 -1
  2. data/VERSION +1 -1
  3. data/lib/ncss-cookbooks.rb +6 -3
  4. metadata +17 -17
data/README.md CHANGED
@@ -8,6 +8,18 @@ Chef の Cookbooks を一発で NIFTYCloud クラウドストレージにアッ
8
8
 
9
9
  gem install ncss-cookbooks
10
10
 
11
+ ## コマンド一覧
12
+
13
+ $ ncss-cookbooks
14
+ Commands:
15
+ ncss-cookbooks create <bucket_name> # create ncss bucket
16
+ ncss-cookbooks help [COMMAND] # Describe available commands or one specific command
17
+ ncss-cookbooks upload <bucket_name> # upload . to ncss bucket
18
+
19
+ Options:
20
+ [--access-key-id=ACCESS_KEY_ID]
21
+ [--secret-access-key=SECRET_ACCESS_KEY]
22
+
11
23
  ## 使い方
12
24
 
13
25
  まずはアップロードしたい cookbooks を用意します。
@@ -32,6 +44,7 @@ cookbooks のバージョン情報が書いてある VERSION ファイルを作
32
44
  $ export SECRET_ACCESS_KEY=YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
33
45
 
34
46
  これで準備完了です。cookbooks ディレクトリの中で ncss-cookbooks コマンドを打ちます。
47
+
35
48
  ncss-cookbooks create でバケットを作成します。
36
49
 
37
50
  $ ncss-cookbooks create my-bucket
@@ -39,7 +52,14 @@ ncss-cookbooks create でバケットを作成します。
39
52
  ncss-cookbooks upload で作成したバケットに cookbooks をアップロードします。
40
53
 
41
54
  $ ncss-cookbooks upload my-bucket
42
- https://my-bucket.ncss.nifty.com/v0.0.0/cookbooks.tgz
55
+ Version is v0.0.1
56
+ Creating directory /tmp/ncss-cookbooks-20130519-30448-2im9m1/cookbooks/
57
+ Copying files from /home/tily/dev/ncss-cookbooks to /tmp/ncss-cookbooks-20130519-30448-2im9m1/cookbooks/
58
+ Excluded /home/tily/dev/ncss-cookbooks/.git
59
+ Archiving /tmp/ncss-cookbooks-20130519-30448-2im9m1/cookbooks/ to /tmp/ncss-cookbooks-20130519-30448-2im9m1/cookbooks.tgz
60
+ Uploading /tmp/ncss-cookbooks-20130519-30448-2im9m1/cookbooks.tgz to bucket:my-bucket, object:v0.0.1/cookbooks.tgz
61
+ Temporary directory /tmp/ncss-cookbooks-20130519-30448-2im9m1 will be deleted automatically
62
+ Uploaded to https://my-bucket.ncss.nifty.com/v0.0.1/cookbooks.tgz
43
63
 
44
64
  発行された URL は chef-solo の -r オプションで利用することができます。
45
65
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.1
1
+ 0.0.2
@@ -10,13 +10,14 @@ require 'archive/tar/minitar'
10
10
  class NcssCookbooks < Thor
11
11
  class_option :access_key_id, :alias => '-a'
12
12
  class_option :secret_access_key, :alias => '-s'
13
+ class_option :http_proxy, :alias => '-p'
13
14
 
14
- desc 'create <bucket>', 'create ncss bucket'
15
+ desc 'create <bucket_name>', 'create ncss bucket'
15
16
  def create(bucket_name)
16
17
  ncss.buckets.create(bucket_name)
17
18
  end
18
19
 
19
- desc 'upload <bucket>', 'upload . to ncss bucket'
20
+ desc 'upload <bucket_name>', 'upload . to ncss bucket'
20
21
  option :verbose
21
22
  def upload(bucket_name)
22
23
  @pwd = Dir.pwd
@@ -57,6 +58,7 @@ class NcssCookbooks < Thor
57
58
  end
58
59
 
59
60
  puts "Uploaded to " + object.url_for(:read).to_s.gsub(/\?(.+)$/, '')
61
+ FileUtils.cd(@pwd) # release tmpdir for windows platform
60
62
  end
61
63
 
62
64
  private
@@ -66,7 +68,8 @@ class NcssCookbooks < Thor
66
68
  @ncss ||= AWS::S3.new(
67
69
  :access_key_id => options[:access_key_id] || ENV['ACCESS_KEY_ID'] || HighLine.new.ask('Access Key Id: '),
68
70
  :secret_access_key => options[:secret_access_key] || ENV['SECRET_ACCESS_KEY'] || HighLine.new.ask('Secret Access Key: '),
69
- :s3_endpoint => 'ncss.nifty.com'
71
+ :s3_endpoint => 'ncss.nifty.com',
72
+ :proxy_uri => options[:http_proxy] || ENV['HTTP_PROXY'] || nil
70
73
  )
71
74
  end
72
75
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncss-cookbooks
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-19 00:00:00.000000000Z
12
+ date: 2013-05-20 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
16
- requirement: &224772700 !ruby/object:Gem::Requirement
16
+ requirement: &203387600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *224772700
24
+ version_requirements: *203387600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: highline
27
- requirement: &224769760 !ruby/object:Gem::Requirement
27
+ requirement: &203386980 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *224769760
35
+ version_requirements: *203386980
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: aws-sdk
38
- requirement: &224768820 !ruby/object:Gem::Requirement
38
+ requirement: &203385660 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *224768820
46
+ version_requirements: *203385660
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: archive-tar-minitar
49
- requirement: &224767080 !ruby/object:Gem::Requirement
49
+ requirement: &203374720 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *224767080
57
+ version_requirements: *203374720
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &224751260 !ruby/object:Gem::Requirement
60
+ requirement: &203373580 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ~>
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: 2.8.0
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *224751260
68
+ version_requirements: *203373580
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rdoc
71
- requirement: &224748660 !ruby/object:Gem::Requirement
71
+ requirement: &203372360 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ~>
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '3.12'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *224748660
79
+ version_requirements: *203372360
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: jeweler
82
- requirement: &224745580 !ruby/object:Gem::Requirement
82
+ requirement: &203371180 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ~>
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: 1.8.4
88
88
  type: :development
89
89
  prerelease: false
90
- version_requirements: *224745580
90
+ version_requirements: *203371180
91
91
  description: Chef の Cookbooks を一発で NIFTYCloud クラウドストレージにアップロードするコマンド
92
92
  email: tily05@gmail.com
93
93
  executables:
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: -2339505270493421964
129
+ hash: -490754878577824468
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements: