Skip to content

Commit f56d3fa

Browse files
committed
Merge branch 'ubuntu-jammy' into merge-jammy
2 parents 037b146 + d69fd55 commit f56d3fa

17 files changed

Lines changed: 68 additions & 40 deletions

Gemfile.lock

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,31 @@ PATH
22
remote: bosh-stemcell
33
specs:
44
bosh-stemcell (0.0.0)
5+
rake
6+
rspec
7+
rspec-its
58

69
GEM
710
remote: https://rubygems.org/
811
specs:
12+
diff-lcs (1.6.2)
913
rake (13.3.1)
14+
rspec (3.13.2)
15+
rspec-core (~> 3.13.0)
16+
rspec-expectations (~> 3.13.0)
17+
rspec-mocks (~> 3.13.0)
18+
rspec-core (3.13.6)
19+
rspec-support (~> 3.13.0)
20+
rspec-expectations (3.13.5)
21+
diff-lcs (>= 1.2.0, < 2.0)
22+
rspec-support (~> 3.13.0)
23+
rspec-its (2.0.0)
24+
rspec-core (>= 3.13.0)
25+
rspec-expectations (>= 3.13.0)
26+
rspec-mocks (3.13.8)
27+
diff-lcs (>= 1.2.0, < 2.0)
28+
rspec-support (~> 3.13.0)
29+
rspec-support (3.13.7)
1030

1131
PLATFORMS
1232
ruby

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ container, you should be able to run the specific tests:
151151

