Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Apr 2015 00:00:18 +0000 (UTC)
From:      Colin Percival <cperciva@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r280928 - head/release
Message-ID:  <201504010000.t3100Iu6094933@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cperciva
Date: Wed Apr  1 00:00:17 2015
New Revision: 280928
URL: https://svnweb.freebsd.org/changeset/base/280928

Log:
  Add code for creating an EC2 AMI.

Added:
  head/release/Makefile.ec2   (contents, props changed)
Modified:
  head/release/Makefile.vm

Added: head/release/Makefile.ec2
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/release/Makefile.ec2	Wed Apr  1 00:00:17 2015	(r280928)
@@ -0,0 +1,44 @@
+#
+# $FreeBSD$
+#
+#
+# Makefile for creating an EC2 AMI from a disk image.
+#
+
+.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE"
+AMINAMESUFFIX!=	date +-%Y-%m-%d
+.endif
+.if defined(EC2PUBLIC)
+PUBLISH=	--public
+.endif
+
+ec2ami: cw-ec2
+.if !exists(/usr/local/bin/bsdec2-image-upload)
+	@echo "--------------------------------------------------------------"
+	@echo ">>> Creating EC2 AMIs requires bsdec2-image-upload"
+	@echo "--------------------------------------------------------------"
+	@false
+.endif
+.if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE})
+	@echo "--------------------------------------------------------------"
+	@echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation"
+	@echo "--------------------------------------------------------------"
+	@false
+.endif
+.if !defined(AWSREGION)
+	@echo "--------------------------------------------------------------"
+	@echo ">>> AWSREGION must be specified EC2 AMI creation"
+	@echo "--------------------------------------------------------------"
+	@false
+.endif
+.if !defined(AWSBUCKET)
+	@echo "--------------------------------------------------------------"
+	@echo ">>> AWSBUCKET must be specified for EC2 AMI creation"
+	@echo "--------------------------------------------------------------"
+	@false
+.endif
+	/usr/local/bin/bsdec2-image-upload ${PUBLISH}		\
+	    ${.OBJDIR}/ec2.raw					\
+	    "${TYPE} ${REVISION}-${BRANCH}${AMINAMESUFFIX}"	\
+	    "${TYPE} ${REVISION}-${BRANCH}"			\
+	    ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}

Modified: head/release/Makefile.vm
==============================================================================
--- head/release/Makefile.vm	Tue Mar 31 23:39:34 2015	(r280927)
+++ head/release/Makefile.vm	Wed Apr  1 00:00:17 2015	(r280928)
@@ -152,3 +152,5 @@ cloudware-install:
 .if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
 	${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
 .endif
+
+.include "${.CURDIR}/Makefile.ec2"



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