release: Publish non-uploaded cloudware bits

While most "cloudware" (AWS, Azure, GCP, Vagrant) images get uploaded
to their respective clouds, we have two images -- BASIC-CI and
BASIC-CLOUDINIT -- which are published via the FTP mirrors.  We have
been handling these using a manual and error-prone process of copying
them from the internal build directories into the FTP staging tree,
but they should be handled using the "make install ftp-stage"
mechanism which is used for all the other published images.

This commit 1. Adds a new 'make cloud-install' target which is run as
part of 'make install' and installs BASIC-CI and BASIC-CLOUDINIT images,
and 2. Extends 'make ftp-stage' in Makefile.mirrors to copy those bits
into the FTP staging area.

As a side benefit, this will also make BASIC-CI and BASIC-CLOUDINIT
images available for arm64; until now they have only been available
for amd64.

MFC after:	1 week
This commit is contained in:
Colin Percival 2024-06-19 12:28:42 -07:00
parent 42fbb55d45
commit 4771c2e9d1
3 changed files with 140 additions and 1 deletions

View File

@ -14,6 +14,7 @@
# install: Invokes the release-install and vm-install targets
# release-install: Copies all release installation media into ${DESTDIR}
# vm-install: Copies all virtual machine images into ${DESTDIR}
# cloud-install: Copies non-uploaded cloud images into ${DESTDIR}
#
# Variables affecting the build process:
# WORLDDIR: location of src tree -- must have built world and default kernel
@ -326,7 +327,7 @@ real-release:
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} obj
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${RELEASE_TARGETS}
install: release-install vm-install
install: release-install vm-install .WAIT cloud-install
release-install:
.if defined(DESTDIR) && !empty(DESTDIR)

View File

@ -53,6 +53,11 @@ STAGE_TARGETS+= vm-images-stage
VM_DIR= ${TLD}/VM-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH}
.endif
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE)
STAGE_TARGETS+= ci-images-stage
CI_DIR= ${TLD}/CI-IMAGES/${REVISION}-${BRANCH}/${TARGET_ARCH}
.endif
CLEANFILES+= ${STAGE_TARGETS}
CHECKSUM_FILES?= SHA512 SHA256
SNAP_SUFFIX!= echo ${_SNAP_SUFFIX:S,^-,,1} | tr -d ' '
@ -203,6 +208,22 @@ vm-images-stage:
ln -s ../${BUILDDATE}/${OSRELEASE}-${FS}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
${OSRELEASE}-${FS}.${VMFORMAT}.xz
. endfor
. endfor
. for CW in ${CLOUDWARE}
. if ${CW} == BASIC-CLOUDINIT
. for VMFORMAT in ${${CW}_FORMAT}
. for FS in ${${CW}_FSLIST}
cd ${RELEASEDIR}/vmimages && \
mv ${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \
${VM_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz
cd ${VM_DIR}/Latest && \
ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz
. endfor
. endfor
. endif
. endfor
cd ${RELEASEDIR}/vmimages && rm -f CHECKSUM.*
. for CHECKSUM in ${CHECKSUM_FILES}
@ -227,11 +248,86 @@ vm-images-stage:
${VM_DIR}/Latest/${OSRELEASE}-${FS}.${VMFORMAT}.xz
. endfor
. endfor
. for CW in ${CLOUDWARE}
. if ${CW} == BASIC-CLOUDINIT
. for VMFORMAT in ${${CW}_FORMAT}
. for FS in ${${CW}_FSLIST}
cp -p ${RELEASEDIR}/vmimages/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz \
${VM_DIR}/Latest/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz
. endfor
. endfor
. endif
. endfor
. for CHECKSUM in ${CHECKSUM_FILES}
cp -p ${RELEASEDIR}/vmimages/CHECKSUM.${CHECKSUM} \
${VM_DIR}/Latest/CHECKSUM.${CHECKSUM}
. endfor
.endif
ci-images-stage:
mkdir -p ${CI_DIR}
.if defined(SNAPSHOT) && !empty(SNAPSHOT)
. if exists(${CI_DIR}/Latest)
rm -rf ${CI_DIR}/Latest
. endif
mkdir -p ${CI_DIR}/Latest
mkdir -p ${CI_DIR}/${BUILDDATE}
. for CW in ${CLOUDWARE}
. if ${CW} == BASIC-CI
. for VMFORMAT in ${${CW}_FORMAT}
. for FS in ${${CW}_FSLIST}
cd ${RELEASEDIR}/ciimages && \
mv ${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz
cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \
${CI_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz
cd ${CI_DIR}/Latest && \
ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${FS}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz
. endfor
cd ${RELEASEDIR}/ciimages && \
mv ${OSRELEASE}-${CW}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${VMFORMAT}.xz
cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
${CI_DIR}/${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${VMFORMAT}.xz
cd ${CI_DIR}/Latest && \
ln -s ../${BUILDDATE}/${OSRELEASE}-${CW}-${SNAP_SUFFIX}.${VMFORMAT}.xz \
${OSRELEASE}-${CW}.${VMFORMAT}.xz
. endfor
. endif
. endfor
cd ${RELEASEDIR}/ciimages && rm -f CHECKSUM.*
. for CHECKSUM in ${CHECKSUM_FILES}
cd ${RELEASEDIR}/ciimages && \
${CHECKSUM:tl} ${OSRELEASE}* > CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
cp -p ${RELEASEDIR}/ciimages/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
${CI_DIR}/${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX}
cd ${CI_DIR}/Latest && \
ln -s ../${BUILDDATE}/CHECKSUM.${CHECKSUM}-${SNAP_SUFFIX} \
CHECKSUM.${CHECKSUM}
. endfor
.else # not snapshot
. if exists(${CI_DIR}/Latest)
rm -rf ${CI_DIR}/Latest
. endif
mkdir -p ${CI_DIR}/Latest
. for CW in ${CLOUDWARE}
. if ${CW} == BASIC-CI
. for VMFORMAT in ${${CW}_FORMAT}
. for FS in ${${CW}_FSLIST}
cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}-${FS}.${VMFORMAT}.xz \
${CI_DIR}/Latest/${OSRELEASE}-${CW}.${FS}.${VMFORMAT}.xz
. endfor
cp -p ${RELEASEDIR}/ciimages/${OSRELEASE}-${CW}.${VMFORMAT}.xz \
${CI_DIR}/Latest/${OSRELEASE}-${CW}.${VMFORMAT}.xz
. endfor
. endif
. endfor
. for CHECKSUM in ${CHECKSUM_FILES}
cp -p ${RELEASEDIR}/ciimages/CHECKSUM.${CHECKSUM} \
${CI_DIR}/Latest/CHECKSUM.${CHECKSUM}
. endfor
.endif
ftp-stage: remove-old-bits ${STAGE_TARGETS}

View File

@ -223,6 +223,48 @@ vm-install:
${DESTDIR}/vmimages/CHECKSUM.SHA256
.endif
cloud-install-BASIC-CI:
mkdir -p ${DESTDIR}/ciimages
.for _FS in ${BASIC-CI_FSLIST}
. for _FMT in ${BASIC-CI_FORMAT}
cp -p ${.OBJDIR}/${BASIC-CI${_FS:tu}${_FMT:tu}IMAGE} \
${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${_FS}.${_FMT}
${XZ_CMD} ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${_FS}.${_FMT}
. endfor
.endfor
.for _FMT in ${BASIC-CI_FORMAT}
ln -f ${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI-${VMFS}.${_FMT}.xz \
${DESTDIR}/ciimages/${OSRELEASE}-BASIC-CI.${_FMT}.xz
.endfor
cd ${DESTDIR}/ciimages && sha512 ${OSRELEASE}* > \
${DESTDIR}/ciimages/CHECKSUM.SHA512
cd ${DESTDIR}/ciimages && sha256 ${OSRELEASE}* > \
${DESTDIR}/ciimages/CHECKSUM.SHA256
cloud-install-BASIC-CLOUDINIT:
mkdir -p ${DESTDIR}/vmimages
.for _FS in ${BASIC-CLOUDINIT_FSLIST}
. for _FMT in ${BASIC-CLOUDINIT_FORMAT}
cp -p ${.OBJDIR}/${BASIC-CLOUDINIT${_FS:tu}${_FMT:tu}IMAGE} \
${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT}
${XZ_CMD} ${DESTDIR}/vmimages/${OSRELEASE}-BASIC-CLOUDINIT.${_FS}.${_FMT}
. endfor
.endfor
cd ${DESTDIR}/vmimages && sha512 ${OSRELEASE}* > \
${DESTDIR}/vmimages/CHECKSUM.SHA512
cd ${DESTDIR}/vmimages && sha256 ${OSRELEASE}* > \
${DESTDIR}/vmimages/CHECKSUM.SHA256
CLOUD_INSTALL_TGTS=
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE)
. for _CW in ${CLOUDWARE}
. if target(cloud-install-${_CW})
CLOUD_INSTALL_TGTS+= cloud-install-${_CW}
. endif
. endfor
.endif
cloud-install: ${CLOUD_INSTALL_TGTS}
.if defined(WITH_VMIMAGES) && !empty(WITH_VMIMAGES)
vm-release: ${VMTARGETS}
.else