bard 1.9.6 → 2.0.0

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.
Files changed (157) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +2 -2
  3. data/CLAUDE.md +1 -1
  4. data/PLUGINS.md +31 -46
  5. data/bard.gemspec +2 -1
  6. data/features/ci.feature +1 -0
  7. data/features/data.feature +1 -0
  8. data/features/deploy.feature +1 -0
  9. data/features/deploy_git_workflow.feature +1 -0
  10. data/features/run.feature +1 -0
  11. data/features/step_definitions/bard_steps.rb +1 -0
  12. data/features/support/test_server.rb +3 -3
  13. data/lib/bard/cli.rb +9 -28
  14. data/lib/bard/command.rb +9 -88
  15. data/lib/bard/config.rb +38 -177
  16. data/lib/bard/copy.rb +28 -82
  17. data/lib/bard/plugins/data.rb +56 -0
  18. data/lib/bard/{ci → plugins/deploy/ci}/github_actions.rb +2 -2
  19. data/lib/bard/{ci → plugins/deploy/ci}/jenkins.rb +1 -1
  20. data/lib/bard/{ci → plugins/deploy/ci}/local.rb +1 -1
  21. data/lib/bard/{ci → plugins/deploy/ci}/runner.rb +3 -3
  22. data/lib/bard/{ci.rb → plugins/deploy/ci.rb} +1 -1
  23. data/lib/bard/plugins/deploy/ssh_strategy.rb +27 -0
  24. data/lib/bard/{deploy_strategy.rb → plugins/deploy/strategy.rb} +1 -4
  25. data/lib/bard/plugins/deploy.rb +240 -0
  26. data/lib/bard/{git.rb → plugins/git.rb} +6 -3
  27. data/lib/bard/{github.rb → plugins/github.rb} +2 -2
  28. data/lib/bard/{deploy_strategy/github_pages.rb → plugins/github_pages/strategy.rb} +3 -4
  29. data/lib/bard/plugins/github_pages.rb +11 -15
  30. data/lib/bard/plugins/hurt.rb +12 -4
  31. data/{install_files → lib/bard/plugins/install}/.github/dependabot.yml +2 -1
  32. data/{install_files → lib/bard/plugins/install}/.github/workflows/cache-ci.yml +1 -1
  33. data/{install_files → lib/bard/plugins/install}/.github/workflows/ci.yml +2 -2
  34. data/lib/bard/plugins/install.rb +7 -3
  35. data/lib/bard/plugins/open.rb +20 -0
  36. data/lib/bard/{ping.rb → plugins/ping/check.rb} +4 -4
  37. data/lib/bard/plugins/ping/target_methods.rb +23 -0
  38. data/lib/bard/plugins/ping.rb +8 -4
  39. data/lib/bard/plugins/run.rb +19 -0
  40. data/lib/bard/plugins/setup.rb +54 -0
  41. data/lib/bard/plugins/ssh/connection.rb +75 -0
  42. data/lib/bard/plugins/ssh/copy.rb +95 -0
  43. data/lib/bard/{ssh_server.rb → plugins/ssh/server.rb} +10 -42
  44. data/lib/bard/plugins/ssh/target_methods.rb +20 -0
  45. data/lib/bard/plugins/ssh.rb +10 -0
  46. data/lib/bard/plugins/url/target_methods.rb +23 -0
  47. data/lib/bard/plugins/url.rb +1 -0
  48. data/lib/bard/plugins/vim.rb +5 -4
  49. data/lib/bard/retryable.rb +25 -0
  50. data/lib/bard/target.rb +21 -230
  51. data/lib/bard/version.rb +1 -1
  52. data/lib/bard.rb +1 -3
  53. data/spec/acceptance/docker/Dockerfile +1 -1
  54. data/spec/bard/capability_spec.rb +8 -50
  55. data/spec/bard/ci/github_actions_spec.rb +1 -1
  56. data/spec/bard/ci/jenkins_spec.rb +1 -1
  57. data/spec/bard/ci/runner_spec.rb +3 -3
  58. data/spec/bard/ci_spec.rb +1 -1
  59. data/spec/bard/cli/ci_spec.rb +4 -23
  60. data/spec/bard/cli/data_spec.rb +7 -26
  61. data/spec/bard/cli/deploy_spec.rb +43 -40
  62. data/spec/bard/cli/hurt_spec.rb +2 -8
  63. data/spec/bard/cli/install_spec.rb +4 -10
  64. data/spec/bard/cli/master_key_spec.rb +5 -19
  65. data/spec/bard/cli/open_spec.rb +17 -35
  66. data/spec/bard/cli/ping_spec.rb +10 -25
  67. data/spec/bard/cli/run_spec.rb +10 -23
  68. data/spec/bard/cli/setup_spec.rb +10 -27
  69. data/spec/bard/cli/ssh_spec.rb +10 -25
  70. data/spec/bard/cli/stage_spec.rb +17 -32
  71. data/spec/bard/cli/vim_spec.rb +5 -11
  72. data/spec/bard/command_spec.rb +1 -10
  73. data/spec/bard/config_spec.rb +68 -116
  74. data/spec/bard/copy_spec.rb +54 -18
  75. data/spec/bard/deploy_strategy/ssh_spec.rb +65 -7
  76. data/spec/bard/deploy_strategy_spec.rb +1 -1
  77. data/spec/bard/dynamic_dsl_spec.rb +18 -98
  78. data/spec/bard/git_spec.rb +9 -5
  79. data/spec/bard/github_spec.rb +1 -1
  80. data/spec/bard/ping_spec.rb +5 -5
  81. data/spec/bard/ssh_copy_spec.rb +44 -0
  82. data/spec/bard/ssh_server_spec.rb +1 -98
  83. data/spec/bard/target_spec.rb +61 -108
  84. metadata +50 -124
  85. data/lib/bard/ci/retryable.rb +0 -27
  86. data/lib/bard/cli/ci.rb +0 -73
  87. data/lib/bard/cli/command.rb +0 -26
  88. data/lib/bard/cli/data.rb +0 -45
  89. data/lib/bard/cli/deploy.rb +0 -116
  90. data/lib/bard/cli/hurt.rb +0 -15
  91. data/lib/bard/cli/install.rb +0 -11
  92. data/lib/bard/cli/master_key.rb +0 -17
  93. data/lib/bard/cli/new.rb +0 -101
  94. data/lib/bard/cli/new_rails_template.rb +0 -197
  95. data/lib/bard/cli/open.rb +0 -18
  96. data/lib/bard/cli/ping.rb +0 -12
  97. data/lib/bard/cli/provision.rb +0 -34
  98. data/lib/bard/cli/run.rb +0 -26
  99. data/lib/bard/cli/setup.rb +0 -56
  100. data/lib/bard/cli/ssh.rb +0 -14
  101. data/lib/bard/cli/stage.rb +0 -35
  102. data/lib/bard/cli/vim.rb +0 -8
  103. data/lib/bard/default_config.rb +0 -35
  104. data/lib/bard/deploy_strategy/ssh.rb +0 -19
  105. data/lib/bard/deprecation.rb +0 -19
  106. data/lib/bard/github_pages.rb +0 -134
  107. data/lib/bard/plugin.rb +0 -100
  108. data/lib/bard/plugins/backup.rb +0 -19
  109. data/lib/bard/plugins/jenkins.rb +0 -6
  110. data/lib/bard/plugins/new.rb +0 -5
  111. data/lib/bard/plugins/provision.rb +0 -5
  112. data/lib/bard/provision/app.rb +0 -10
  113. data/lib/bard/provision/apt.rb +0 -16
  114. data/lib/bard/provision/authorizedkeys.rb +0 -25
  115. data/lib/bard/provision/data.rb +0 -27
  116. data/lib/bard/provision/deploy.rb +0 -10
  117. data/lib/bard/provision/http.rb +0 -16
  118. data/lib/bard/provision/logrotation.rb +0 -30
  119. data/lib/bard/provision/masterkey.rb +0 -18
  120. data/lib/bard/provision/mysql.rb +0 -22
  121. data/lib/bard/provision/passenger.rb +0 -37
  122. data/lib/bard/provision/repo.rb +0 -72
  123. data/lib/bard/provision/rvm.rb +0 -22
  124. data/lib/bard/provision/ssh.rb +0 -79
  125. data/lib/bard/provision/swapfile.rb +0 -23
  126. data/lib/bard/provision/user.rb +0 -42
  127. data/lib/bard/provision.rb +0 -16
  128. data/lib/bard/server.rb +0 -160
  129. data/spec/bard/cli/command_spec.rb +0 -50
  130. data/spec/bard/cli/new_spec.rb +0 -73
  131. data/spec/bard/cli/provision_spec.rb +0 -42
  132. data/spec/bard/deprecation_spec.rb +0 -281
  133. data/spec/bard/github_pages_spec.rb +0 -143
  134. data/spec/bard/plugin_spec.rb +0 -79
  135. data/spec/bard/provision/app_spec.rb +0 -33
  136. data/spec/bard/provision/apt_spec.rb +0 -39
  137. data/spec/bard/provision/authorizedkeys_spec.rb +0 -40
  138. data/spec/bard/provision/data_spec.rb +0 -54
  139. data/spec/bard/provision/deploy_spec.rb +0 -33
  140. data/spec/bard/provision/http_spec.rb +0 -57
  141. data/spec/bard/provision/logrotation_spec.rb +0 -34
  142. data/spec/bard/provision/masterkey_spec.rb +0 -63
  143. data/spec/bard/provision/mysql_spec.rb +0 -55
  144. data/spec/bard/provision/passenger_spec.rb +0 -81
  145. data/spec/bard/provision/repo_spec.rb +0 -208
  146. data/spec/bard/provision/rvm_spec.rb +0 -49
  147. data/spec/bard/provision/ssh_spec.rb +0 -242
  148. data/spec/bard/provision/swapfile_spec.rb +0 -33
  149. data/spec/bard/provision/user_spec.rb +0 -103
  150. data/spec/bard/provision_spec.rb +0 -28
  151. data/spec/bard/server_spec.rb +0 -127
  152. /data/lib/bard/{ci → plugins/deploy/ci}/state.rb +0 -0
  153. /data/{install_files → lib/bard/plugins/install}/apt_dependencies.rb +0 -0
  154. /data/{install_files → lib/bard/plugins/install}/ci +0 -0
  155. /data/{install_files → lib/bard/plugins/install}/setup +0 -0
  156. /data/{install_files → lib/bard/plugins/install}/specified_bundler.rb +0 -0
  157. /data/{install_files → lib/bard/plugins/install}/specified_ruby.rb +0 -0
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.9.6
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-03-07 00:00:00.000000000 Z
10
+ date: 2026-05-17 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: thor
@@ -38,21 +38,21 @@ dependencies:
38
38
  - !ruby/object:Gem::Version
