From 6be3d4ef98ee56a021bfc3453f5442bd0f8d88b9 Mon Sep 17 00:00:00 2001 From: gjb Date: Mon, 2 Apr 2018 13:25:38 +0000 Subject: [PATCH] MFC r331806: Add logic for "families" for GCE images. This allows for GCE consumers to easily detect the latest major version of FreeBSD when using the gcloud command line utility. To ensure snapshot builds do not conflict with release-style builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended to the GCE image family name. Sponsored by: The FreeBSD Foundation git-svn-id: svn://svn.freebsd.org/base/stable/10@331876 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- release/Makefile.gce | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/release/Makefile.gce b/release/Makefile.gce index 5bdfb5d2c..34c1e9192 100644 --- a/release/Makefile.gce +++ b/release/Makefile.gce @@ -18,8 +18,13 @@ CLEANFILES+= ${GCE_UPLOAD_TGTS} GCE_BUCKET?= +.if !defined(GCE_FAMILY) || empty(GCE_FAMILY) +GCE_FAMILY= ${TYPE:tl}-${REVISION:S,.,-,} +.endif + .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE" SNAPSHOT_DATE!= date +-%Y-%m-%d +GCE_FAMILY_SUFX= -snap .endif # Really? Uppercase characters are not allowed? Sigh... @@ -64,6 +69,7 @@ gce-do-upload: /usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \ gs://${GCE_BUCKET}/ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \ + --family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz touch ${.OBJDIR}/${.TARGET} -- 2.45.0