Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,31 @@ PATH
remote: bosh-stemcell
specs:
bosh-stemcell (0.0.0)
rake
rspec
rspec-its

GEM
remote: https://rubygems.org/
specs:
diff-lcs (1.6.2)
rake (13.3.1)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-its (2.0.0)
rspec-core (>= 3.13.0)
rspec-expectations (>= 3.13.0)
rspec-mocks (3.13.8)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)

PLATFORMS
ruby
Expand Down
9 changes: 6 additions & 3 deletions bosh-stemcell/bosh-stemcell.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
spec.require_paths = %w[lib]

# TODO: separate stemcell specs from gem specs
spec.add_dependency "rake"
spec.add_dependency "rspec"
spec.add_dependency "rspec-its"

# used only in gem's own specs
spec.add_development_dependency "fakefs"
spec.add_development_dependency "rake"
spec.add_development_dependency "rspec"
spec.add_development_dependency "rspec-its"
spec.add_development_dependency "standard"
spec.add_development_dependency "timecop"
end
2 changes: 0 additions & 2 deletions bosh-stemcell/lib/bosh/stemcell/build_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def prepare_build
def os_image_rspec_command
[
"cd #{STEMCELL_SPECS_DIR};",
"bundle install;",
"OS_IMAGE=#{os_image_tarball_path}",
"bundle exec rspec -fd",
"spec/os_image/#{operating_system_spec_name}_spec.rb"
Expand All @@ -51,7 +50,6 @@ def os_image_rspec_command
def stemcell_rspec_command
cmd = [
"cd #{STEMCELL_SPECS_DIR};",
"bundle install;",
"STEMCELL_IMAGE=#{image_file_path}",
"STEMCELL_WORKDIR=#{work_path}",
"STEMCELL_INFRASTRUCTURE=#{infrastructure.name}",
Expand Down
3 changes: 1 addition & 2 deletions bosh-stemcell/spec/bosh/stemcell/build_environment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require "bosh/stemcell/infrastructure"
require "bosh/stemcell/operating_system"
require "bosh/stemcell/definition"
require "fakefs/spec_helpers"

module Bosh::Stemcell
describe BuildEnvironment do
Expand Down Expand Up @@ -185,7 +186,6 @@ module Bosh::Stemcell
it "returns the correct command" do
expected_rspec_command = [
"cd #{stemcell_specs_dir};",
"bundle install;",
"OS_IMAGE=/some/os_image.tgz",
"bundle exec rspec -fd",
"spec/os_image/#{operating_system.name}_spec.rb"
Expand All @@ -204,7 +204,6 @@ module Bosh::Stemcell
it "returns the correct command" do
expected_rspec_command = [
"cd #{stemcell_specs_dir};",
"bundle install;",
"STEMCELL_IMAGE=#{File.join(work_path, "fake-root-disk-image.raw")}",
"STEMCELL_WORKDIR=#{work_path}",
"STEMCELL_INFRASTRUCTURE=#{infrastructure.name}",
Expand Down
3 changes: 2 additions & 1 deletion bosh-stemcell/spec/bosh/stemcell/stage_runner_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require "spec_helper"
require "timecop"
require "bosh/stemcell/stage_runner"
require "timecop"
require "fakefs/spec_helpers"

module Bosh::Stemcell
describe StageRunner do
Expand Down
1 change: 0 additions & 1 deletion bosh-stemcell/spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
require "rspec"
require "rspec/its"
require "fakefs/spec_helpers"
require "support/shellout_type_assertions"
require "tmpdir"

Expand Down
12 changes: 5 additions & 7 deletions ci/tasks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,14 @@ sudo chmod u+s "$(which sudo)"
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
set -e

pushd "${REPO_ROOT}/bosh-stemcell"
bundle install
popd

cd "${REPO_ROOT}"
bundle install

if [[ -z "$OS_IMAGE" ]]; then
bundle exec rake stemcell:build[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$CANDIDATE_BUILD_NUMBER]
rm -f ./tmp/base_os_image.tgz
bundle exec rake stemcell:build[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$CANDIDATE_BUILD_NUMBER]
rm -f ./tmp/base_os_image.tgz
else
bundle exec rake stemcell:build_with_local_os_image[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$OS_IMAGE,$CANDIDATE_BUILD_NUMBER]
bundle exec rake stemcell:build_with_local_os_image[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$OS_IMAGE,$CANDIDATE_BUILD_NUMBER]
fi
SUDO

Expand Down
5 changes: 1 addition & 4 deletions ci/tasks/os-images/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,8 @@ sudo chmod u+s "$(which sudo)"
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
set -e

pushd "${REPO_ROOT}/bosh-stemcell"
bundle install
popd

pushd "${REPO_ROOT}"
bundle install
bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
popd
SUDO
Loading