39
39
  version: '0'
40
40
  - !ruby/object:Gem::Dependency
41
- name: term-ansicolor
41
+ name: rbnacl
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.3
46
+ version: '0'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: 1.0.3
53
+ version: '0'
54
54
  - !ruby/object:Gem::Dependency
55
- name: rbnacl
55
+ name: base64
56
56
  requirement: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - ">="
@@ -66,13 +66,13 @@ dependencies:
66
66
  - !ruby/object:Gem::Version
67
67
  version: '0'
68
68
  - !ruby/object:Gem::Dependency
69
- name: base64
69
+ name: rake
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: '0'
75
- type: :runtime
75
+ type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
@@ -80,7 +80,7 @@ dependencies:
80
80
  - !ruby/object:Gem::Version
81
81
  version: '0'
82
82
  - !ruby/object:Gem::Dependency
83
- name: rake
83
+ name: rspec
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
@@ -94,7 +94,7 @@ dependencies:
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  - !ruby/object:Gem::Dependency
97
- name: rspec
97
+ name: debug
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - ">="
@@ -108,7 +108,7 @@ dependencies:
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  - !ruby/object:Gem::Dependency
111
- name: debug
111
+ name: cucumber
112
112
  requirement: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
@@ -122,7 +122,7 @@ dependencies:
122
122
  - !ruby/object:Gem::Version
