Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Aug 2018 05:28:18 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r338323 - stable/10/release
Message-ID:  <201808260528.w7Q5SIvW006278@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Sun Aug 26 05:28:17 2018
New Revision: 338323
URL: https://svnweb.freebsd.org/changeset/base/338323

Log:
  MFC r336420,336433,336593,336621,336622,336624,337394,337401,338141
  
  Teach the EC2 AMI upload code to:
  * Mark EBS snapshots as public,
  * Announce new AMIs to an SNS topic, and
  * Place the SVN branch and revision into the AMI "description".

Modified:
  stable/10/release/Makefile.ec2
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/release/Makefile.ec2
==============================================================================
--- stable/10/release/Makefile.ec2	Sun Aug 26 04:32:52 2018	(r338322)
+++ stable/10/release/Makefile.ec2	Sun Aug 26 05:28:17 2018	(r338323)
@@ -5,12 +5,43 @@
 # Makefile for creating an EC2 AMI from a disk image.
 #
 
+# Figure out where SVN is
+.if !defined(SVN_CMD) || empty(SVN_CMD)
+. for _P in /usr/bin /usr/local/bin
+.  for _S in svn svnlite
+.   if exists(${_P}/${_S})
+SVN_CMD=   ${_P}/${_S}
+.   endif
+.  endfor
+. endfor
+.endif
+.if exists(${SRCTOP}/.svn)
+.  if empty(EC2_SVNBRANCH)
+   EC2_SVNBRANCH!=	${SVN_CMD} info --show-item relative-url ${WORLDDIR} 2>/dev/null | sed -e 's/\^\///'
+.  export EC2_SVNBRANCH
+.  endif
+.  if empty(EC2_SVNREV)
+   EC2_SVNREV!=	${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} 2>/dev/null || true
+.  export EC2_SVNREV
+.  endif
+.else
+EC2_SVNBRANCH=	unknown
+EC2_SVNREV=	unknown
+.endif
+
 .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
 AMINAMESUFFIX!=	date +-%Y-%m-%d
 .endif
-.if defined(EC2PUBLIC)
+.if defined(EC2PUBLIC) && !empty(EC2PUBLIC)
 PUBLISH=	--public
 .endif
+.if defined(EC2PUBLICSNAP) && !empty(EC2PUBLICSNAP)
+PUBLICSNAP=	--publicsnap
+.endif
+.if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC)
+EC2SNSREL=	${REVISION}-${BRANCH}
+EC2SNSVERS=	${EC2_SVNBRANCH}@${EC2_SVNREV}
+.endif
 
 CLEANFILES+=		ec2ami
 
@@ -51,9 +82,10 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
 	@echo "--------------------------------------------------------------"
 	@false
 .endif
-	/usr/local/bin/bsdec2-image-upload ${PUBLISH} \
+	/usr/local/bin/bsdec2-image-upload ${PUBLISH} ${PUBLICSNAP} \
 	    ${.OBJDIR}/ec2.raw \
 	    "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
-	    "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
-	    ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}
+	    "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \
+	    ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \
+	    ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS}
 	@touch ${.TARGET}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808260528.w7Q5SIvW006278>