Author: gjb
Date: Fri Mar 30 19:08:37 2018
New Revision: 331806
URL: https://svnweb.freebsd.org/changeset/base/331806

Log:
  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

Modified:
  head/release/Makefile.gce

Modified: head/release/Makefile.gce
==============================================================================
--- head/release/Makefile.gce   Fri Mar 30 19:02:24 2018        (r331805)
+++ head/release/Makefile.gce   Fri Mar 30 19:08:37 2018        (r331806)
@@ -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}
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to