Add code for creating an EC2 AMI.
This commit is contained in:
parent
6f102967c4
commit
73d4ced07c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=280928
44
release/Makefile.ec2
Normal file
44
release/Makefile.ec2
Normal file
@ -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}
|
@ -152,3 +152,5 @@ cloudware-install:
|
|||||||
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
|
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
|
||||||
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
|
${MAKE} -C ${.CURDIR} ${.MAKEFLAGS} ${CLOUDINSTALL}
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.include "${.CURDIR}/Makefile.ec2"
|
||||||
|
Loading…
Reference in New Issue
Block a user