thor-tropo 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/changelog.md ADDED
@@ -0,0 +1,5 @@
1
+ #1.2.0
2
+
3
+ * Improve logging
4
+ * Bundle foodcritic thor tasks
5
+ * Allow version to be overridden
data/lib/thor-tropo.rb CHANGED
@@ -6,6 +6,7 @@ module ThorTropo
6
6
  require 'thor'
7
7
  require 'thor/actions'
8
8
  require 'thor/scmversion'
9
+ require 'thor/foodcritic'
9
10
  require 'tmpdir'
10
11
  require 'archive/tar/minitar'
11
12
  require 'zlib'
@@ -30,6 +31,15 @@ module ThorTropo
30
31
  :aliases => "-v",
31
32
  :default => false
32
33
 
34
+ desc "package", "Package cookbooks and upload to S3"
35
+
36
+ method_option :"version-override",
37
+ :type => :string,
38
+ :aliases => "-V",
39
+ :default => nil,
40
+ :desc => "Force override of version number",
41
+ :banner => "Force override of cookbook version"
42
+
33
43
  method_option :force,
34
44
  :type => :boolean,
35
45
  :aliases => "-f",
@@ -57,7 +67,12 @@ module ThorTropo
57
67
  :desc => "Delete lockfile before running `Berks install`",
58
68
  :banner => "Delete lockfile before running `Berks install`"
59
69
 
60
- desc "package", "Package cookbooks and upload to S3"
70
+ # def version
71
+ # OLDVERSION=`sed -n -e "s/version.*\"\(.*\)\"/\1/p" metadata.rb`
72
+ # sed -ie "s/\(version *\)\".*\"/\1\"$OLDVERSION\"/" metadata.rb
73
+ # git add metadata.rb
74
+ # end
75
+
61
76
 
62
77
  def package
63
78
 
@@ -140,8 +155,12 @@ module ThorTropo
140
155
  end
141
156
 
142
157
  def current_version
143
- metadata = Ridley::Chef::Cookbook::Metadata.from_file(File.join(options[:called_path],"metadata.rb"))
144
- metadata.version
158
+ if options[:"version-override"]
159
+ options[:"version-override"]
160
+ else
161
+ metadata = Ridley::Chef::Cookbook::Metadata.from_file(File.join(options[:called_path],"metadata.rb"))
162
+ metadata.version
163
+ end
145
164
  end
146
165
 
147
166
  def tag_version
@@ -78,7 +78,7 @@ module ThorTropo
78
78
  local_file = opts[:local_file]
79
79
  remote_file = opts[:remote_file]
80
80
 
81
- say "[ TROPO ] - Uploading file.", :blue
81
+ say "[ TROPO ] - Uploading file. [#{File.basename(opts[:local_file])}", :blue
82
82
  unless opts[:noop]
83
83
  file = @bucket_name.files.create(
84
84
  :key => remote_file,
data/thor-tropo.gemspec CHANGED
@@ -16,13 +16,13 @@ Gem::Specification.new do |gem|
16
16
  gem.version = ThorTropo::VERSION
17
17
 
18
18
  #gem.add_dependency 'json', ">= 1.7.0"
19
- gem.add_dependency 'thor'
20
19
  gem.add_dependency 'chef', "~> 11.0"
21
20
  gem.add_dependency 'berkshelf'
22
- gem.add_dependency 'thor-scmversion'
23
21
  gem.add_dependency 'minitar', '~> 0.5.4'
24
- gem.add_dependency 'aws-sdk'
25
22
  gem.add_dependency 'fog'
23
+ gem.add_dependency 'thor'
24
+ gem.add_dependency 'thor-scmversion'
25
+ gem.add_dependency 'thor-foodcritic'
26
26
 
27
27
  gem.add_development_dependency 'foodcritic'
28
28
  gem.add_development_dependency 'webmock'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thor-tropo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,55 +12,55 @@ cert_chain: []
12
12
  date: 2013-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: thor
15
+ name: chef
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ! '>='
19
+ - - ~>
20
20
  - !ruby/object:Gem::Version
21
- version: '0'
21
+ version: '11.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ! '>='
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
- version: '0'
29
+ version: '11.0'
30
30
  - !ruby/object:Gem::Dependency
31
- name: chef
31
+ name: berkshelf
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  none: false
34
34
  requirements:
35
- - - ~>
35
+ - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: '11.0'
37
+ version: '0'
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
- - - ~>
43
+ - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: '11.0'
45
+ version: '0'
46
46
  - !ruby/object:Gem::Dependency
47
- name: berkshelf
47
+ name: minitar
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: 0.5.4
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: 0.5.4
62
62
  - !ruby/object:Gem::Dependency
63
- name: thor-scmversion
63
+ name: fog
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  none: false
66
66
  requirements:
@@ -76,23 +76,23 @@ dependencies:
76
76
  - !ruby/object:Gem::Version
77
77
  version: '0'
78
78
  - !ruby/object:Gem::Dependency
79
- name: minitar
79
+ name: thor
80
80
  requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
82
  requirements:
83
- - - ~>
83
+ - - ! '>='
84
84
  - !ruby/object:Gem::Version
85
- version: 0.5.4
85
+ version: '0'
86
86
  type: :runtime
87
87
  prerelease: false
88
88
  version_requirements: !ruby/object:Gem::Requirement
89
89
  none: false
90
90
  requirements:
91
- - - ~>
91
+ - - ! '>='
92
92
  - !ruby/object:Gem::Version
93
- version: 0.5.4
93
+ version: '0'
94
94
  - !ruby/object:Gem::Dependency
95
- name: aws-sdk
95
+ name: thor-scmversion
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  none: false
98
98
  requirements:
@@ -108,7 +108,7 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: fog
111
+ name: thor-foodcritic
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  none: false
114
114
  requirements:
@@ -299,6 +299,7 @@ files:
299
299
  - Thorfile
300
300
  - VERSION
301
301
  - bin/scmversion
302
+ - changelog.md
302
303
  - lib/thor-tropo.rb
303
304
  - lib/thor-tropo/configuration.rb
304
305
  - lib/thor-tropo/uploader.rb