freebsd-dev/release/Makefile.ec2
2015-04-01 00:00:17 +00:00

45 lines
1.4 KiB
Makefile

#
# $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}