zilkey-auto_tagger 0.0.8 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +2 -0
- data/lib/auto_tagger/tag.rb +1 -1
- data/spec/auto_tagger/capistrano_helper_spec.rb +22 -7
- metadata +1 -1
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:
|
data/lib/auto_tagger/tag.rb
CHANGED
@@ -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) { "
|
40
|
-
mock(Commander).execute("/foo", "git --no-pager log
|
41
|
-
mock(Commander).execute("/foo", "git --no-pager log
|
42
|
-
mock(Commander).execute("/foo", "git --no-pager log
|
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("
|
53
|
-
histories[1].should include("
|
54
|
-
histories[2].should include("
|
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
|
|