boxci 0.0.36 → 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 84e661cf01c31229dc620f079e0aa25f6b326896
4
- data.tar.gz: 7825e3a9b747d14ae42f4022535fb11e3e80d02c
3
+ metadata.gz: 5041f190911bcff97ac407b11a23db3e1a111c55
4
+ data.tar.gz: 8f520eedb1cf219b07f150277f4b94285c3b4edf
5
5
  SHA512:
6
- metadata.gz: 82e80eb6e40c69376e38c12d8341015804bb14332da029a12affaca3d1cbac50f32c456876fd1752765143b4eac2aaa36dbdf1a6481f2c8b4ea37c33c4edbcef
7
- data.tar.gz: 028da3757df04c794693b799b85eb08489addeb09b5a1e022146993ad24cbb48545358cb6815a001ac7f00d5baadfe9759f7371c2659a29566853cd8cbe27140
6
+ metadata.gz: bec88ff45d7655b91f6b640f99c83caaac6cc1f913778f95d70d56c2cdab289baad78c6594282212b34a462955c447d1de5e337211343f3cfa9fd66f90348c89
7
+ data.tar.gz: b020392c1548ed7bcaf59f2595eae0c1167197608d3f4dad8bdd287b99ac20e5c6d672426c0963a53f4ab8eb4ce8177b453a028990b56263c75d47f3d3c0b661
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ versions as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ #### v0.0.37
10
+
11
+ - Re-enable cleanup
12
+ - Modified command success detection to rasie Boxci::CommandFailed error on
13
+ failure so that it triggers cleanup and short-circuit.
14
+
9
15
  #### v0.0.36
10
16
 
11
17
  - Fixed command success detection so it actually works properly.
data/lib/boxci/tester.rb CHANGED
@@ -26,7 +26,7 @@ module Boxci
26
26
  File.open('/tmp/boxci.log', 'a+') { |f| f.write("Got SIGTERM, going to cleanup...\n") }
27
27
 
28
28
  begin
29
- # cleanup
29
+ cleanup
30
30
  rescue Errno::EPIPE => e
31
31
  File.open('/tmp/boxci.log', 'a+') { |f| f.write("SIGTERM handler swallowed Errno::EPIPE exception\n") }
32
32
  rescue => e
@@ -44,7 +44,7 @@ module Boxci
44
44
  end
45
45
 
46
46
  Signal.trap('SIGINT') do
47
- # cleanup
47
+ cleanup
48
48
  exit 255
49
49
  end
50
50
 
@@ -67,14 +67,8 @@ module Boxci
67
67
  install_vagrant_plugin
68
68
  add_provider_box
69
69
  end
70
- if !spin_up_box
71
- say "ERROR: Failed to spin up box", :red
72
- exit 1
73
- end
74
- if !setup_ssh_config
75
- say "ERROR: Failed to setup ssh config", :red
76
- exit 1
77
- end
70
+ spin_up_box
71
+ setup_ssh_config
78
72
  install_puppet_on_box
79
73
  provision_box
80
74
  create_artifact_directory
@@ -87,7 +81,7 @@ module Boxci
87
81
  f.write("test() method swallowed Errno::EPIPE exception\n")
88
82
  end
89
83
  ensure
90
- # cleanup
84
+ cleanup
91
85
  end
92
86
 
93
87
  exit @tester_exit_code
@@ -172,9 +166,13 @@ module Boxci
172
166
  def spin_up_box
173
167
  inside @project_workspace_folder do
174
168
  if verbose?
175
- return run "vagrant up --no-provision --provider #{provider}", :verbose => verbose?
169
+ if !run "vagrant up --no-provision --provider #{provider}", :verbose => verbose?
170
+ raise Boxci::CommandFailed, "Failed to successfully run vagrant up --no-provision --provider #{provider}"
171
+ end
176
172
  else
177
- return run "vagrant up --no-provision --provider #{provider}"
173
+ if !run "vagrant up --no-provision --provider #{provider}"
174
+ raise Boxci::CommandFailed, "Failed to successfully run vagrant up --no-provision --provider #{provider}"
175
+ end
178
176
  end
179
177
  end
180
178
  end
@@ -182,9 +180,13 @@ module Boxci
182
180
  def setup_ssh_config
183
181
  inside @project_workspace_folder do
184
182
  if verbose?
185
- return run "vagrant ssh-config > ssh-config.local", :verbose => verbose?
183
+ if !run "vagrant ssh-config > ssh-config.local", :verbose => verbose?
184
+ raise Boxci::CommandFailed, "Failed to successfully run vagrant ssh-config > ssh-config.local"
185
+ end
186
186
  else
187
- return run "vagrant ssh-config > ssh-config.local"
187
+ if !run "vagrant ssh-config > ssh-config.local"
188
+ raise Boxci::CommandFailed, "Failed to successfully run vagrant ssh-config > ssh-config.local"
189
+ end
188
190
  end
189
191
  end
190
192
  end
data/lib/boxci/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Boxci
2
- VERSION = "0.0.36"
2
+ VERSION = "0.0.37"
3
3
  end
data/lib/boxci.rb CHANGED
@@ -23,6 +23,7 @@ require 'boxci/test_runner'
23
23
  module Boxci
24
24
  class MissingDependency < StandardError; end
25
25
  class PureVirtualMethod < StandardError; end
26
+ class CommandFailed < StandardError; end
26
27
 
27
28
  def self.project_config
28
29
  if @project_config
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxci
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.37
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte