Skip to content

Commit 6addedd

Browse files
committed
Rename task stemcell:build_with_local_os_image -> :build
1 parent c9d65da commit 6addedd

4 files changed

Lines changed: 21 additions & 18 deletions

File tree

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ popd
3535
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
3636

3737
# build vSphere stemcell
38-
bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
38+
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
3939
```
4040

4141
When building a vSphere stemcell, you must download `VMware-ovftool-*.bundle`
@@ -81,10 +81,10 @@ Rebuild the stemcell when you are making and testing BOSH-specific changes such
8181
export short_name="jammy"
8282
export build_number="0.0.8"
8383

84-
bundle exec rake stemcell:build_with_local_os_image[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz,${build_number}]
84+
bundle exec rake stemcell:build[vsphere,esxi,ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz,${build_number}]
8585
```
8686

87-
The arguments to `stemcell:build_with_local_os_image` are:
87+
The arguments to `stemcell:build` are:
8888

8989
1. `infrastructure_name`: Which IaaS you are producing the stemcell for.
9090
Determines which virtualization tools to package on top of the stemcell.
@@ -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` 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:
146+
When you run the `stemcell:build` rake task, it will create a stemcell that it
147+
runs the stemcell-specific tests against. You will need to run the **rake task
148+
the first time you create your docker container**, but every time after, as
149+
long as you do not destroy the container, you should be able to run the
150+
specific tests:
151151

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

Rakefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ namespace :stemcell do
4242
end
4343
end
4444

45-
desc 'Build a stemcell using a local pre-built base OS image'
46-
task :build_with_local_os_image, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
45+
desc 'Build a stemcell, requires `os_image_path` pointing at an image created via `stemcell:build_os_image`'
46+
task :build, [:infrastructure_name, :hypervisor_name, :operating_system_name, :operating_system_version, :os_image_path, :build_number] do |_, args|
4747
begin
4848
require 'bosh/stemcell/build_environment'
4949
require 'bosh/stemcell/definition'

ci/tasks/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ done
7575
chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource
7676
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
7777
chown -R ubuntu:ubuntu /mnt
78-
7978
sudo chmod u+s "$(which sudo)"
79+
8080
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
8181
set -e
8282
8383
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
8484
bundle install
8585
86-
bundle exec rake stemcell:build_with_local_os_image[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
86+
bundle exec rake stemcell:build[${IAAS},${HYPERVISOR},${OS_NAME},${OS_VERSION},${OS_IMAGE},${CANDIDATE_BUILD_NUMBER}]
8787
SUDO
8888

8989
#

ci/tasks/os-images/build.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,28 @@ function check_param() {
1818
exit 1
1919
fi
2020
}
21+
2122
check_param OPERATING_SYSTEM_NAME
2223
check_param OPERATING_SYSTEM_VERSION
2324

2425
OS_IMAGE_NAME=${OPERATING_SYSTEM_NAME}-${OPERATING_SYSTEM_VERSION}
2526
OS_IMAGE=${REPO_PARENT}/os-image/${OS_IMAGE_NAME}.tgz
27+
2628
if [ -f "${REPO_PARENT}/build-time/timestamp" ]; then
2729
build_time="$(cat "${REPO_PARENT}/build-time/timestamp")"
2830
export BUILD_TIME="$(date --date "${build_time%.*}" +%Y%m%dT%H%M%SZ)"
2931
fi
3032

31-
sudo chown -R ubuntu .
32-
sudo chown -R ubuntu:ubuntu /mnt
33+
chown -R ubuntu:ubuntu "${REPO_ROOT}" # ci resource
34+
chown -R ubuntu:ubuntu "${REPO_PARENT}/bosh-linux-stemcell-builder"
35+
chown -R ubuntu:ubuntu /mnt
3336
sudo chmod u+s "$(which sudo)"
3437

3538
sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
3639
set -e
3740
38-
pushd "${REPO_PARENT}/bosh-linux-stemcell-builder"
39-
bundle install
40-
bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
41-
popd
41+
cd "${REPO_PARENT}/bosh-linux-stemcell-builder"
42+
bundle install
43+
44+
bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
4245
SUDO

0 commit comments

Comments
 (0)