aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile.gce
diff options
context:
space:
mode:
authorGlen Barber <gjb@FreeBSD.org>2018-03-30 19:08:37 +0000
committerGlen Barber <gjb@FreeBSD.org>2018-03-30 19:08:37 +0000
commit8e29ef317f96ffe73a698e45a63a094eea6569c3 (patch)
treebe485ae8c0f28ed8616a5b3b54f6b9a8a2eb4e61 /release/Makefile.gce
parent541d96aaaf46cde0f4247c226ed29d635b1915c4 (diff)
downloadsrc-8e29ef317f96ffe73a698e45a63a094eea6569c3.tar.gz
src-8e29ef317f96ffe73a698e45a63a094eea6569c3.zip
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. MFC after: 3 days Sponsored by: The FreeBSD Foundation
Notes
Notes: svn path=/head/; revision=331806
Diffstat (limited to 'release/Makefile.gce')
-rw-r--r--release/Makefile.gce6
1 files changed, 6 insertions, 0 deletions
diff --git a/release/Makefile.gce b/release/Makefile.gce
index 5bdfb5d2ce62..34c1e9192125 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}