diff --git a/release/Makefile.oracle b/release/Makefile.oracle new file mode 100644 --- /dev/null +++ b/release/Makefile.oracle @@ -0,0 +1,53 @@ +# +# Makefile for creating an Oracle Cloud Infrastructure image from a disk image. +# + +.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" +OCINAMESUFFIX!= date +-${BUILDDATE} +.endif +.if ${TARGET_ARCH} != "amd64" +OCIARCH= --${TARGET_ARCH:S/aarch64/arm64/} +.endif + +CLEANFILES+= ociimage + +.if !exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img) +CW_OCI_PORTINSTALL= cw-oci-portinstall +CLEANFILES+= ${CW_OCI_PORTINSTALL} +.else +CW_OCI_PORTINSTALL= +.endif + +cw-oci-portinstall: +.if !exists(/usr/local/bin/curl) || !exists(/usr/local/bin/qemu-img) +. if !exists(${PORTSDIR}/ftp/curl/Makefile) +. if !exists(/usr/local/sbin/pkg-static) + env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf +. endif + env ASSUME_ALWAYS_YES=yes pkg install -y ftp/curl emulators/qemu@nox11 +. endif +.endif + @touch ${.TARGET} + +.for _FS in ${OCI_FSLIST} +.for _FL in ${OCI_FLAVOURS:tl} +OCIIMGLIST+= ociimage-${_FL}-${_FS} +CLEANFILES+= ociimage-${_FL}-${_FS} +ociimage-${_FL}-${_FS}: cw-oci-${_FL}-${_FS} ${CW_OCI_PORTINSTALL} +.if !defined(OCIPAR) + @echo "--------------------------------------------------------------" + @echo ">>> OCIPAR must be defined for image upload" + @echo "--------------------------------------------------------------" + @false +.endif + echo /usr/local/bin/curl -4vsS ${OCIPAR} \ + ${.OBJDIR}/${OCI-${_FL:tu}${_FS:tu}IMAGE} \ + "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${OCINAMESUFFIX} ${_FL} ${_FS:tu}" \ + "${TYPE}/${TARGET} ${GITBRANCH}@${GITREV}" \ + ${OCIREGION} ${OCICOMPARTMENT} ${OCIKEYFILE} + @touch ${.TARGET} +.endfor +.endfor + +ociimage: ociimage-base-${VMFS} +ociimages: ${OCIIMGLIST} diff --git a/release/Makefile.vm b/release/Makefile.vm --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -282,5 +282,6 @@ .include "${.CURDIR}/Makefile.ec2" .include "${.CURDIR}/Makefile.firecracker" .include "${.CURDIR}/Makefile.gce" +.include "${.CURDIR}/Makefile.oracle" .include "${.CURDIR}/Makefile.vagrant" .include "${.CURDIR}/Makefile.inc1"