152152
```shell
153153
cd /opt/bosh/bosh-stemcell; \
154-
bundle install \
154+
bundle install; \
155155
STEMCELL_IMAGE=/mnt/stemcells/vsphere/esxi/ubuntu/work/work/vsphere-esxi-ubuntu.raw \
156156
STEMCELL_WORKDIR=/mnt/stemcells/vsphere/esxi/ubuntu/work/work/chroot \
157157
OS_NAME=ubuntu \
@@ -175,8 +175,8 @@ an ubuntu chroot environment to run. For this reason, we use the
175175
locally, run:
176176

177177
```shell
178-
bundle install --local
179178
cd /opt/bosh/bosh-stemcell
179+
bundle install
180180
OS_IMAGE=/opt/bosh/tmp/ubuntu_base_image.tgz bundle exec rake spec:shellout_types
181181
```
182182

bosh-stemcell/bosh-stemcell.gemspec

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ Gem::Specification.new do |spec|
1818
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
1919
spec.require_paths = %w[lib]
2020

21+
# TODO: separate stemcell specs from gem specs
22+
spec.add_dependency "rake"
23+
spec.add_dependency "rspec"
24+
spec.add_dependency "rspec-its"
25+
26+
# used only in gem's own specs
2127
spec.add_development_dependency "fakefs"
22-
spec.add_development_dependency "rake"
23-
spec.add_development_dependency "rspec"
24-
spec.add_development_dependency "rspec-its"
2528
spec.add_development_dependency "standard"
2629
spec.add_development_dependency "timecop"
2730
end

bosh-stemcell/lib/bosh/stemcell/build_environment.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def prepare_build
4141
def os_image_rspec_command
4242
[
4343
"cd #{STEMCELL_SPECS_DIR};",
44-
"bundle install;",
4544
"OS_IMAGE=#{os_image_tarball_path}",
4645
"bundle exec rspec -fd",
4746
"spec/os_image/#{operating_system_spec_name}_spec.rb"
@@ -51,7 +50,6 @@ def os_image_rspec_command
5150
def stemcell_rspec_command
5251
cmd = [
5352
"cd #{STEMCELL_SPECS_DIR};",
54-
"bundle install;",
5553
"STEMCELL_IMAGE=#{image_file_path}",
5654
"STEMCELL_WORKDIR=#{work_path}",
5755
"STEMCELL_INFRASTRUCTURE=#{infrastructure.name}",

bosh-stemcell/spec/bosh/stemcell/build_environment_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
require "bosh/stemcell/infrastructure"
44
require "bosh/stemcell/operating_system"
55
require "bosh/stemcell/definition"
6+
require "fakefs/spec_helpers"
67

78
module Bosh::Stemcell
89
describe BuildEnvironment do
@@ -185,7 +186,6 @@ module Bosh::Stemcell
185186
it "returns the correct command" do
186187
expected_rspec_command = [
187188
"cd #{stemcell_specs_dir};",
188-
"bundle install;",
189189
"OS_IMAGE=/some/os_image.tgz",
190190
"bundle exec rspec -fd",
191191
"spec/os_image/#{operating_system.name}_spec.rb"
@@ -204,7 +204,6 @@ module Bosh::Stemcell
204204
it "returns the correct command" do
205205
expected_rspec_command = [
206206
"cd #{stemcell_specs_dir};",
207-
"bundle install;",
208207
"STEMCELL_IMAGE=#{File.join(work_path, "fake-root-disk-image.raw")}",
209208
"STEMCELL_WORKDIR=#{work_path}",
210209
"STEMCELL_INFRASTRUCTURE=#{infrastructure.name}",

bosh-stemcell/spec/bosh/stemcell/stage_runner_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require "spec_helper"
2-
require "timecop"
32
require "bosh/stemcell/stage_runner"
3+
require "timecop"
4+
require "fakefs/spec_helpers"
45

56
module Bosh::Stemcell
67
describe StageRunner do

bosh-stemcell/spec/spec_helper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
require "rspec"
22
require "rspec/its"
3-
require "fakefs/spec_helpers"
43
require "support/shellout_type_assertions"
54
require "tmpdir"
65

ci/tasks/build-release-metadata.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pushd "${REPO_PARENT}/candidate-stemcell"
3636
kernel_version=$(grep "${KERNEL_PACKAGE}" packages.txt | awk '{print $3}')
3737
popd
3838

39-
bosh_agent_version=$(cat "${REPO_PARENT}/bosh-linux-stemcell-builder/stemcell_builder/stages/bosh_go_agent/assets/bosh-agent-version")
39+
bosh_agent_version=$(cat "${REPO_ROOT}/stemcell_builder/stages/bosh_go_agent/assets/bosh-agent-version")
4040
{
4141
echo "## Metadata:"
4242
echo "**BOSH Agent Version**: ${bosh_agent_version}"
@@ -45,9 +45,9 @@ bosh_agent_version=$(cat "${REPO_PARENT}/bosh-linux-stemcell-builder/stemcell_bu
4545

4646
if [[ "${OS_NAME}" == "ubuntu" ]]; then
4747
# Ensure URL for usn-log from metalink exists before attempting to download.
48-
usn_log_json_file="${REPO_PARENT}/bosh-linux-stemcell-builder/usn-log.json"
48+
usn_log_json_file="${REPO_ROOT}/usn-log.json"
4949
touch "${usn_log_json_file}"
50-
usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
50+
usn_metalink_path="${REPO_ROOT}/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
5151
if [[ -n "$(meta4 file-urls --metalink "${usn_metalink_path}" --file usn-log.json)" ]]; then
5252
meta4 file-download \
5353
--skip-hash-verification \

ci/tasks/build.sh

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ for i in $(seq 0 64); do
7171
fi
7272
done
7373

74-
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
74+
chown -R ubuntu:ubuntu "${REPO_ROOT}"
7575
chown -R ubuntu:ubuntu /mnt
7676

7777
OS_IMAGE=""
@@ -82,45 +82,50 @@ fi
8282

8383
sudo chmod u+s "$(which sudo)"
8484
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
85-
set -e
85+
set -e
8686
87-
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
88-
bundle update --bundler
89-
bundle install --local
87+
cd "${REPO_ROOT}"
88+
bundle install
9089
9190
if [[ -z "$OS_IMAGE" ]]; then
92-
bundle exec rake stemcell:build[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$CANDIDATE_BUILD_NUMBER]
93-
rm -f ./tmp/base_os_image.tgz
91+
bundle exec rake stemcell:build[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$CANDIDATE_BUILD_NUMBER]
92+
rm -f ./tmp/base_os_image.tgz
9493
else
95-
bundle exec rake stemcell:build_with_local_os_image[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$OS_IMAGE,$CANDIDATE_BUILD_NUMBER]
94+
bundle exec rake stemcell:build_with_local_os_image[$IAAS,$HYPERVISOR,$OS_NAME,$OS_VERSION,$OS_IMAGE,$CANDIDATE_BUILD_NUMBER]
9695
fi
9796
SUDO
9897

9998
#
10099
# Output and checksum the stemcell artifacts
101100
#
102101

103-
stemcell_name="bosh-stemcell-$CANDIDATE_BUILD_NUMBER-$IAAS-$HYPERVISOR-$OS_NAME-$OS_VERSION${AGENT_SUFFIX}"
104-
meta4_path="${REPO_PARENT}/stemcells-index-output/dev/$OS_NAME-$OS_VERSION/$CANDIDATE_BUILD_NUMBER/$IAAS-$HYPERVISOR${AGENT_SUFFIX}.meta4"
102+
stemcell_name="bosh-stemcell-${CANDIDATE_BUILD_NUMBER}-$IAAS-$HYPERVISOR-$OS_NAME-$OS_VERSION${AGENT_SUFFIX}"
103+
meta4_path="${REPO_PARENT}/stemcells-index-output/dev/$OS_NAME-$OS_VERSION/${CANDIDATE_BUILD_NUMBER}/$IAAS-$HYPERVISOR${AGENT_SUFFIX}.meta4"
105104

106-
echo $CANDIDATE_BUILD_NUMBER > "${REPO_PARENT}/candidate-build-number/number"
105+
echo "${CANDIDATE_BUILD_NUMBER}" > "${REPO_PARENT}/candidate-build-number/number"
107106
mkdir -p "$( dirname "$meta4_path" )"
108107
rm -f "$meta4_path"
109108
meta4 create --metalink="$meta4_path"
110109

111-
if [ -e "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp"/*-raw.tgz ] ; then
110+
raw_images=( "${REPO_ROOT}/tmp"/*-raw.tgz )
111+
if [ "${#raw_images[@]}" -ge 2 ]; then
112+
echo "Found more than one raw image: '${raw_images[*]}'" >&2
113+
exit 1
114+
fi
115+
116+
if [ -e "${raw_images[0]}" ] ; then
112117
# openstack currently publishes raw files
113118
raw_stemcell_filename="${stemcell_name}-raw.tgz"
114-
mv "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp"/*-raw.tgz "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"
119+
mv "${REPO_ROOT}/tmp"/*-raw.tgz "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"
115120

116-
meta4 import-file --metalink="$meta4_path" --version="$CANDIDATE_BUILD_NUMBER" "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"
121+
meta4 import-file --metalink="$meta4_path" --version="${CANDIDATE_BUILD_NUMBER}" "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"
117122
meta4 file-set-url --metalink="$meta4_path" --file="${raw_stemcell_filename}" "https://${S3_API_ENDPOINT}/${STEMCELL_BUCKET}/${IAAS}/${raw_stemcell_filename}"
118123
fi
119124

120125
stemcell_filename="${stemcell_name}.tgz"
121-
mv "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp/${stemcell_filename}" "${REPO_PARENT}/stemcell/${stemcell_filename}"
126+
mv "${REPO_ROOT}/tmp/${stemcell_filename}" "${REPO_PARENT}/stemcell/${stemcell_filename}"
122127

123-
meta4 import-file --metalink="$meta4_path" --version="$CANDIDATE_BUILD_NUMBER" "${REPO_PARENT}/stemcell/${stemcell_filename}"
128+
meta4 import-file --metalink="$meta4_path" --version="${CANDIDATE_BUILD_NUMBER}" "${REPO_PARENT}/stemcell/${stemcell_filename}"
124129
meta4 file-set-url --metalink="$meta4_path" --file="${stemcell_filename}" "https://${S3_API_ENDPOINT}/${STEMCELL_BUCKET}/${IAAS}/${stemcell_filename}"
125130

126131
# just in case we need to debug/verify the live results
@@ -131,4 +136,4 @@ cd "${REPO_PARENT}/stemcells-index-output"
131136
git add -A
132137
git config --global user.email "ci@localhost"
133138
git config --global user.name "CI Bot"
134-
git commit -m "dev: $OS_NAME-$OS_VERSION/$CANDIDATE_BUILD_NUMBER ($IAAS-$HYPERVISOR)"
139+
git commit -m "dev: ${OS_NAME}-${OS_VERSION}/${CANDIDATE_BUILD_NUMBER} ($IAAS-$HYPERVISOR)"

ci/tasks/bump-bosh-agent.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if [[ -n "${DEBUG:-}" ]]; then
1010
export BOSH_LOG_PATH="${BOSH_LOG_PATH:-${REPO_PARENT}/bosh-debug.log}"
1111
fi
1212

13-
git clone "${REPO_PARENT}/bosh-linux-stemcell-builder" "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
13+
git clone "${REPO_ROOT}" "${REPO_PARENT}/bosh-linux-stemcell-builder-out"
1414

1515
version=$( cat "${REPO_PARENT}/bosh-agent/.resource/version" )
1616

0 commit comments

Comments
 (0)