aboutsummaryrefslogtreecommitdiff
path: root/release/Makefile.ec2
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2015-04-01 00:00:17 +0000
committerColin Percival <cperciva@FreeBSD.org>2015-04-01 00:00:17 +0000
commit73d4ced07c4f3429f89997c1ee3868bae616f607 (patch)
tree8bad179adc1044f64b573d43bdd93bc234f292de /release/Makefile.ec2
parent6f102967c4bc8a472d7822af16ee244853ee9f72 (diff)
downloadsrc-73d4ced07c4f3429f89997c1ee3868bae616f607.tar.gz
src-73d4ced07c4f3429f89997c1ee3868bae616f607.zip
Add code for creating an EC2 AMI.
Notes
Notes: svn path=/head/; revision=280928
Diffstat (limited to 'release/Makefile.ec2')
-rw-r--r--release/Makefile.ec244
1 files changed, 44 insertions, 0 deletions
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2
new file mode 100644
index 000000000000..869ebc15264e
--- /dev/null
+++ b/release/Makefile.ec2
@@ -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}