zilkey-auto_tagger 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -117,6 +117,8 @@ This cap task creates a new tag, based on the latest tag from the previous envir
117
117
 
118
118
  If there is no tag from the previous stage, it creates a new tag from the latest commit in your _working directory_.
119
119
 
120
+ If you don't specify any `autotagger_stages`, autotagger will create a tag that starts with "production".
121
+
120
122
  ### release_tagger:print_latest_tags
121
123
 
122
124
  This task reads the git version from the text file in shared:
@@ -17,7 +17,7 @@ class Tag
17
17
  end
18
18
 
19
19
  def latest_from(stage)
20
- find_all.select{|tag| tag =~ /^#{stage}/}.sort.last
20
+ find_all.select{|tag| tag =~ /^#{stage}\//}.sort.last
21
21
  end
22
22
 
23
23
  def push
@@ -36,10 +36,10 @@ describe CapistranoHelper do
36
36
 
37
37
  describe "#release_tag_entries" do
38
38
  it "returns a column-justifed version of all the commits" do
39
- mock(Commander).execute("/foo", "git tag").times(any_times) { "ci_01\nstaging_01\nproduction_01" }
40
- mock(Commander).execute("/foo", "git --no-pager log ci_01 --pretty=oneline -1") { "guid1" }
41
- mock(Commander).execute("/foo", "git --no-pager log staging_01 --pretty=oneline -1") { "guid2" }
42
- mock(Commander).execute("/foo", "git --no-pager log production_01 --pretty=oneline -1") { "guid3" }
39
+ mock(Commander).execute("/foo", "git tag").times(any_times) { "ci/01\nstaging/01\nproduction/01" }
40
+ mock(Commander).execute("/foo", "git --no-pager log ci/01 --pretty=oneline -1") { "guid1" }
41
+ mock(Commander).execute("/foo", "git --no-pager log staging/01 --pretty=oneline -1") { "guid2" }
42
+ mock(Commander).execute("/foo", "git --no-pager log production/01 --pretty=oneline -1") { "guid3" }
43
43
  mock(Commander).execute!("/foo", "git fetch origin --tags").times(any_times) { true }
44
44
  mock(File).exists?(anything).times(any_times) {true}
45
45
 
@@ -49,9 +49,24 @@ describe CapistranoHelper do
49
49
  }
50
50
  histories = CapistranoHelper.new(variables).release_tag_entries
51
51
  histories.length.should == 3
52
- histories[0].should include("ci_01", "guid1")
53
- histories[1].should include("staging_01", "guid2")
54
- histories[2].should include("production_01", "guid3")
52
+ histories[0].should include("ci/01", "guid1")
53
+ histories[1].should include("staging/01", "guid2")
54
+ histories[2].should include("production/01", "guid3")
55
+ end
56
+
57
+ it "ignores tags delimited with '_'" do
58
+ mock(Commander).execute("/foo", "git tag").times(any_times) { "ci/01\nci_02" }
59
+ mock(Commander).execute("/foo", "git --no-pager log ci/01 --pretty=oneline -1") { "guid1" }
60
+ mock(Commander).execute!("/foo", "git fetch origin --tags").times(any_times) { true }
61
+ mock(File).exists?(anything).times(any_times) {true}
62
+
63
+ variables = {
64
+ :working_directory => "/foo",
65
+ :autotagger_stages => [:ci]
66
+ }
67
+ histories = CapistranoHelper.new(variables).release_tag_entries
68
+ histories.length.should == 1
69
+ histories[0].should include("ci/01", "guid1")
55
70
  end
56
71
  end
57
72
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zilkey-auto_tagger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Dean