diff options
author | cperciva <cperciva@FreeBSD.org> | 2015-04-01 00:00:17 +0000 |
---|---|---|
committer | cperciva <cperciva@FreeBSD.org> | 2015-04-01 00:00:17 +0000 |
commit | cbabb678cae1bc20311261fcd38ceb4a0cc319a9 (patch) | |
tree | 8bad179adc1044f64b573d43bdd93bc234f292de | |
parent | 9f8c781a8dc44bc8b9ed84df4c86ea8b31e735a0 (diff) | |
download | FreeBSD-src-cbabb678cae1bc20311261fcd38ceb4a0cc319a9.zip FreeBSD-src-cbabb678cae1bc20311261fcd38ceb4a0cc319a9.tar.gz |
Add code for creating an EC2 AMI.
-rw-r--r-- | release/Makefile.ec2 | 44 | ||||
-rw-r--r-- | release/Makefile.vm | 2 |
2 files changed, 46 insertions, 0 deletions
diff --git a/release/Makefile.ec2 b/release/Makefile.ec2 new file mode 100644 index 0000000..869ebc1 --- /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} diff --git a/release/Makefile.vm b/release/Makefile.vm index 4f6afaa..6599702 100644 --- a/release/Makefile.vm +++ b/release/Makefile.vm @@ -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" |