123
123
  version: '0'
124
124
  - !ruby/object:Gem::Dependency
125
- name: cucumber
125
+ name: testcontainers
126
126
  requirement: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - ">="
@@ -136,7 +136,7 @@ dependencies:
136
136
  - !ruby/object:Gem::Version
137
137
  version: '0'
138
138
  - !ruby/object:Gem::Dependency
139
- name: testcontainers
139
+ name: ostruct
140
140
  requirement: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - ">="
@@ -182,81 +182,51 @@ files:
182
182
  - features/support/bard-coverage
183
183
  - features/support/env.rb
184
184
  - features/support/test_server.rb
185
- - install_files/.github/dependabot.yml
186
- - install_files/.github/workflows/cache-ci.yml
187
- - install_files/.github/workflows/ci.yml
188
- - install_files/apt_dependencies.rb
189
- - install_files/ci
190
- - install_files/setup
191
- - install_files/specified_bundler.rb
192
- - install_files/specified_ruby.rb
193
185
  - lib/bard.rb
194
- - lib/bard/ci.rb
195
- - lib/bard/ci/github_actions.rb
196
- - lib/bard/ci/jenkins.rb
197
- - lib/bard/ci/local.rb
198
- - lib/bard/ci/retryable.rb
199
- - lib/bard/ci/runner.rb
200
- - lib/bard/ci/state.rb
201
186
  - lib/bard/cli.rb
202
- - lib/bard/cli/ci.rb
203
- - lib/bard/cli/command.rb
204
- - lib/bard/cli/data.rb
205
- - lib/bard/cli/deploy.rb
206
- - lib/bard/cli/hurt.rb
207
- - lib/bard/cli/install.rb
208
- - lib/bard/cli/master_key.rb
209
- - lib/bard/cli/new.rb
210
- - lib/bard/cli/new_rails_template.rb
211
- - lib/bard/cli/open.rb
212
- - lib/bard/cli/ping.rb
213
- - lib/bard/cli/provision.rb
214
- - lib/bard/cli/run.rb
215
- - lib/bard/cli/setup.rb
216
- - lib/bard/cli/ssh.rb
217
- - lib/bard/cli/stage.rb
218
- - lib/bard/cli/vim.rb
219
187
  - lib/bard/command.rb
220
188
  - lib/bard/config.rb
221
189
  - lib/bard/copy.rb
222
- - lib/bard/default_config.rb
223
- - lib/bard/deploy_strategy.rb
224
- - lib/bard/deploy_strategy/github_pages.rb
225
- - lib/bard/deploy_strategy/ssh.rb
226
- - lib/bard/deprecation.rb
227
- - lib/bard/git.rb
228
- - lib/bard/github.rb
229
- - lib/bard/github_pages.rb
230
- - lib/bard/ping.rb
231
- - lib/bard/plugin.rb
232
- - lib/bard/plugins/backup.rb
190
+ - lib/bard/plugins/data.rb
191
+ - lib/bard/plugins/deploy.rb
192
+ - lib/bard/plugins/deploy/ci.rb
193
+ - lib/bard/plugins/deploy/ci/github_actions.rb
194
+ - lib/bard/plugins/deploy/ci/jenkins.rb
195
+ - lib/bard/plugins/deploy/ci/local.rb
196
+ - lib/bard/plugins/deploy/ci/runner.rb
197
+ - lib/bard/plugins/deploy/ci/state.rb
198
+ - lib/bard/plugins/deploy/ssh_strategy.rb
199
+ - lib/bard/plugins/deploy/strategy.rb
200
+ - lib/bard/plugins/git.rb
201
+ - lib/bard/plugins/github.rb
233
202
  - lib/bard/plugins/github_pages.rb
203
+ - lib/bard/plugins/github_pages/strategy.rb
234
204
  - lib/bard/plugins/hurt.rb
235
205
  - lib/bard/plugins/install.rb
236
- - lib/bard/plugins/jenkins.rb
237
- - lib/bard/plugins/new.rb
206
+ - lib/bard/plugins/install/.github/dependabot.yml
207
+ - lib/bard/plugins/install/.github/workflows/cache-ci.yml
208
+ - lib/bard/plugins/install/.github/workflows/ci.yml
209
+ - lib/bard/plugins/install/apt_dependencies.rb
210
+ - lib/bard/plugins/install/ci
211
+ - lib/bard/plugins/install/setup
212
+ - lib/bard/plugins/install/specified_bundler.rb
213
+ - lib/bard/plugins/install/specified_ruby.rb
214
+ - lib/bard/plugins/open.rb
238
215
  - lib/bard/plugins/ping.rb
239
- - lib/bard/plugins/provision.rb
216
+ - lib/bard/plugins/ping/check.rb
217
+ - lib/bard/plugins/ping/target_methods.rb
218
+ - lib/bard/plugins/run.rb
219
+ - lib/bard/plugins/setup.rb
220
+ - lib/bard/plugins/ssh.rb
221
+ - lib/bard/plugins/ssh/connection.rb
222
+ - lib/bard/plugins/ssh/copy.rb
223
+ - lib/bard/plugins/ssh/server.rb
224
+ - lib/bard/plugins/ssh/target_methods.rb
225
+ - lib/bard/plugins/url.rb
226
+ - lib/bard/plugins/url/target_methods.rb
240
227
  - lib/bard/plugins/vim.rb
