bard 1.8.0.beta → 1.8.0.beta2
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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +5 -0
- data/Rakefile +3 -1
- data/cucumber.yml +1 -0
- data/features/data.feature +12 -0
- data/features/deploy.feature +13 -0
- data/features/run.feature +13 -0
- data/features/step_definitions/bard_steps.rb +39 -0
- data/features/support/env.rb +5 -39
- data/features/support/test_server.rb +215 -0
- data/lib/bard/command.rb +29 -10
- data/lib/bard/copy.rb +8 -2
- data/lib/bard/target.rb +55 -12
- data/lib/bard/version.rb +1 -1
- data/spec/acceptance/docker/Dockerfile +2 -1
- data/spec/bard/command_spec.rb +1 -1
- data/spec/bard/copy_spec.rb +3 -3
- data/spec/bard/deprecation_spec.rb +79 -0
- data/spec/bard/target_spec.rb +4 -4
- metadata +13 -30
- data/features/bard_check.feature +0 -94
- data/features/bard_deploy.feature +0 -18
- data/features/bard_pull.feature +0 -112
- data/features/bard_push.feature +0 -112
- data/features/podman_testcontainers.feature +0 -16
- data/features/step_definitions/check_steps.rb +0 -47
- data/features/step_definitions/git_steps.rb +0 -73
- data/features/step_definitions/global_steps.rb +0 -56
- data/features/step_definitions/podman_steps.rb +0 -23
- data/features/step_definitions/rails_steps.rb +0 -44
- data/features/step_definitions/submodule_steps.rb +0 -110
- data/features/support/grit_ext.rb +0 -13
- data/features/support/io.rb +0 -32
- data/features/support/podman.rb +0 -153
|
@@ -198,5 +198,84 @@ describe "Deprecation warnings" do
|
|
|
198
198
|
end
|
|
199
199
|
expect(output).not_to include("[DEPRECATION]")
|
|
200
200
|
end
|
|
201
|
+
|
|
202
|
+
it "warns when using separate path method" do
|
|
203
|
+
output = capture_stderr do
|
|
204
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
205
|
+
target :production do
|
|
206
|
+
ssh "user@host:22"
|
|
207
|
+
path "/app"
|
|
208
|
+
end
|
|
209
|
+
SOURCE
|
|
210
|
+
end
|
|
211
|
+
expect(output).to include("[DEPRECATION]")
|
|
212
|
+
expect(output).to include("Separate `path` call is deprecated")
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
it "warns when using separate gateway method" do
|
|
216
|
+
output = capture_stderr do
|
|
217
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
218
|
+
target :production do
|
|
219
|
+
ssh "user@host:22"
|
|
220
|
+
gateway "bastion@host:22"
|
|
221
|
+
end
|
|
222
|
+
SOURCE
|
|
223
|
+
end
|
|
224
|
+
expect(output).to include("[DEPRECATION]")
|
|
225
|
+
expect(output).to include("Separate `gateway` call is deprecated")
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
it "warns when using separate ssh_key method" do
|
|
229
|
+
output = capture_stderr do
|
|
230
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
231
|
+
target :production do
|
|
232
|
+
ssh "user@host:22"
|
|
233
|
+
ssh_key "~/.ssh/id_rsa"
|
|
234
|
+
end
|
|
235
|
+
SOURCE
|
|
236
|
+
end
|
|
237
|
+
expect(output).to include("[DEPRECATION]")
|
|
238
|
+
expect(output).to include("Separate `ssh_key` call is deprecated")
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
it "warns when using separate env method" do
|
|
242
|
+
output = capture_stderr do
|
|
243
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
244
|
+
target :production do
|
|
245
|
+
ssh "user@host:22"
|
|
246
|
+
env "RAILS_ENV=production"
|
|
247
|
+
end
|
|
248
|
+
SOURCE
|
|
249
|
+
end
|
|
250
|
+
expect(output).to include("[DEPRECATION]")
|
|
251
|
+
expect(output).to include("Separate `env` call is deprecated")
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
it "warns when using strategy method" do
|
|
255
|
+
output = capture_stderr do
|
|
256
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
257
|
+
target :production do
|
|
258
|
+
ssh "user@host:22"
|
|
259
|
+
strategy :ssh
|
|
260
|
+
end
|
|
261
|
+
SOURCE
|
|
262
|
+
end
|
|
263
|
+
expect(output).to include("[DEPRECATION]")
|
|
264
|
+
expect(output).to include("`strategy` is deprecated")
|
|
265
|
+
end
|
|
266
|
+
|
|
267
|
+
it "warns when using option method" do
|
|
268
|
+
output = capture_stderr do
|
|
269
|
+
Bard::Config.new("test", source: <<~SOURCE)
|
|
270
|
+
target :production do
|
|
271
|
+
ssh "user@host:22"
|
|
272
|
+
strategy :ssh
|
|
273
|
+
option :verbose, true
|
|
274
|
+
end
|
|
275
|
+
SOURCE
|
|
276
|
+
end
|
|
277
|
+
expect(output).to include("[DEPRECATION]")
|
|
278
|
+
expect(output).to include("`option` is deprecated")
|
|
279
|
+
end
|
|
201
280
|
end
|
|
202
281
|
end
|
data/spec/bard/target_spec.rb
CHANGED
|
@@ -72,7 +72,7 @@ describe Bard::Target do
|
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
it "auto-configures ping URL from hostname" do
|
|
75
|
-
expect(target.ping_urls).to include("example.com")
|
|
75
|
+
expect(target.ping_urls).to include("https://example.com")
|
|
76
76
|
end
|
|
77
77
|
end
|
|
78
78
|
|
|
@@ -137,7 +137,7 @@ describe Bard::Target do
|
|
|
137
137
|
|
|
138
138
|
it "executes command on remote server" do
|
|
139
139
|
expect(Bard::Command).to receive(:run!)
|
|
140
|
-
.with("ls", on: target
|
|
140
|
+
.with("ls", on: target, home: false, verbose: false, quiet: false)
|
|
141
141
|
target.run!("ls")
|
|
142
142
|
end
|
|
143
143
|
end
|
|
@@ -151,7 +151,7 @@ describe Bard::Target do
|
|
|
151
151
|
|
|
152
152
|
it "executes command on remote server without raising" do
|
|
153
153
|
expect(Bard::Command).to receive(:run)
|
|
154
|
-
.with("ls", on: target
|
|
154
|
+
.with("ls", on: target, home: false, verbose: false, quiet: false)
|
|
155
155
|
target.run("ls")
|
|
156
156
|
end
|
|
157
157
|
end
|
|
@@ -165,7 +165,7 @@ describe Bard::Target do
|
|
|
165
165
|
|
|
166
166
|
it "replaces process with remote command" do
|
|
167
167
|
expect(Bard::Command).to receive(:exec!)
|
|
168
|
-
.with("ls", on: target
|
|
168
|
+
.with("ls", on: target, home: false)
|
|
169
169
|
target.exec!("ls")
|
|
170
170
|
end
|
|
171
171
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bard
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.8.0.
|
|
4
|
+
version: 1.8.0.beta2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Micah Geisel
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-12-
|
|
10
|
+
date: 2025-12-31 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: thor
|
|
@@ -171,21 +171,13 @@ files:
|
|
|
171
171
|
- bard.gemspec
|
|
172
172
|
- bin/bard
|
|
173
173
|
- bin/setup
|
|
174
|
-
-
|
|
175
|
-
- features/
|
|
176
|
-
- features/
|
|
177
|
-
- features/
|
|
178
|
-
- features/
|
|
179
|
-
- features/step_definitions/check_steps.rb
|
|
180
|
-
- features/step_definitions/git_steps.rb
|
|
181
|
-
- features/step_definitions/global_steps.rb
|
|
182
|
-
- features/step_definitions/podman_steps.rb
|
|
183
|
-
- features/step_definitions/rails_steps.rb
|
|
184
|
-
- features/step_definitions/submodule_steps.rb
|
|
174
|
+
- cucumber.yml
|
|
175
|
+
- features/data.feature
|
|
176
|
+
- features/deploy.feature
|
|
177
|
+
- features/run.feature
|
|
178
|
+
- features/step_definitions/bard_steps.rb
|
|
185
179
|
- features/support/env.rb
|
|
186
|
-
- features/support/
|
|
187
|
-
- features/support/io.rb
|
|
188
|
-
- features/support/podman.rb
|
|
180
|
+
- features/support/test_server.rb
|
|
189
181
|
- install_files/.github/dependabot.yml
|
|
190
182
|
- install_files/.github/workflows/cache-ci.yml
|
|
191
183
|
- install_files/.github/workflows/ci.yml
|
|
@@ -331,21 +323,12 @@ rubygems_version: 3.6.2
|
|
|
331
323
|
specification_version: 4
|
|
332
324
|
summary: CLI to automate common development tasks.
|
|
333
325
|
test_files:
|
|
334
|
-
- features/
|
|
335
|
-
- features/
|
|
336
|
-
- features/
|
|
337
|
-
- features/
|
|
338
|
-
- features/podman_testcontainers.feature
|
|
339
|
-
- features/step_definitions/check_steps.rb
|
|
340
|
-
- features/step_definitions/git_steps.rb
|
|
341
|
-
- features/step_definitions/global_steps.rb
|
|
342
|
-
- features/step_definitions/podman_steps.rb
|
|
343
|
-
- features/step_definitions/rails_steps.rb
|
|
344
|
-
- features/step_definitions/submodule_steps.rb
|
|
326
|
+
- features/data.feature
|
|
327
|
+
- features/deploy.feature
|
|
328
|
+
- features/run.feature
|
|
329
|
+
- features/step_definitions/bard_steps.rb
|
|
345
330
|
- features/support/env.rb
|
|
346
|
-
- features/support/
|
|
347
|
-
- features/support/io.rb
|
|
348
|
-
- features/support/podman.rb
|
|
331
|
+
- features/support/test_server.rb
|
|
349
332
|
- spec/acceptance/.gitignore
|
|
350
333
|
- spec/acceptance/docker/Dockerfile
|
|
351
334
|
- spec/acceptance/docker/test_key
|
data/features/bard_check.feature
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
Feature: Bard can check its environment for missing dependencies and potential problems
|
|
2
|
-
|
|
3
|
-
Scenario: Bard check returns its version
|
|
4
|
-
When I type "bard check -v"
|
|
5
|
-
Then I should see the current version of bard
|
|
6
|
-
And I should see the current version of git
|
|
7
|
-
And I should see the current version of rubygems
|
|
8
|
-
And I should see the current version of ruby
|
|
9
|
-
|
|
10
|
-
Scenario: Bard check examines a local project for problems
|
|
11
|
-
Given a shared rails project
|
|
12
|
-
When I type "bard check"
|
|
13
|
-
Then I should see "No problems"
|
|
14
|
-
|
|
15
|
-
Scenario: Bard check detects missing database
|
|
16
|
-
Given a shared rails project
|
|
17
|
-
And the database is missing
|
|
18
|
-
When I type "bard check"
|
|
19
|
-
Then I should see the fatal error "missing database"
|
|
20
|
-
|
|
21
|
-
Scenario: Bard check detects pending migrations
|
|
22
|
-
Given a shared rails project
|
|
23
|
-
And a commit with a new migration
|
|
24
|
-
When I type "bard check"
|
|
25
|
-
Then I should see the fatal error "pending migrations"
|
|
26
|
-
|
|
27
|
-
Scenario: Bard check detects missing config/database.yml
|
|
28
|
-
Given a shared rails project
|
|
29
|
-
And "config/database.yml" is missing
|
|
30
|
-
When I type "bard check"
|
|
31
|
-
Then I should see the fatal error "missing config/database.yml"
|
|
32
|
-
|
|
33
|
-
Scenario: Bard check detects missing submodules
|
|
34
|
-
Given a shared rails project
|
|
35
|
-
And a submodule
|
|
36
|
-
And the submodule is missing
|
|
37
|
-
When I type "bard check"
|
|
38
|
-
Then I should see the fatal error "missing submodule"
|
|
39
|
-
|
|
40
|
-
Scenario: Bard check detects submodules with detached heads
|
|
41
|
-
Given a shared rails project
|
|
42
|
-
And a submodule
|
|
43
|
-
And the submodule has a detached head
|
|
44
|
-
When I type "bard check"
|
|
45
|
-
Then I should see the fatal error "submodule has a detached head"
|
|
46
|
-
|
|
47
|
-
Scenario: Bard check detects missing gems
|
|
48
|
-
Given a shared rails project
|
|
49
|
-
And the test gem is not installed
|
|
50
|
-
And a commit that adds the test gem as a dependency
|
|
51
|
-
When I type "bard check"
|
|
52
|
-
Then I should see the fatal error "missing gems"
|
|
53
|
-
|
|
54
|
-
Scenario: Bard check detects master branch checked out
|
|
55
|
-
Given a shared rails project
|
|
56
|
-
And I am on the "master" branch
|
|
57
|
-
When I type "bard check"
|
|
58
|
-
Then I should see the fatal error "master branch"
|
|
59
|
-
|
|
60
|
-
Scenario: Bard check detects missing integration branch
|
|
61
|
-
Given a shared rails project
|
|
62
|
-
And there is no integration branch
|
|
63
|
-
When I type "bard check"
|
|
64
|
-
Then I should see the fatal error "missing integration branch"
|
|
65
|
-
|
|
66
|
-
Scenario: Bard check detects non-tracking integration branch
|
|
67
|
-
Given a shared rails project
|
|
68
|
-
And the integration branch isnt tracking origin/integration
|
|
69
|
-
When I type "bard check"
|
|
70
|
-
Then I should see the fatal error "tracking"
|
|
71
|
-
|
|
72
|
-
Scenario: Bard check detects gitignored Capfile
|
|
73
|
-
Given a shared rails project
|
|
74
|
-
And the ".gitignore" file includes "Capfile"
|
|
75
|
-
When I type "bard check"
|
|
76
|
-
Then I should see the fatal error "Capfile should not be gitignored"
|
|
77
|
-
|
|
78
|
-
Scenario: Bard check detects gitignored config/deploy.rb
|
|
79
|
-
Given a shared rails project
|
|
80
|
-
And the ".gitignore" file includes "config/deploy.rb"
|
|
81
|
-
When I type "bard check"
|
|
82
|
-
Then I should see the fatal error "config/deploy.rb should not be gitignored"
|
|
83
|
-
|
|
84
|
-
Scenario: Bard check detects missing bard rake tasks
|
|
85
|
-
Given a shared rails project
|
|
86
|
-
And the "Rakefile" file does not include "bard/rake"
|
|
87
|
-
When I type "bard check"
|
|
88
|
-
Then I should see the fatal error "missing bard rake tasks"
|
|
89
|
-
|
|
90
|
-
Scenario: Bard check detects missing bard cap tasks
|
|
91
|
-
Given a shared rails project
|
|
92
|
-
And the "Capfile" file does not include "bard/capistrano"
|
|
93
|
-
When I type "bard check"
|
|
94
|
-
Then I should see the fatal error "missing bard capistrano tasks"
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Feature: Bard deploy should fold the integration branch into master and perform a deploy
|
|
2
|
-
|
|
3
|
-
Scenario: Bard deploy detects non-fast-forward merge from integration to master
|
|
4
|
-
Given a shared rails project
|
|
5
|
-
And on development_b, a commit on the "master" branch
|
|
6
|
-
And on development_b, I type "git push origin master"
|
|
7
|
-
And a commit
|
|
8
|
-
When I type "bard deploy"
|
|
9
|
-
Then I should see the fatal error "Rebase"
|
|
10
|
-
|
|
11
|
-
Scenario: Bard deploy works
|
|
12
|
-
Given a shared rails project
|
|
13
|
-
And a commit
|
|
14
|
-
When I type "bard deploy"
|
|
15
|
-
Then the "master" branch should match the "integration" branch
|
|
16
|
-
And the "integration" branch should match the "origin/integration" branch
|
|
17
|
-
And the "origin/master" branch should match the "origin/integration" branch
|
|
18
|
-
|
data/features/bard_pull.feature
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
Feature: bard pull
|
|
2
|
-
Background:
|
|
3
|
-
Given a shared rails project
|
|
4
|
-
|
|
5
|
-
Scenario: Pulling down the latest changes from the remote integration branch
|
|
6
|
-
Given on development_b, a commit
|
|
7
|
-
And on development_b, I type "bard push"
|
|
8
|
-
When I type "bard pull"
|
|
9
|
-
Then the "integration" branch should match the "development_b:integration" branch
|
|
10
|
-
|
|
11
|
-
Scenario: Pulling down when the latest changes include a submodule addition
|
|
12
|
-
Given on development_b, a commit with a new submodule
|
|
13
|
-
And on development_b, I type "bard push"
|
|
14
|
-
When I type "bard pull"
|
|
15
|
-
Then the "integration" branch should match the "development_b:integration" branch
|
|
16
|
-
And there should be one new submodule
|
|
17
|
-
And the submodule branch should match the submodule origin branch
|
|
18
|
-
And the submodule working directory should be clean
|
|
19
|
-
|
|
20
|
-
Scenario: Pulling down when the latest changes include a submodule update
|
|
21
|
-
Given a submodule
|
|
22
|
-
And on development_b, a commit with a submodule update
|
|
23
|
-
And on development_b, I type "bard push"
|
|
24
|
-
When I type "bard pull"
|
|
25
|
-
Then the "integration" branch should match the "development_b:integration" branch
|
|
26
|
-
And the submodule branch should match the submodule origin branch
|
|
27
|
-
And the submodule working directory should be clean
|
|
28
|
-
|
|
29
|
-
Scenario: Pulling down when the latest changes include a submodule url change
|
|
30
|
-
Given a submodule
|
|
31
|
-
And on development_b, a commit with a submodule url change
|
|
32
|
-
And on development_b, I type "bard push"
|
|
33
|
-
When I type "bard pull"
|
|
34
|
-
Then the "integration" branch should match the "development_b:integration" branch
|
|
35
|
-
And the submodule url should be changed
|
|
36
|
-
And the submodule branch should match the submodule origin branch
|
|
37
|
-
And the submodule working directory should be clean
|
|
38
|
-
|
|
39
|
-
# TODO
|
|
40
|
-
#Scenario: Pulling down when the latest changes include a submodule deletion
|
|
41
|
-
# Given a submodule
|
|
42
|
-
# And on staging, a commit with a submodule deletion
|
|
43
|
-
# When I type "bard pull"
|
|
44
|
-
# Then the "integration" branch should match the "origin/integration" branch
|
|
45
|
-
# And the submodule should be deleted
|
|
46
|
-
|
|
47
|
-
Scenario: Pulling latest changes from the remote integration branch after committing locally
|
|
48
|
-
Given on development_b, a commit
|
|
49
|
-
And on development_b, I type "bard push"
|
|
50
|
-
And a commit
|
|
51
|
-
When I type "bard pull"
|
|
52
|
-
Then I should see the warning "Someone has pushed some changes"
|
|
53
|
-
And the "integration" branch should be a fast-forward from the "development_b:integration" branch
|
|
54
|
-
|
|
55
|
-
Scenario: Bard pull from a topic branch
|
|
56
|
-
Given on development_b, a commit on the "topic" branch
|
|
57
|
-
And on development_b, I am on the "topic" branch
|
|
58
|
-
And on development_b, I type "bard push"
|
|
59
|
-
And I am on the "topic" branch
|
|
60
|
-
When I type "bard pull"
|
|
61
|
-
Then the "topic" branch should match the "development_b:topic" branch
|
|
62
|
-
|
|
63
|
-
Scenario: Trying to bard pull when not in the project root
|
|
64
|
-
Given I am in a subdirectory
|
|
65
|
-
When I type "bard pull"
|
|
66
|
-
Then I should see the fatal error "root directory"
|
|
67
|
-
|
|
68
|
-
Scenario: Trying to bard pull with a dirty working directory
|
|
69
|
-
Given on development_b, a commit
|
|
70
|
-
And on development_b, I type "bard push"
|
|
71
|
-
And a dirty working directory
|
|
72
|
-
When I type "bard pull"
|
|
73
|
-
Then I should see the fatal error "You have uncommitted changes!"
|
|
74
|
-
And the "integration" branch should not match the "development_b:integration" branch
|
|
75
|
-
|
|
76
|
-
Scenario: Trying to bard pull when on the "master" branch
|
|
77
|
-
Given on development_b, a commit on the "master" branch
|
|
78
|
-
And on development_b, I am on the "master" branch
|
|
79
|
-
And on development_b, I type "git push origin master"
|
|
80
|
-
And I am on the "master" branch
|
|
81
|
-
When I type "bard pull"
|
|
82
|
-
Then I should see the fatal error "on the master branch"
|
|
83
|
-
And the "master" branch should not match the "development_b:master" branch
|
|
84
|
-
|
|
85
|
-
Scenario: Pulling in a change that includes a migration on a dev machine
|
|
86
|
-
Given on development_b, a commit with a new migration
|
|
87
|
-
And on development_b, I type "bard push"
|
|
88
|
-
And a development database
|
|
89
|
-
When I type "bard pull"
|
|
90
|
-
Then the development database should include that migration
|
|
91
|
-
|
|
92
|
-
Scenario: Pulling in a change that includes a migration on a dev and testing machine
|
|
93
|
-
Given on development_b, a commit with a new migration
|
|
94
|
-
And on development_b, I type "bard push"
|
|
95
|
-
And a development database
|
|
96
|
-
And a test database
|
|
97
|
-
When I type "bard pull"
|
|
98
|
-
Then the development database should include that migration
|
|
99
|
-
And the test database should include that migration
|
|
100
|
-
|
|
101
|
-
Scenario: Pulling in a change that includes a gem dependency change
|
|
102
|
-
Given the test gem is not installed
|
|
103
|
-
And on development_b, a commit that adds the test gem as a dependency
|
|
104
|
-
And on development_b, I type "bard push"
|
|
105
|
-
When I type "bard pull"
|
|
106
|
-
Then the test gem should be installed
|
|
107
|
-
|
|
108
|
-
Scenario: Pulling in a change should restart the rails server
|
|
109
|
-
Given on development_b, a commit
|
|
110
|
-
And on development_b, I type "bard push"
|
|
111
|
-
When I type "bard pull"
|
|
112
|
-
Then passenger should have been restarted
|
data/features/bard_push.feature
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
Feature: bard push
|
|
2
|
-
Background:
|
|
3
|
-
Given a shared rails project
|
|
4
|
-
|
|
5
|
-
Scenario: Uploading local changes onto the remote integration branch
|
|
6
|
-
Given a commit
|
|
7
|
-
When I type "bard push"
|
|
8
|
-
And on staging, I type "bard stage"
|
|
9
|
-
Then the "integration" branch should match the "staging:integration" branch
|
|
10
|
-
|
|
11
|
-
Scenario: Uploading local changes onto a remote topic branch
|
|
12
|
-
Given a commit on the "topic" branch
|
|
13
|
-
And I am on the "topic" branch
|
|
14
|
-
When I type "bard push"
|
|
15
|
-
Then the "topic" branch should match the "origin/topic" branch
|
|
16
|
-
|
|
17
|
-
Scenario: Pushing a change that includes a migration
|
|
18
|
-
Given on staging, a staging database
|
|
19
|
-
And a commit with a new migration
|
|
20
|
-
When I type "bard push"
|
|
21
|
-
And on staging, I type "bard stage"
|
|
22
|
-
Then on staging, the staging database should include that migration
|
|
23
|
-
|
|
24
|
-
Scenario: Pushing a change that includes a gem dependency change
|
|
25
|
-
Given the test gem is not installed
|
|
26
|
-
And a commit that adds the test gem as a dependency
|
|
27
|
-
When I type "bard push"
|
|
28
|
-
And on staging, I type "bard stage"
|
|
29
|
-
Then on staging, the test gem should be installed
|
|
30
|
-
|
|
31
|
-
Scenario: Pushing a change should advance the staging HEAD and restart the staging rails server
|
|
32
|
-
Given a commit
|
|
33
|
-
When I type "bard push"
|
|
34
|
-
And on staging, I type "bard stage"
|
|
35
|
-
And the "integration" branch should match the "staging:integration" branch
|
|
36
|
-
Then on staging, passenger should have been restarted
|
|
37
|
-
|
|
38
|
-
Scenario: Pushing a change that includes a submodule addition
|
|
39
|
-
Given a commit with a new submodule
|
|
40
|
-
When I type "bard push"
|
|
41
|
-
And on staging, I type "bard stage"
|
|
42
|
-
Then on staging, there should be one new submodule
|
|
43
|
-
And the submodule branch should match the submodule origin branch
|
|
44
|
-
And on staging, the submodule working directory should be clean
|
|
45
|
-
|
|
46
|
-
Scenario: Pushing a change that includes a submodule update
|
|
47
|
-
Given a submodule
|
|
48
|
-
And a commit with a submodule update
|
|
49
|
-
When I type "bard push"
|
|
50
|
-
And on staging, I type "bard stage"
|
|
51
|
-
Then the submodule branch should match the submodule origin branch
|
|
52
|
-
Then on staging, the submodule working directory should be clean
|
|
53
|
-
|
|
54
|
-
Scenario: Pushing a change that includes a submodule url change
|
|
55
|
-
Given a submodule
|
|
56
|
-
And a commit with a submodule url change
|
|
57
|
-
When I type "bard push"
|
|
58
|
-
And on staging, I type "bard stage"
|
|
59
|
-
Then on staging, the submodule url should be changed
|
|
60
|
-
And the submodule branch should match the submodule origin branch
|
|
61
|
-
Then on staging, the submodule working directory should be clean
|
|
62
|
-
|
|
63
|
-
# TODO
|
|
64
|
-
#Scenario: Pushing a change that includes a submodule deletion
|
|
65
|
-
# Given a submodule
|
|
66
|
-
# Given I have committed a set of changes that includes a submodule deletion
|
|
67
|
-
# When I type "bard push"
|
|
68
|
-
# And on staging, I type "bard stage"
|
|
69
|
-
# Then the remote submodule should be deleted
|
|
70
|
-
|
|
71
|
-
Scenario: Trying to bard push when not in the project root
|
|
72
|
-
Given I am in a subdirectory
|
|
73
|
-
When I type "bard push"
|
|
74
|
-
Then I should see the fatal error "root directory"
|
|
75
|
-
|
|
76
|
-
Scenario: Trying to bard push when not on the integration branch
|
|
77
|
-
Given a commit on the "master" branch
|
|
78
|
-
And I am on the "master" branch
|
|
79
|
-
When I type "bard push"
|
|
80
|
-
Then I should see the fatal error "on the master branch"
|
|
81
|
-
And the "master" branch should not match the "origin/master" branch
|
|
82
|
-
|
|
83
|
-
Scenario: Trying to bard push with a dirty working directory
|
|
84
|
-
Given a commit
|
|
85
|
-
And a dirty working directory
|
|
86
|
-
When I type "bard push"
|
|
87
|
-
Then I should see the fatal error "You have uncommitted changes!"
|
|
88
|
-
And the "integration" branch should not match the "origin/integration" branch
|
|
89
|
-
|
|
90
|
-
Scenario: Trying to bard push with a non-fast-foward changeset
|
|
91
|
-
Given a commit
|
|
92
|
-
And on development_b, a commit
|
|
93
|
-
And on development_b, I type "bard push"
|
|
94
|
-
When I type "bard push"
|
|
95
|
-
Then I should see the fatal error "Someone has pushed some changes"
|
|
96
|
-
And the "integration" branch should not match the "origin/integration" branch
|
|
97
|
-
|
|
98
|
-
Scenario: Trying to bard push with an uncommitted change to a submodule
|
|
99
|
-
Given a submodule
|
|
100
|
-
And a commit
|
|
101
|
-
And the submodule working directory is dirty
|
|
102
|
-
When I type "bard push"
|
|
103
|
-
Then I should see the fatal error "Micah"
|
|
104
|
-
And the "integration" branch should not match the "origin/integration" branch
|
|
105
|
-
|
|
106
|
-
Scenario: Trying to bard push with a committed but unpushed change to a submodule
|
|
107
|
-
Given a submodule
|
|
108
|
-
And a commit to the submodule
|
|
109
|
-
And a commit
|
|
110
|
-
When I type "bard push"
|
|
111
|
-
Then I should see the fatal error "Micah"
|
|
112
|
-
And the "integration" branch should not match the "origin/integration" branch
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
@podman
|
|
2
|
-
Feature: bard run against a podman TestContainers host
|
|
3
|
-
Background:
|
|
4
|
-
Given a podman testcontainer is ready for bard
|
|
5
|
-
|
|
6
|
-
Scenario: Running ls via bard run
|
|
7
|
-
Given a remote file "test-file.txt" exists in the test container
|
|
8
|
-
When I run bard "ls" against the test container
|
|
9
|
-
Then the bard command should succeed
|
|
10
|
-
And the bard output should include "test-file.txt"
|
|
11
|
-
|
|
12
|
-
Scenario: Running commands in isolated containers
|
|
13
|
-
Given a remote file "another-file.txt" containing "content" exists in the test container
|
|
14
|
-
When I run bard "cat another-file.txt" against the test container
|
|
15
|
-
Then the bard command should succeed
|
|
16
|
-
And the bard output should include "content"
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
Then /^I should see the current version of bard$/ do
|
|
2
|
-
version = File.read("#{ROOT}/VERSION").chomp
|
|
3
|
-
@stdout.should =~ /bard\s+\(#{Regexp.escape(version)}\)/
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
Then /^I should see the current version of git$/ do
|
|
7
|
-
version = `git --version`[/[0-9]+\.[0-9]+\.[0-9]+/]
|
|
8
|
-
@stdout.should =~ /git\s+\(#{Regexp.escape(version)}/
|
|
9
|
-
end
|
|
10
|
-
|
|
11
|
-
Then /^I should see the current version of rubygems$/ do
|
|
12
|
-
version = `gem --version`.chomp
|
|
13
|
-
@stdout.should =~ /rubygems\s+\(#{Regexp.escape(version)}\)/
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
Then /^I should see the current version of ruby$/ do
|
|
17
|
-
version = `ruby --version`[/[0-9]+\.[0-9]+\.[0-9]+/]
|
|
18
|
-
@stdout.should =~ /ruby\s+\(#{Regexp.escape(version)}\)/
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
Given /^"([^\"]*)" is missing$/ do |file|
|
|
22
|
-
type "rm #{file}"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
Given /^the database is missing$/ do
|
|
26
|
-
File.open "config/database.yml", "w" do |f|
|
|
27
|
-
f.puts <<-DB
|
|
28
|
-
development:
|
|
29
|
-
adapter: mysql
|
|
30
|
-
username: root
|
|
31
|
-
password:
|
|
32
|
-
database: bad_bad_bad
|
|
33
|
-
socket: /var/run/mysqld/mysqld.sock
|
|
34
|
-
DB
|
|
35
|
-
end
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
Given /^the submodule is missing$/ do
|
|
39
|
-
type "rm -rf submodule"
|
|
40
|
-
type "mkdir submodule"
|
|
41
|
-
end
|
|
42
|
-
|
|
43
|
-
Given /^the submodule has a detached head$/ do
|
|
44
|
-
Dir.chdir "submodule" do
|
|
45
|
-
type "git checkout `git rev-parse HEAD`"
|
|
46
|
-
end
|
|
47
|
-
end
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
Given /^I am on the "([^\"]+)" branch$/ do |branch|
|
|
2
|
-
if `git branch` =~ / #{branch}$/
|
|
3
|
-
type "git checkout #{branch}"
|
|
4
|
-
else
|
|
5
|
-
type "git checkout -b #{branch}"
|
|
6
|
-
end
|
|
7
|
-
end
|
|
8
|
-
|
|
9
|
-
Given /^there is no integration branch$/ do
|
|
10
|
-
type "git checkout master"
|
|
11
|
-
type "git branch -d integration"
|
|
12
|
-
end
|
|
13
|
-
|
|
14
|
-
Given /^the integration branch isnt tracking origin\/integration$/ do
|
|
15
|
-
type "git checkout master"
|
|
16
|
-
type "git branch -d integration"
|
|
17
|
-
type "git checkout -b integration"
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
Given /^a dirty working directory$/ do
|
|
21
|
-
File.open("dirty_file", "w") { |f| f.puts "dirty dirty" }
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
Given /^a commit$/ do
|
|
25
|
-
text = (rand * 100000000).round
|
|
26
|
-
type "echo '#{text}' > foobar_#{text}_file"
|
|
27
|
-
type "git add ."
|
|
28
|
-
type "git commit -am'test commit'"
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
Given /^a commit on the "([^\"]+)" branch$/ do |branch|
|
|
32
|
-
Given %(I am on the "#{branch}" branch)
|
|
33
|
-
text = (rand * 100000000).round
|
|
34
|
-
type "echo '#{text}' > #{branch}_#{text}_file"
|
|
35
|
-
type "git add ."
|
|
36
|
-
type "git commit -am 'testing #{branch} change'"
|
|
37
|
-
type "git checkout integration"
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
Then /^the directory should not be dirty$/ do
|
|
41
|
-
type("git status").should include "working directory clean"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
Then /^I should be on the "([^\"]*)" branch$/ do |branch|
|
|
45
|
-
@repo.head.name.should == branch
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
Then /^there should not be a "([^\"]*)" branch$/ do |branch_name|
|
|
49
|
-
@repo.branches.any? { |branch| branch.name == branch_name }
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
Then /^the "([^\"]*)" branch (should|should not) match the "([^\"]*)" branch$/ do |local_branch, which, remote_branch|
|
|
53
|
-
type "git fetch origin"
|
|
54
|
-
local_env, local_branch = local_branch.split(':') if local_branch.include? ':'
|
|
55
|
-
local_env ||= "development_a"
|
|
56
|
-
remote_env, remote_branch = remote_branch.split(':') if remote_branch.include? ':'
|
|
57
|
-
remote_env ||= "development_a"
|
|
58
|
-
local_sha = @repos[local_env].commits(local_branch).first.id
|
|
59
|
-
remote_sha = @repos[remote_env].commits(remote_branch).first.id
|
|
60
|
-
which = which.gsub(/ /, '_').to_sym
|
|
61
|
-
local_sha.send(which) == remote_sha
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
Then /^the "([^\"]*)" branch should be a fast\-forward from the "([^\"]*)" branch$/ do |local_branch, remote_branch|
|
|
65
|
-
local_env, local_branch = local_branch.split(':') if local_branch.include? ':'
|
|
66
|
-
local_env ||= "development_a"
|
|
67
|
-
remote_env, remote_branch = remote_branch.split(':') if remote_branch.include? ':'
|
|
68
|
-
remote_env ||= "development_a"
|
|
69
|
-
local_sha = @repos[local_env].commits(local_branch).first.id
|
|
70
|
-
remote_sha = @repos[remote_env].commits(remote_branch).first.id
|
|
71
|
-
common_ancestor = @repos[local_env].find_common_ancestor local_sha, remote_sha
|
|
72
|
-
common_ancestor.should == remote_sha
|
|
73
|
-
end
|