boxci 0.0.30 → 0.0.31

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: a475fe47696c8556909205cd4298df0c1daff83f
4
- data.tar.gz: c13165f012d2e9baeace5c45c4fc6ff8d4432df5
3
+ metadata.gz: 961796b04b8beab12bf98867cd6d0fa1a370c18c
4
+ data.tar.gz: 56c6d1acaddbc9fe4ba1282147254aa0ab2ebcc9
5
5
  SHA512:
6
- metadata.gz: d95af11773c6c3c0f56a663d976b8b708e62f17fcf31f408ddc6058e9274aaa3031e6a7bcdbcf614eaa85a2f6fb0372518e5afd54bb177b982bb47d53efc37fb
7
- data.tar.gz: a3ed46d45eb0bfa6f2d6d1bad7716611bd5bc3d520bd893f23174d2395a4c74d0449f2b026ceda0544058a0af0edc192bf65bba88d9b7914d76046efd2bc5b65
6
+ metadata.gz: fb2739530a44a7e99c8744b12443a3f5462427c58ce47dfb52e91f2b19c738f959ffd2787c05940a8aa501967de9ecc249a77f53a74914efee38f1ad4edc7c3c
7
+ data.tar.gz: 84a558ec5653a00f1c95d0c580498fc32aa42d359a5c0916ce44a87adba07e2d9b5b3faf451d2710a3c21414d16af638679ecb0a05e6e2f690b79bdd64894179
data/.coveralls.yml ADDED
@@ -0,0 +1 @@
1
+ repo_token: fvHQttEYW81Y4vsXIifjgdoW0wjmHA2Ks
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
data/.travis.yml ADDED
@@ -0,0 +1,9 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.2"
4
+ - "1.9.3"
5
+ - "2.0.0"
6
+ - "2.1.0"
7
+ - "2.1.1"
8
+ # uncomment this line if your project needs to run something other than `rake`:
9
+ # script: bundle exec rspec spec
data/CHANGELOG.md CHANGED
@@ -6,6 +6,17 @@ versions as well as provide a rough history.
6
6
 
7
7
  #### Next Release
8
8
 
9
+ - Fix issue #31 so that it auto installs vagrant plugins without prompting the
10
+ user. This will allow it to work in non-interactive environments like other
11
+ CI systems (Bamboo, etc.)
12
+ - Fix issue #30 where exceptions were being swallowed and forcing an exit
13
+ status 0 instead of displaying the exception and exiting non-zero.
14
+ - Added exporting of `BOXCI_TEST_RESULT` with the value being the exit code of
15
+ the bulid. This allows it to be inspected in the `after_failure`,
16
+ `after_success`, or `after_script` commands.
17
+ - Made `after_success`, `after_failure`, and `after_script` no longer affect
18
+ the `boxci test` exit code.
19
+
9
20
  #### v0.0.30
10
21
 
11
22
  - Renamed project from `shanty` to `boxci`
data/Gemfile CHANGED
@@ -2,3 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in shanty.gemspec
4
4
  gemspec
5
+
6
+ group :test do
7
+ gem 'coveralls', :require => false
8
+ end
data/README.md CHANGED
@@ -1,9 +1,15 @@
1
1
  # boxci: standardizing virtual development & ci environments
2
2
 
