Skip to content

Commit c9d65da

Browse files
committed
CI: use concourse to fetch OS_IMAGE
Remove conditional path in CI that could download the OS_IMAGE using `meta4 file-download`. Remove rake tasks which supported this path, and remove references from docs.
1 parent b5ffe31 commit c9d65da

4 files changed

Lines changed: 8 additions & 68 deletions

File tree

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,11 @@ container):
143143

144144
### How to Run Tests for Stemcell
145145

146-
When you run the `stemcell:build_with_local_os_image` or `stemcell:build` rake
147-
task, it will create a stemcell that it runs the stemcell specific tests
148-
against. You will need to run the **rake task the first time you create your
149-
docker container**, but everytime after, as long as you do not destroy the
150-
container, you should be able to run the specific tests:
146+
When you run the `stemcell:build_with_local_os_image` rake task, it will create
147+
a stemcell that it runs the stemcell specific tests against. You will need to
148+
run the **rake task the first time you create your docker container**, but
149+
everytime after, as long as you do not destroy the container, you should be
150+
able to run the specific tests:
151151

152152
```shell
153153
cd /opt/bosh/bosh-stemcell; \

Rakefile

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,56 +42,6 @@ namespace :stemcell do
4242
end
4343
end
4444

45-
desc 'Download a remote pre-built base OS image'
46-
task :download_os_image, [:operating_system_name, :operating_system_version] do |_, args|
47-
begin
48-
puts "Using OS image #{args.operating_system_name}-#{args.operating_system_version}"
49-
50-
mkdir_p('tmp')
51-
52-
metalink_path = File.join(
53-
Dir.pwd,
54-
'bosh-stemcell',
55-
'image-metalinks',
56-
"#{args.operating_system_name}-#{args.operating_system_version}.meta4"
57-
)
58-
59-
os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
60-
`meta4 file-download --file #{args.operating_system_name}-#{args.operating_system_version}.tgz --metalink #{metalink_path} #{os_image_path}`
61-
raise 'Failed to download metalink' if $?.exitstatus != 0
62-
63-
puts "Successfully downloaded OS image to #{os_image_path}"
64-
rescue RuntimeError => e
65-
print_help
66-
raise e
67-
end
68-
end
69-
70-
desc 'Build a stemcell with a remote pre-built base OS image'
71-
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :build_number] do |_, args|
72-
begin
73-
Rake::Task['stemcell:download_os_image'].invoke(
74-
args.operating_system_name,
75-
args.operating_system_version
76-
)
77-
78-
os_image_path = File.join(Dir.pwd, 'tmp', 'base_os_image.tgz')
79-
args.with_defaults(build_number: '0000')
80-
81-
Rake::Task['stemcell:build_with_local_os_image'].invoke(
82-
args.infrastructure_name,
83-
args.hypervisor_name,
84-
args.operating_system_name,
85-
args.operating_system_version,
86-
os_image_path,
87-
args.build_number
88-
)
89-
rescue RuntimeError => e
90-
print_help
91-
raise e
92-
end
93-
end
94-
9545
desc 'Build a stemcell using a local pre-built base OS image'
9646
task :build_with_local_os_image, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
9747
begin

ci/tasks/build.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ check_param HYPERVISOR
2424
check_param OS_NAME
2525
check_param OS_VERSION
2626

27+
OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)"
28+
2729
export CANDIDATE_BUILD_NUMBER=$( cat "${REPO_PARENT}/version/number" | sed 's/\.0$//;s/\.0$//' )
2830

2931
git clone "${REPO_PARENT}/stemcells-index" "${REPO_PARENT}/stemcells-index-output"
@@ -74,25 +76,14 @@ chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource
7476
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
7577
chown -R ubuntu:ubuntu /mnt
7678

77-
OS_IMAGE=""
78-
mkdir -p "${REPO_PARENT}/os-image-tarball"
79-
if [[ -n "$(ls -A "${REPO_PARENT}/os-image-tarball/")" ]]; then
80-
OS_IMAGE="$(readlink -f "${REPO_PARENT}/os-image-tarball"/*.tgz)"
81-
fi
82-
8379
sudo chmod u+s "$(which sudo)"
8480
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
8581
set -e
8682
8783
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
8884
bundle install
8985
90-
if [[ -z "${OS_IMAGE}" ]]; then
91-
bundle exec rake stemcell:build[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${CANDIDATE_BUILD_NUMBER}]
92-
rm -f ./tmp/base_os_image.tgz
93-
else
94-
bundle exec rake stemcell:build_with_local_os_image[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
95-
fi
86+
bundle exec rake stemcell:build_with_local_os_image[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
9687
SUDO
9788

9889
#

ci/tasks/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ inputs:
88
- name: version
99
- name: stemcells-index
1010
- name: os-image-tarball
11-
optional: true
1211

1312
outputs:
1413
- name: stemcell

0 commit comments

Comments
 (0)