diff options
author | Colin Percival <cperciva@FreeBSD.org> | 2018-07-21 22:54:43 +0000 |
---|---|---|
committer | Colin Percival <cperciva@FreeBSD.org> | 2018-07-21 22:54:43 +0000 |
commit | 049775cef3ed8f507c51a8f7e81e327b8980836e (patch) | |
tree | c5d0e3787a937f566fea4ab0fcaa32516d8bf0f6 /release/Makefile.ec2 | |
parent | 5aa9b11b613f85cde959ec3b9ba4be0128cb48c3 (diff) | |
download | src-test-049775cef3ed8f507c51a8f7e81e327b8980836e.tar.gz src-test-049775cef3ed8f507c51a8f7e81e327b8980836e.zip |
Use svn or svnlite, or ${SVN_CMD} if set, for extracting the SVN branch
and revision number announced in SNS notifications about new EC2 AMIs.
While I'm here, incorporate that information into the AMI "description"
fields, since it's more useful than simply echoing the information
already provided via the AMI "name".
Approved by: gjb
Notes
Notes:
svn path=/head/; revision=336593
Diffstat (limited to 'release/Makefile.ec2')
-rw-r--r-- | release/Makefile.ec2 | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 index d392adda78b22..eedd0217ba9b4 100644 --- a/release/Makefile.ec2 +++ b/release/Makefile.ec2 @@ -5,6 +5,19 @@ # 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 +EC2_SVNBRANCH!= ${SVN_CMD} info --show-item relative-url ${WORLDDIR} | sed -e 's/\^\///' +EC2_SVNREV!= ${SVN_CMD} info --show-item last-changed-revision ${WORLDDIR} + .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE" AMINAMESUFFIX!= date +-%Y-%m-%d .endif @@ -13,8 +26,6 @@ PUBLISH= --public .endif .if defined(EC2SNSTOPIC) && !empty(EC2SNSTOPIC) EC2SNSREL= ${REVISION}-${BRANCH} -EC2_SVNBRANCH!= svn info --show-item relative-url ${WORLDDIR} | sed -e 's/\^\///' -EC2_SVNREV!= svn info --show-item last-changed-revision ${WORLDDIR} EC2SNSVERS= ${EC2_SVNBRANCH}@${EC2_SVNREV} .endif @@ -60,7 +71,7 @@ ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL} /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov --ena \ ${.OBJDIR}/ec2.raw \ "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \ - "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \ + "${TYPE}/${TARGET} ${EC2_SVNBRANCH}@${EC2_SVNREV}" \ ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE} \ ${EC2SNSTOPIC} ${EC2SNSREL} ${EC2SNSVERS} @touch ${.TARGET} |