bard 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +4 -0
- data/VERSION +1 -1
- data/bard.gemspec +1 -1
- data/features/bard_check.feature +8 -0
- data/features/bard_push.feature +4 -4
- data/features/step_definitions/check_steps.rb +5 -0
- data/features/step_definitions/global_steps.rb +1 -0
- data/features/step_definitions/submodule_steps.rb +8 -7
- data/lib/bard.rb +1 -0
- metadata +1 -1
data/Rakefile
CHANGED
@@ -25,6 +25,10 @@ rescue LoadError
|
|
25
25
|
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
26
26
|
end
|
27
27
|
|
28
|
+
task :release do
|
29
|
+
Rake::Task["gemcutter:release"].invoke
|
30
|
+
end
|
31
|
+
|
28
32
|
require 'spec/rake/spectask'
|
29
33
|
Spec::Rake::SpecTask.new(:spec) do |spec|
|
30
34
|
spec.libs << 'lib' << 'spec'
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
data/bard.gemspec
CHANGED
data/features/bard_check.feature
CHANGED
@@ -89,3 +89,11 @@ Feature: Bard can check its environment for missing dependencies and potential p
|
|
89
89
|
And the git hook on the staging server is bad
|
90
90
|
When I type "bard check ." on the staging server
|
91
91
|
Then I should see the fatal error "improper git hook"
|
92
|
+
|
93
|
+
@wip
|
94
|
+
Scenario: Bard check detects missing receive.denyCurrentBranch git variable on staging
|
95
|
+
Given a shared rails project
|
96
|
+
And my "RAILS_ENV" environment variable is "staging"
|
97
|
+
And the staging server git config for receive.denyCurrentBranch is not "ignore"
|
98
|
+
When I type "bard check ." on the staging server
|
99
|
+
Then I should see the fatal error "denyCurrentBranch"
|
data/features/bard_push.feature
CHANGED
@@ -29,20 +29,20 @@ Feature: bard push
|
|
29
29
|
Given I have committed a set of changes that includes a new submodule
|
30
30
|
When I type "bard push"
|
31
31
|
Then there should be one new submodule on the remote
|
32
|
-
And the
|
32
|
+
And the submodule branch should match the submodule origin branch
|
33
33
|
|
34
34
|
Scenario: Pushing a change that includes a submodule update
|
35
35
|
Given a submodule
|
36
36
|
And I have committed a set of changes that includes a submodule update
|
37
37
|
When I type "bard push"
|
38
|
-
Then the
|
38
|
+
Then the submodule branch should match the submodule origin branch
|
39
39
|
|
40
40
|
Scenario: Pushing a change that includes a submodule url change
|
41
41
|
Given a submodule
|
42
|
-
|
42
|
+
And I have committed a set of changes that includes a submodule url change
|
43
43
|
When I type "bard push"
|
44
44
|
Then the remote submodule url should be changed
|
45
|
-
And the
|
45
|
+
And the submodule branch should match the submodule origin branch
|
46
46
|
|
47
47
|
# TODO
|
48
48
|
#Scenario: Pushing a change that includes a submodule deletion
|
@@ -69,3 +69,8 @@ Given /^the git hook on the staging server is bad$/ do
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
+
Given /^the staging server git config for receive.denyCurrentBranch is not "ignore"$/ do
|
73
|
+
Dir.chdir "#{ROOT}/tmp/origin" do
|
74
|
+
type "git config --unset receive.denyCurrentBranch"
|
75
|
+
end
|
76
|
+
end
|
@@ -4,7 +4,10 @@ Given /^a submodule$/ do
|
|
4
4
|
type "git checkout integration"
|
5
5
|
type "git pull --rebase"
|
6
6
|
type "git submodule init"
|
7
|
-
type "git submodule update
|
7
|
+
type "git submodule update"
|
8
|
+
Dir.chdir "submodule" do
|
9
|
+
type "git checkout master"
|
10
|
+
end
|
8
11
|
@submodule_url = File.read(".gitmodules").match(/url = (.*)$/)[1]
|
9
12
|
@submodule_commit = type "git submodule status"
|
10
13
|
end
|
@@ -19,7 +22,6 @@ end
|
|
19
22
|
|
20
23
|
Given /^I have committed a set of changes to the submodule$/ do
|
21
24
|
Dir.chdir "#{ROOT}/tmp/local/submodule" do
|
22
|
-
type "git checkout -b master"
|
23
25
|
type "echo 'submodule_update' > submodule_update"
|
24
26
|
type "git add ."
|
25
27
|
type "git commit -am 'update in submodule'"
|
@@ -29,10 +31,8 @@ end
|
|
29
31
|
Given /^the remote integration branch has had a commit that includes a new submodule$/ do
|
30
32
|
Dir.chdir "#{ROOT}/tmp/origin" do
|
31
33
|
type "git submodule add #{ROOT}/tmp/submodule submodule"
|
32
|
-
|
33
|
-
|
34
|
-
type "grb track master"
|
35
|
-
end
|
34
|
+
type "git submodule init"
|
35
|
+
type "git submodule update"
|
36
36
|
type "git add ."
|
37
37
|
type "git commit -m 'added submodule'"
|
38
38
|
end
|
@@ -40,8 +40,9 @@ end
|
|
40
40
|
|
41
41
|
Given /^I have committed a set of changes that includes a new submodule$/ do
|
42
42
|
type "git submodule add #{ROOT}/tmp/submodule submodule"
|
43
|
+
type "git submodule init"
|
44
|
+
type "git submodule update --merge"
|
43
45
|
Dir.chdir "submodule" do
|
44
|
-
type "git checkout -b master"
|
45
46
|
type "grb track master"
|
46
47
|
end
|
47
48
|
type "git add ."
|
data/lib/bard.rb
CHANGED
@@ -155,6 +155,7 @@ class Bard < Thor
|
|
155
155
|
else
|
156
156
|
errors << "missing git hook"
|
157
157
|
end
|
158
|
+
errors << "the git config variable receive.denyCurrentBranch is not set to ignore" if `git config receive.denyCurrentBranch`.chomp != "ignore"
|
158
159
|
end
|
159
160
|
|
160
161
|
warnings << "RAILS_ENV is not set" if ENV['RAILS_ENV'].nil? or ENV['RAILS_ENV'].empty?
|