241
- - lib/bard/provision.rb
242
- - lib/bard/provision/app.rb
243
- - lib/bard/provision/apt.rb
244
- - lib/bard/provision/authorizedkeys.rb
245
- - lib/bard/provision/data.rb
246
- - lib/bard/provision/deploy.rb
247
- - lib/bard/provision/http.rb
248
- - lib/bard/provision/logrotation.rb
249
- - lib/bard/provision/masterkey.rb
250
- - lib/bard/provision/mysql.rb
251
- - lib/bard/provision/passenger.rb
252
- - lib/bard/provision/repo.rb
253
- - lib/bard/provision/rvm.rb
254
- - lib/bard/provision/ssh.rb
255
- - lib/bard/provision/swapfile.rb
256
- - lib/bard/provision/user.rb
228
+ - lib/bard/retryable.rb
257
229
  - lib/bard/secrets.rb
258
- - lib/bard/server.rb
259
- - lib/bard/ssh_server.rb
260
230
  - lib/bard/target.rb
261
231
  - lib/bard/version.rb
262
232
  - spec/acceptance/.gitignore
@@ -269,16 +239,13 @@ files:
269
239
  - spec/bard/ci/runner_spec.rb
270
240
  - spec/bard/ci_spec.rb
271
241
  - spec/bard/cli/ci_spec.rb
272
- - spec/bard/cli/command_spec.rb
273
242
  - spec/bard/cli/data_spec.rb
274
243
  - spec/bard/cli/deploy_spec.rb
275
244
  - spec/bard/cli/hurt_spec.rb
276
245
  - spec/bard/cli/install_spec.rb
277
246
  - spec/bard/cli/master_key_spec.rb
278
- - spec/bard/cli/new_spec.rb
279
247
  - spec/bard/cli/open_spec.rb
280
248
  - spec/bard/cli/ping_spec.rb
281
- - spec/bard/cli/provision_spec.rb
282
249
  - spec/bard/cli/run_spec.rb
283
250
  - spec/bard/cli/setup_spec.rb
284
251
  - spec/bard/cli/ssh_spec.rb
@@ -289,30 +256,11 @@ files:
289
256
  - spec/bard/copy_spec.rb
290
257
  - spec/bard/deploy_strategy/ssh_spec.rb
291
258
  - spec/bard/deploy_strategy_spec.rb
292
- - spec/bard/deprecation_spec.rb
293
259
  - spec/bard/dynamic_dsl_spec.rb
294
260
  - spec/bard/git_spec.rb
295
- - spec/bard/github_pages_spec.rb
296
261
  - spec/bard/github_spec.rb
297
262
  - spec/bard/ping_spec.rb
298
- - spec/bard/plugin_spec.rb
299
- - spec/bard/provision/app_spec.rb
300
- - spec/bard/provision/apt_spec.rb
301
- - spec/bard/provision/authorizedkeys_spec.rb
302
- - spec/bard/provision/data_spec.rb
303
- - spec/bard/provision/deploy_spec.rb
304
- - spec/bard/provision/http_spec.rb
305
- - spec/bard/provision/logrotation_spec.rb
306
- - spec/bard/provision/masterkey_spec.rb
307
- - spec/bard/provision/mysql_spec.rb
308
- - spec/bard/provision/passenger_spec.rb
309
- - spec/bard/provision/repo_spec.rb
310
- - spec/bard/provision/rvm_spec.rb
311
- - spec/bard/provision/ssh_spec.rb
312
- - spec/bard/provision/swapfile_spec.rb
313
- - spec/bard/provision/user_spec.rb
314
- - spec/bard/provision_spec.rb
315
- - spec/bard/server_spec.rb
263
+ - spec/bard/ssh_copy_spec.rb
316
264
  - spec/bard/ssh_server_spec.rb
317
265
  - spec/bard/target_spec.rb
318
266
  - spec/bard_spec.rb
@@ -330,7 +278,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
278
  requirements:
331
279
  - - ">="
332
280
  - !ruby/object:Gem::Version
333
- version: '0'
281
+ version: '3.3'
334
282
  required_rubygems_version: !ruby/object:Gem::Requirement
335
283
  requirements:
336
284
  - - ">="
@@ -360,16 +308,13 @@ test_files:
360
308
  - spec/bard/ci/runner_spec.rb
361
309
  - spec/bard/ci_spec.rb
362
310
  - spec/bard/cli/ci_spec.rb
363
- - spec/bard/cli/command_spec.rb
364
311
  - spec/bard/cli/data_spec.rb
365
312
  - spec/bard/cli/deploy_spec.rb
366
313
  - spec/bard/cli/hurt_spec.rb
367
314
  - spec/bard/cli/install_spec.rb
368
315
  - spec/bard/cli/master_key_spec.rb
369
- - spec/bard/cli/new_spec.rb
370
316
  - spec/bard/cli/open_spec.rb
371
317
  - spec/bard/cli/ping_spec.rb
372
- - spec/bard/cli/provision_spec.rb
373
318
  - spec/bard/cli/run_spec.rb
374
319
  - spec/bard/cli/setup_spec.rb
375
320
  - spec/bard/cli/ssh_spec.rb
@@ -380,30 +325,11 @@ test_files:
380
325
  - spec/bard/copy_spec.rb
381
326
  - spec/bard/deploy_strategy/ssh_spec.rb
382
327
  - spec/bard/deploy_strategy_spec.rb
383
- - spec/bard/deprecation_spec.rb
384
328
  - spec/bard/dynamic_dsl_spec.rb
385
329
  - spec/bard/git_spec.rb
386
- - spec/bard/github_pages_spec.rb
387
330
  - spec/bard/github_spec.rb
388
331
  - spec/bard/ping_spec.rb
389
- - spec/bard/plugin_spec.rb
390
- - spec/bard/provision/app_spec.rb
391
- - spec/bard/provision/apt_spec.rb
392
- - spec/bard/provision/authorizedkeys_spec.rb
393
- - spec/bard/provision/data_spec.rb
394
- - spec/bard/provision/deploy_spec.rb
395
- - spec/bard/provision/http_spec.rb
396
- - spec/bard/provision/logrotation_spec.rb
397
- - spec/bard/provision/masterkey_spec.rb
398
- - spec/bard/provision/mysql_spec.rb
399
- - spec/bard/provision/passenger_spec.rb
400
- - spec/bard/provision/repo_spec.rb
401
- - spec/bard/provision/rvm_spec.rb
402
- - spec/bard/provision/ssh_spec.rb
403
- - spec/bard/provision/swapfile_spec.rb
404
- - spec/bard/provision/user_spec.rb
405
- - spec/bard/provision_spec.rb
406
- - spec/bard/server_spec.rb
332
+ - spec/bard/ssh_copy_spec.rb
407
333
  - spec/bard/ssh_server_spec.rb
408
334
  - spec/bard/target_spec.rb
409
335
  - spec/bard_spec.rb
