zilkey-auto_tagger 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/autotag +24 -10
- data/recipes/release_tagger.rb +2 -1
- metadata +1 -1
data/bin/autotag
CHANGED
@@ -1,24 +1,38 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
require File.expand_path(File.join(File.dirname(__FILE__), "..", "lib", "auto_tagger"))
|
3
|
+
require 'getoptlong'
|
4
|
+
|
5
|
+
opts = GetoptLong.new(
|
6
|
+
['--help', '-h', '-?', GetoptLong::NO_ARGUMENT]
|
7
|
+
)
|
3
8
|
|
4
9
|
def usage
|
5
10
|
puts
|
6
|
-
puts "USAGE: #{File.basename($0)}
|
11
|
+
puts "USAGE: #{File.basename($0)} <stage> [<repository>]"
|
12
|
+
puts
|
13
|
+
puts ' where: stage sets the tag prefix'
|
14
|
+
puts ' repository sets the repository to act on - defualts to the current directory'
|
7
15
|
puts
|
8
|
-
puts '
|
9
|
-
puts '
|
10
|
-
puts '
|
16
|
+
puts ' examples: autotag'
|
17
|
+
puts ' autotag .'
|
18
|
+
puts ' autotag ../'
|
19
|
+
puts ' autotag /data/myrepo'
|
20
|
+
puts ' autotag demo'
|
11
21
|
puts
|
12
|
-
puts ' example: autotag demo'
|
13
22
|
puts
|
14
|
-
exit
|
23
|
+
exit 0
|
15
24
|
end
|
16
25
|
|
17
|
-
|
18
|
-
|
19
|
-
|
26
|
+
opts.each do |opt, arg|
|
27
|
+
case opt
|
28
|
+
when "--help"
|
29
|
+
usage
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
if ARGV[0]
|
20
34
|
AutoTagger.new(ARGV[0], ARGV[1]).create_tag
|
21
|
-
exit
|
35
|
+
exit 0
|
22
36
|
else
|
23
37
|
usage
|
24
38
|
end
|
data/recipes/release_tagger.rb
CHANGED
@@ -47,7 +47,8 @@ Capistrano::Configuration.instance(:must_exist).load do
|
|
47
47
|
tag_name = AutoTagger.new(variables[:stage], variables[:working_directory]).create_tag(previous_tag)
|
48
48
|
logger.info "AUTO TAGGER created tag #{tag_name} from #{previous_tag.inspect}"
|
49
49
|
else
|
50
|
-
|
50
|
+
tag_name = AutoTagger.new(:production, variables[:working_directory]).create_tag
|
51
|
+
logger.info "AUTO TAGGER created tag #{tag_name}"
|
51
52
|
end
|
52
53
|
end
|
53
54
|
end
|