3
+ [![Build Status](https://travis-ci.org/reachlocal/boxci.svg?branch=master)](https://travis-ci.org/reachlocal/boxci)
4
+ [![Version](https://img.shields.io/gem/v/boxci.svg)](https://rubygems.org/gems/boxci)
5
+ [![Code Climate](https://img.shields.io/codeclimate/github/reachlocal/boxci.svg)](https://codeclimate.com/github/reachlocal/boxci)
6
+ [![Code Coverage](http://img.shields.io/coveralls/reachlocal/boxci.svg)](https://coveralls.io/r/reachlocal/boxci)
7
+ [![Dependency Status](https://gemnasium.com/reachlocal/boxci.svg)](https://gemnasium.com/reachlocal/boxci)
8
+
3
9
  Boxci makes creating a virtualized development & continuous integration
4
10
  environments as easy as possible.
5
11
 
6
- It does this by focusing on implementing standards around the use of
12
+ It does this by focusing on implementing standards around the use of
7
13
  [Vagrant](http://www.vagrantup.com/) for managing your development
8
14
  and continuous integration environment. This means that it helps you
9
15
  configure and setup [Vagrant](http://www.vagrantup.com/), generate a well
@@ -34,7 +40,7 @@ To *boxcify* your project you need to run the `boxci init <language>` command.
34
40
  This command will create an initial `.boxci.yml` config for you in the current
35
41
  working directory. Therefore, you should run this command from the root of
36
42
  your project. It will also handle creating your user level `boxci`
37
- configurations in the `~/.boxci` direcotry. An example of this can be seen as
43
+ configurations in the `~/.boxci` directory. An example of this can be seen as
38
44
  follows:
39
45
 
40
46
  $ boxci init ruby
@@ -46,7 +52,7 @@ following is an example:
46
52
 
47
53
  $ boxci init -p openstack ruby
48
54
 
49
- This will go through and setup the proper directory stucture and create the
55
+ This will go through and setup the proper directory structure and create the
50
56
  config files just as before. However, when it identifies conflicts with the
51
57
  existing files it will prompt you and ask you if you want to overwrite, diff
52
58
  the files, not overwrite, etc.
data/Rakefile CHANGED
@@ -1,4 +1,7 @@
1
1
  require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
2
5
 
3
6
  # Add a simple console for debugging.
4
7
  #
@@ -10,4 +13,6 @@ task :console do
10
13
  require 'shanty'
11
14
  ARGV.clear
12
15
  IRB.start
13
- end
16
+ end
17
+
18
+ task :default => :spec
data/boxci.gemspec CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ["cyphactor@gmail.com", "brimil01@gmail.com", "russcloak@gmail.cm"]
11
11
  spec.summary = %q{Tool simplifying Vagrant based development & continuous integration environments.}
12
12
  spec.description = %q{Boxci is focused on defining standards and building tooling around using Vagrant for development & continuous integration environments to make using them as easy as possible.}
13
- spec.homepage = "http://github.com/reachlocal/boxci"
13
+ spec.homepage = "http://boxci.io"
14
14
  spec.license = "MIT"
15
15
 
16
16
  spec.files = `git ls-files -z`.split("\x0")
@@ -2,8 +2,8 @@ module Boxci
2
2
  module Providers
3
3
  class Aws < ::Boxci::Provider
4
4
  PLUGIN = {
5
- name: "vagrant-aws",
6
- dummy_box_url: "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
5
+ :name => "vagrant-aws",
6
+ :dummy_box_url => "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
7
7
  }
8
8
 
9
9
  no_commands do
@@ -2,8 +2,8 @@ module Boxci
2
2
  module Providers
3
3
  class Openstack < ::Boxci::Provider
4
4
  PLUGIN = {
5
- name: "vagrant-openstack-plugin",
6
- dummy_box_url: "https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box"
5
+ :name => "vagrant-openstack-plugin",
6
+ :dummy_box_url => "https://github.com/cloudbau/vagrant-openstack-plugin/raw/master/dummy.box"
7
7
  }
8
8
 
9
9
  no_commands do
@@ -7,7 +7,7 @@ module Boxci
7
7
  def generate_script
8
8
  snippets = []
9
9
  snippets << %q{#!/bin/bash --login}
10
- snippets << %q{test_runner_exit_status=0}
10
+ snippets << %q{BOXCI_TEST_RESULT=0}
11
11
  snippets << <<SNIPPET
12
12
  PROJECT_DIR="/vagrant/project"
13
13
  mkdir $PROJECT_DIR
@@ -28,18 +28,20 @@ SNIPPET
28
28
 
29
29
  snippets << generate_short_circuiting_hook_script('before_script')
30
30
  snippets << generate_script_hook_script
31
+ snippets << %q{export BOXCI_TEST_RESULT=$BOXCI_TEST_RESULT}
31
32
  snippets << generate_after_success_and_failure_hook_script
32
- snippets << generate_continuing_hook_script('after_script')
33
+ snippets << generate_continue_and_ignore_hook_script('after_script')
33
34
  end
34
35
  else
35
36
  snippets << short_circuit_on_step_failure('after_permutation_switch', @language.after_permutation_switch)
36
37
 
37
38
  snippets << generate_short_circuiting_hook_script('before_script')
38
39
  snippets << generate_script_hook_script
40
+ snippets << %q{export BOXCI_TEST_RESULT=$BOXCI_TEST_RESULT}
39
41
  snippets << generate_after_success_and_failure_hook_script
40
- snippets << generate_continuing_hook_script('after_script')
42
+ snippets << generate_continue_and_ignore_hook_script('after_script')
41
43
  end
42
- snippets << %{exit $test_runner_exit_status}
44
+ snippets << %{exit $BOXCI_TEST_RESULT}
43
45
  return snippets.join("\n")
44
46
  end
45
47
 
@@ -47,12 +49,12 @@ SNIPPET
47
49
 
48
50
  def generate_after_success_and_failure_hook_script
49
51
  <<SNIPPET
50
- if [ $test_runner_exit_status -eq 0 ]; then
52
+ if [ $BOXCI_TEST_RESULT -eq 0 ]; then
51
53
  :
52
- #{generate_continuing_hook_script('after_success')}
54
+ #{generate_continue_and_ignore_hook_script('after_success')}
53
55
  else
54
56
  :
55
- #{generate_continuing_hook_script('after_failure')}
57
+ #{generate_continue_and_ignore_hook_script('after_failure')}
56
58
  fi
57
59
  SNIPPET
58
60
  end
@@ -69,11 +71,11 @@ SNIPPET
69
71
  end
70
72
  end
71
73
 
72
- def generate_continuing_hook_script(hook_name)
74
+ def generate_continue_and_ignore_hook_script(hook_name)
73
75
  if !Boxci.project_config.send(hook_name.to_sym).empty?
74
76
  snippets = []
75
77
  Boxci.project_config.send(hook_name.to_sym).each do |step|
76
- snippets << continue_on_step_failure(hook_name, step)
78
+ snippets << continue_and_ignore_on_step_failure(hook_name, step)
77
79
  end
78
80
  return snippets.join("\n")
79
81
  else
@@ -121,8 +123,26 @@ step_exit_code=0
121
123
  #{step}
122
124
  step_exit_code=$?
123
125
  if [ $step_exit_code -ne 0 ]; then
124
- echo "Warning: script step '#{step}' exited with non-zero exit code ($step_exit_code)."
125
- test_runner_exit_status=1
126
+ echo "Warning: #{hook_name} step '#{step}' exited with non-zero exit code ($step_exit_code)."
127
+ BOXCI_TEST_RESULT=1
128
+ fi
129
+ # End of '#{hook_name}' step '#{step}'
130
+ SNIPPET
131
+ else
132
+ %Q(# Placeholder where '#{hook_name}' would go if it was set.)
133
+ end
134
+ end
135
+
136
+ def continue_and_ignore_on_step_failure(hook_name, step)
137
+ if step && !step.empty?
138
+ <<SNIPPET
139
+ # Beginning of '#{hook_name}' step '#{step}'
140
+ echo "Running '#{hook_name}' step '#{step}'"
141
+ step_exit_code=0
142
+ #{step}
143
+ step_exit_code=$?
144
+ if [ $step_exit_code -ne 0 ]; then
145
+ echo "Warning: #{hook_name} step '#{step}' exited with non-zero exit code ($step_exit_code)."
126
146
  fi
127
147
  # End of '#{hook_name}' step '#{step}'
128
148
  SNIPPET
data/lib/boxci/tester.rb CHANGED
@@ -7,10 +7,6 @@ module Boxci
7
7
  include Thor::Base
8
8
  include Thor::Actions
9
9
 
10
- def self.exit_on_failure?
11
- true
12
- end
13
-
14
10
  source_root(File.dirname(__FILE__))
15
11
 
16
12
  def test(options)
@@ -57,42 +53,37 @@ module Boxci
57
53
  # verify.
58
54
  Signal.trap('SIGPIPE', 'SIG_IGN')
59
55
 
60
- @tester_exit_code = 0
61
- # depencency_checker = Boxci::DependencyChecker.new
62
- # depencency_checker.verify_all
63
- initial_config(options)
64
-
65
- create_project_folder
66
- create_project_archive
67
- write_vagrant_file
68
- write_test_runner
69
- if @provider_object.requires_plugin?
70
- install_vagrant_plugin
71
- add_provider_box
72
- end
73
- spin_up_box
74
- setup_ssh_config
75
- install_puppet_on_box
76
- provision_box
77
- create_artifact_directory
78
- upload_test_runner
79
- run_tests
80
- download_artifacts
81
- say "Finished!", :green
82
- rescue Errno::EPIPE => e
83
- File.open('/tmp/boxci.log', 'a+') do |f|
84
- f.write("test() method swallowed Errno::EPIPE exception\n")
85
- end
86
- rescue => e
87
- File.open('/tmp/boxci.log', 'a+') do |f|
88
- f.write("test() method caught exception")
89
- f.write("#{e.class}\n")
90
- f.write("#{e.message}\n")
91
- f.write("#{e.backtrace.join("\n")}\n")
56
+ begin
57
+ @tester_exit_code = 0
58
+ # depencency_checker = Boxci::DependencyChecker.new
59
+ # depencency_checker.verify_all
60
+ initial_config(options)
61
+
62
+ create_project_folder
63
+ create_project_archive
64
+ write_vagrant_file
65
+ write_test_runner
66
+ if @provider_object.requires_plugin?
67
+ install_vagrant_plugin
68
+ add_provider_box
69
+ end
70
+ spin_up_box
71
+ setup_ssh_config
72
+ install_puppet_on_box
73
+ provision_box
74
+ create_artifact_directory
75
+ upload_test_runner
76
+ run_tests
77
+ download_artifacts
78
+ say "Finished!", :green
79
+ rescue Errno::EPIPE => e
80
+ File.open('/tmp/boxci.log', 'a+') do |f|
81
+ f.write("test() method swallowed Errno::EPIPE exception\n")
82
+ end
83
+ ensure
84
+ cleanup
92
85
  end
93
- raise e
94
- ensure
95
- cleanup
86
+
96
87
  exit @tester_exit_code
97
88
  end
98
89
 
@@ -149,10 +140,7 @@ module Boxci
149
140
  if !system("vagrant plugin list | grep -q #{plugin}")
150
141
  # if vagrant plugin is missing
151
142
  say "You are missing the Vagrant plugin for #{provider}", :yellow
152
- # ask user if it's ok to install for them
153
- if yes?("Would you like to install it now?")
154
- run "vagrant plugin install #{plugin}", :verbose => verbose?
155
- end
143
+ run "vagrant plugin install #{plugin}", :verbose => verbose?
156
144
  else # if vagrant plugin is found
157
145
  say "Provider plugin #{plugin} found", :green
158
146
  end
data/lib/boxci/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Boxci
2
- VERSION = "0.0.30"
2
+ VERSION = "0.0.31"
3
3
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,6 @@
1
+ require 'coveralls'
2
+ Coveralls.wear!
3
+
1
4
  $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/../lib')
2
5
 
3
6
  require 'boxci'
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.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew De Ponte
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2014-03-21 00:00:00.000000000 Z
13
+ date: 2014-03-25 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: thor
@@ -108,8 +108,11 @@ executables:
108
108
  extensions: []
109
109
  extra_rdoc_files: []
110
110
  files:
111
+ - ".coveralls.yml"
111
112
  - ".gitignore"
113
+ - ".rspec"
112
114
  - ".ruby-version"
115
+ - ".travis.yml"
113
116
  - CHANGELOG.md
114
117
  - Gemfile
115
118
  - LICENSE.txt
@@ -169,7 +172,7 @@ files:
169
172
  - spec/lib/boxci/tester_spec.rb
170
173
  - spec/lib/boxci_spec.rb
171
174
  - spec/spec_helper.rb
172
- homepage: http://github.com/reachlocal/boxci
175
+ homepage: http://boxci.io
173
176
  licenses:
174
177
  - MIT
175
178
  metadata: {}