@@ -1,27 +0,0 @@
1
- module Bard
2
- class CI
3
- module Retryable
4
- MAX_RETRIES = 5
5
- INITIAL_DELAY = 1
6
-
7
- def retry_with_backoff(max_retries: MAX_RETRIES)
8
- retries = 0
9
- delay = INITIAL_DELAY
10
-
11
- begin
12
- yield
13
- rescue => e
14
- if retries < max_retries
15
- retries += 1
16
- puts " Network error (attempt #{retries}/#{max_retries}): #{e.message}. Retrying in #{delay}s..."
17
- sleep(delay)
18
- delay *= 2
19
- retry
20
- else
21
- raise "Network error after #{max_retries} attempts: #{e.message}"
22
- end
23
- end
24
- end
25
- end
26
- end
27
- end
data/lib/bard/cli/ci.rb DELETED
@@ -1,73 +0,0 @@
1
- require "bard/ci"
2
- require "bard/git"
3
-
4
- module Bard::CLI::CI
5
- def self.included mod
6
- mod.class_eval do
7
-
8
- option :"local-ci", type: :boolean
9
- option :ci, type: :string
10
- option :status, type: :boolean
11
- option :resume, type: :boolean
12
- desc "ci [branch=HEAD]", "runs ci against BRANCH"
13
- def ci branch=Bard::Git.current_branch
14
- runner_name = if options["local-ci"]
15
- :local
16
- elsif options["ci"]
17
- options["ci"].to_sym
18
- else
19
- config.ci
20
- end
21
- ci = Bard::CI.new(project_name, branch, runner_name: runner_name)
22
- unless ci.exists?
23
- puts red("No CI found for #{project_name}!")
24
- puts "Re-run with --skip-ci to bypass CI, if you absolutely must, and know what you're doing."
25
- exit 1
26
- end
27
-
28
- return puts ci.status if options["status"]
29
-
30
- if options["resume"]
31
- puts "Continuous integration: resuming build..."
32
- success = ci.resume do |elapsed_time, last_time|
33
- if last_time
34
- percentage = (elapsed_time.to_f / last_time.to_f * 100).to_i
35
- output = " Estimated completion: #{percentage}%"
36
- else
37
- output = " No estimated completion time. Elapsed time: #{elapsed_time} sec"
38
- end
39
- print "\x08" * output.length
40
- print output
41
- $stdout.flush
42
- end
43
- else
44
- puts "Continuous integration: starting build on #{branch}..."
45
-
46
- success = ci.run do |elapsed_time, last_time|
47
- if last_time
48
- percentage = (elapsed_time.to_f / last_time.to_f * 100).to_i
49
- output = " Estimated completion: #{percentage}%"
50
- else
51
- output = " No estimated completion time. Elapsed time: #{elapsed_time} sec"
52
- end
53
- print "\x08" * output.length
54
- print output
55
- $stdout.flush
56
- end
57
- end
58
-
59
- if success
60
- puts
61
- puts "Continuous integration: success!"
62
- else
63
- puts
64
- puts ci.console
65
- puts red("Automated tests failed!")
66
- exit 1
67
- end
68
- end
69
-
70
- end
71
- end
72
- end
73
-
@@ -1,26 +0,0 @@
1
- require "delegate"
2
-
3
- class Bard::CLI::Command < SimpleDelegator
4
- def self.desc command, description
5
- @command = command
6
- @method = command.split(" ").first.to_sym
7
- @description = description
8
- end
9
-
10
- def self.option *args, **kwargs
11
- @option_args = args
12
- @option_kwargs = kwargs
13
- end
14
-
15
- def self.setup cli
16
- cli.desc @command, @description
17
- cli.option *@option_args, **@option_kwargs if @option_args || @option_kwargs
18
- # put in local variables so next block can capture it
19
- command_class = self
20
- method = @method
21
- cli.define_method method do |*args|
22
- command = command_class.new(self)
23
- command.send method, *args
24
- end
25
- end
26
- end
data/lib/bard/cli/data.rb DELETED
@@ -1,45 +0,0 @@
1
- require "bard/command"
2
-
3
- module Bard::CLI::Data
4
- def self.included mod
5
- mod.class_eval do
6
-
7
- desc "data --from=production --to=local", "copy database and assets from from to to"
8
- option :from, default: "production"
9
- option :to, default: "local"
10
- def data
11
- from = config[options[:from]]
12
- to = config[options[:to]]
13
-
14
- if to.key == :production
15
- url = to.ping.first
16
- puts yellow "WARNING: You are about to push data to production, overwriting everything that is there!"
17
- answer = ask("If you really want to do this, please type in the full HTTPS url of the production server:")
18
- if answer != url
19
- puts red("!!! ") + "Failed! We expected #{url}. Is this really where you want to overwrite all the data?"
20
- exit 1
21
- end
22
- end
23
-
24
- puts "Dumping #{from.key} database to file..."
25
- from.run! "bin/rake db:dump"
26
-
27
- puts "Transfering file from #{from.key} to #{to.key}..."
28
- from.copy_file "db/data.sql.gz", to: to, verbose: true
29
-
30
- puts "Loading file into #{to.key} database..."
31
- to.run! "bin/rake db:load"
32
-
33
- config.data.each do |path|
34
- puts "Synchronizing files in #{path}..."
35
- from.copy_dir path, to: to, verbose: true
36
- end
37
- rescue Bard::Command::Error => e
38
- puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
39
- exit 1
40
- end
41
-
42
- end
43
- end
44
- end
45
-
@@ -1,116 +0,0 @@
1
- require "bard/git"
2
- require "bard/command"
3
- require "bard/github_pages"
4
- require "tmpdir"
5
-
6
- module Bard::CLI::Deploy
7
- def self.included mod
8
- mod.class_eval do
9
-
10
- option :"skip-ci", type: :boolean
11
- option :"local-ci", type: :boolean
12
- option :ci, type: :string
13
- option :clone, type: :boolean
14
- option :target, type: :string, default: "production"
15
- desc "deploy [BRANCH]", "deploys branch to target (default: current branch to production)"
16
- def deploy branch=nil
17
- branch ||= Bard::Git.current_branch
18
-
19
- if branch == "master"
20
- if !Bard::Git.up_to_date_with_remote?(branch)
21
- run! "git push origin #{branch}:#{branch}"
22
- end
23
- invoke :ci, [branch], options.slice("local-ci", "ci") unless options["skip-ci"] || config.ci == false
24
-
25
- else
26
- run! "git fetch origin"
27
- if Bard::Git.current_branch != "master"
28
- run! "git fetch origin master:master"
29
- end
30
-
31
- unless Bard::Git.fast_forward_merge?("origin/master", branch)
32
- puts "The master branch has advanced. Attempting rebase..."
33
- if branch == Bard::Git.current_branch
34
- run! "git rebase origin/master"
35
- else
36
- tmpdir = Dir.mktmpdir("bard-rebase")
37
- begin
38
- run! "git worktree add --detach #{tmpdir} #{branch}"
39
- success = Dir.chdir(tmpdir) { system("git rebase origin/master") }
40
- rebased_sha = Dir.chdir(tmpdir) { `git rev-parse HEAD`.strip } if success
41
- run! "git worktree remove #{tmpdir} --force"
42
- unless success
43
- puts red("!!! ") + "Rebase failed due to conflicts."
44
- puts "Please rebase #{branch} manually:"
45
- puts " git checkout #{branch}"
46
- puts " git rebase origin/master"
47
- exit 1
48
- end
49
- run! "git branch -f #{branch} #{rebased_sha}"
50
- ensure
51
- FileUtils.rm_rf(tmpdir) if Dir.exist?(tmpdir)
52
- end
53
- end
54
- end
55
-
56
- run! "git push -f origin #{branch}:#{branch}"
57
-
58
- invoke :ci, [branch], options.slice("local-ci", "ci") unless options["skip-ci"] || config.ci == false
59
-
60
- run! "git push origin #{branch}:master"
61
- if Bard::Git.current_branch != "master"
62
- run! "git fetch origin master:master"
63
- else
64
- run! "git pull origin master"
65
- end
66
- end
67
-
68
- if `git remote` =~ /\bgithub\b/
69
- run! "git push github"
70
- end
71
-
72
- to = options[:target].to_sym
73
-
74
- if options[:clone]
75
- config[to].run! "git clone git@github.com:botandrosedesign/#{project_name} #{config[to].path}", home: true
76
- invoke :master_key, [], from: "local", to: to
77
- config[to].run! "bin/setup && bard setup"
78
- else
79
- # Use deployment strategy for v2.0 Targets, or fallback for v1.x Servers
80
- target = config[to]
81
- if target.respond_to?(:deploy_strategy) && target.deploy_strategy
82
- strategy = target.deploy_strategy_instance
83
- strategy.deploy
84
- elsif target.respond_to?(:github_pages) && target.github_pages
85
- # Old v1.x github_pages support
86
- require "bard/github_pages"
87
- Bard::GithubPages.new(self).deploy(target)
88
- else
89
- # Default SSH deployment
90
- target.run! "git pull origin master && bin/setup"
91
- end
92
- end
93
-
94
- puts green("Deploy Succeeded")
95
-
96
- if branch != "master"
97
- puts "Deleting branch: #{branch}"
98
- run! "git push --delete origin #{branch}"
99
-
100
- if branch == Bard::Git.current_branch
101
- run! "git checkout master"
102
- end
103
-
104
- run! "git branch -D #{branch}"
105
- end
106
-
107
- ping to
108
- rescue Bard::Command::Error => e
109
- puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
110
- exit 1
111
- end
112
-
113
- end
114
- end
115
- end
116
-
data/lib/bard/cli/hurt.rb DELETED
@@ -1,15 +0,0 @@
1
- require "bard/cli/command"
2
-
3
- class Bard::CLI::Hurt < Bard::CLI::Command
4
- desc "hurt <command>", "reruns a command until it fails"
5
- def hurt *args
6
- (1..).each do |count|
7
- puts "Running attempt #{count}"
8
- system *args
9
- unless $?.success?
10
- puts "Ran #{count-1} times before failing"
11
- break
12
- end
13
- end
14
- end
15
- end
@@ -1,11 +0,0 @@
1
- require "bard/cli/command"
2
-
3
- class Bard::CLI::Install < Bard::CLI::Command
4
- desc "install", "copies bin/setup and bin/ci scripts into current project."
5
- def install
6
- install_files_path = File.expand_path(File.join(__dir__, "../../../install_files"))
7
-
8
- system "cp -R #{install_files_path}/* bin/"
9
- system "cp -R #{install_files_path}/.github ./"
10
- end
11
- end
@@ -1,17 +0,0 @@
1
- module Bard::CLI::MasterKey
2
- def self.included mod
3
- mod.class_eval do
4
-
5
- desc "master_key --from=production --to=local", "copy master key from from to to"
6
- option :from, default: "production"
7
- option :to, default: "local"
8
- def master_key
9
- from = config[options[:from]]
10
- to = config[options[:to]]
11
- from.copy_file "config/master.key", to:
12
- end
13
-
14
- end
15
- end
16
- end
17
-