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
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ docker run \
bosh/os-image-stemcell-builder:${short_name}

# You're now in the Docker container
gem install bundler
bundle install
pushd bosh-stemcell
bundle install
popd

# build OS image
bundle exec rake stemcell:build_os_image[ubuntu,${short_name},${PWD}/tmp/ubuntu_base_image.tgz]
Expand Down
6 changes: 3 additions & 3 deletions ci/tasks/build-release-metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pushd "${REPO_PARENT}/candidate-stemcell"
kernel_version=$(grep "${KERNEL_PACKAGE}" packages.txt | awk '{print $3}')
popd

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

if [[ "${OS_NAME}" == "ubuntu" ]]; then
# Ensure URL for usn-log from metalink exists before attempting to download.
usn_log_json_file="${REPO_PARENT}/bosh-linux-stemcell-builder/usn-log.json"
usn_log_json_file="${REPO_ROOT}/usn-log.json"
touch "${usn_log_json_file}"
usn_metalink_path="${REPO_PARENT}/bosh-linux-stemcell-builder/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
usn_metalink_path="${REPO_ROOT}/bosh-stemcell/image-metalinks/${BRANCH}/${OS_NAME}-${OS_VERSION}.meta4"
if [[ -n "$(meta4 file-urls --metalink "${usn_metalink_path}" --file usn-log.json)" ]]; then
meta4 file-download \
--skip-hash-verification \
Expand Down
26 changes: 16 additions & 10 deletions ci/tasks/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ for i in $(seq 0 64); do
fi
done

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

OS_IMAGE=""
Expand Down Expand Up @@ -101,27 +101,33 @@ SUDO
# Output and checksum the stemcell artifacts
#

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

echo $CANDIDATE_BUILD_NUMBER > "${REPO_PARENT}/candidate-build-number/number"
echo "${CANDIDATE_BUILD_NUMBER}" > "${REPO_PARENT}/candidate-build-number/number"
mkdir -p "$( dirname "$meta4_path" )"
rm -f "$meta4_path"
meta4 create --metalink="$meta4_path"

if [ -e "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp"/*-raw.tgz ] ; then
raw_images=( "${REPO_ROOT}/tmp"/*-raw.tgz )
if [ "${#raw_images[@]}" -ge 2 ]; then
echo "Found more than one raw image: '${raw_images[*]}'" >&2
exit 1
fi

if [ -e "${raw_images[0]}" ] ; then
# openstack currently publishes raw files
raw_stemcell_filename="${stemcell_name}-raw.tgz"
mv "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp"/*-raw.tgz "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"
mv "${REPO_ROOT}/tmp"/*-raw.tgz "${REPO_PARENT}/stemcell/${raw_stemcell_filename}"

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

stemcell_filename="${stemcell_name}.tgz"
mv "${REPO_PARENT}/bosh-linux-stemcell-builder/tmp/${stemcell_filename}" "${REPO_PARENT}/stemcell/${stemcell_filename}"
mv "${REPO_ROOT}/tmp/${stemcell_filename}" "${REPO_PARENT}/stemcell/${stemcell_filename}"

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

# just in case we need to debug/verify the live results
Expand All @@ -132,4 +138,4 @@ cd "${REPO_PARENT}/stemcells-index-output"
git add -A
git config --global user.email "ci@localhost"
git config --global user.name "CI Bot"
git commit -m "dev: $OS_NAME-$OS_VERSION/$CANDIDATE_BUILD_NUMBER ($IAAS-$HYPERVISOR)"
git commit -m "dev: ${OS_NAME}-${OS_VERSION}/${CANDIDATE_BUILD_NUMBER} ($IAAS-$HYPERVISOR)"
2 changes: 1 addition & 1 deletion ci/tasks/bump-bosh-agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ -n "${DEBUG:-}" ]]; then
export BOSH_LOG_PATH="${BOSH_LOG_PATH:-${REPO_PARENT}/bosh-debug.log}"
fi

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

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

Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/bump-bosh-blobstore-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [[ -n "${DEBUG:-}" ]]; then
export BOSH_LOG_PATH="${BOSH_LOG_PATH:-${REPO_PARENT}/bosh-debug.log}"
fi

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

url=$(cat "${REPO_PARENT}/bosh-blobstore-cli/url")
version=$(cat "${REPO_PARENT}/bosh-blobstore-cli/version")
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/commit-build-time.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fi
build_time="$(cat "${REPO_PARENT}/build-time/timestamp")"
formatted_build_time="$(date --date "${build_time%.*}" +%Y%m%dT%H%M%SZ)"

pushd "${REPO_PARENT}/bosh-linux-stemcell-builder"
pushd "${REPO_ROOT}"
echo "${formatted_build_time}" > build_time.txt
git add -A
git config --global user.email "ci@localhost"
Expand Down
12 changes: 8 additions & 4 deletions ci/tasks/os-images/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ if [[ -n "${DEBUG:-}" ]]; then
export BOSH_LOG_PATH="${BOSH_LOG_PATH:-${REPO_PARENT}/bosh-debug.log}"
fi

cd "${REPO_PARENT}/bosh-linux-stemcell-builder"

function check_param() {
local name=$1
local value=$(eval echo '$'$name)
Expand All @@ -33,7 +31,13 @@ fi
sudo chown -R ubuntu .
sudo chown -R ubuntu:ubuntu /mnt
sudo chmod u+s "$(which sudo)"
bundle install

cd "${REPO_ROOT}"

sudo --preserve-env --set-home --user ubuntu -- /bin/bash --login -i <<SUDO
pushd "${REPO_ROOT}/bosh-stemcell"
bundle install
popd

bundle exec rake stemcell:build_os_image[$OPERATING_SYSTEM_NAME,$OPERATING_SYSTEM_VERSION,$OS_IMAGE]
SUDO
SUDO
2 changes: 1 addition & 1 deletion ci/tasks/test-stemcell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if bosh int "${REPO_PARENT}/director-state/director-creds.yml" --path /jumpbox_s
export BOSH_GW_HOST="${BOSH_ENVIRONMENT}"
fi

pushd "${REPO_PARENT}/bosh-linux-stemcell-builder/acceptance-tests"
pushd "${REPO_ROOT}/acceptance-tests"
# shellcheck disable=SC2154
go run github.com/onsi/ginkgo/v2/ginkgo --skip-package vendor -r "${package}"
popd
Loading