From owner-svn-src-stable@freebsd.org Sun Aug 26 05:28:19 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F346910A2800; Sun, 26 Aug 2018 05:28:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9C4371A14; Sun, 26 Aug 2018 05:28:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 86FD22577; Sun, 26 Aug 2018 05:28:18 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7Q5SIef006279; Sun, 26 Aug 2018 05:28:18 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7Q5SIvW006278; Sun, 26 Aug 2018 05:28:18 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201808260528.w7Q5SIvW006278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sun, 26 Aug 2018 05:28:18 +0000 (UTC) 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 X-SVN-Group: stable-10 X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: stable/10/release X-SVN-Commit-Revision: 338323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Aug 2018 05:28:19 -0000 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}