5 # Makefile for creating an EC2 AMI from a disk image.
8 .if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
9 AMINAMESUFFIX!= date +-%Y-%m-%d
11 .if defined(EC2PUBLIC)
17 .if !exists(/usr/local/bin/bsdec2-image-upload)
18 CW_EC2_PORTINSTALL= cw-ec2-portinstall
19 CLEANFILES+= ${CW_EC2_PORTINSTALL}
25 .if exists(${PORTSDIR}/net/bsdec2-image-upload/Makefile)
26 make -C ${PORTSDIR}/net/bsdec2-image-upload BATCH=1 all install clean
28 . if !exists(/usr/local/sbin/pkg-static)
29 env ASSUME_ALWAYS_YES=yes pkg bootstrap -y
31 env ASSUME_ALWAYS_YES=yes pkg install -y net/bsdec2-image-upload
35 ec2ami: cw-ec2 ${CW_EC2_PORTINSTALL}
36 .if !defined(AWSKEYFILE) || !exists(${AWSKEYFILE})
37 @echo "--------------------------------------------------------------"
38 @echo ">>> AWSKEYFILE must point at AWS keys for EC2 AMI creation"
39 @echo "--------------------------------------------------------------"
42 .if !defined(AWSREGION)
43 @echo "--------------------------------------------------------------"
44 @echo ">>> AWSREGION must be specified EC2 AMI creation"
45 @echo "--------------------------------------------------------------"
48 .if !defined(AWSBUCKET)
49 @echo "--------------------------------------------------------------"
50 @echo ">>> AWSBUCKET must be specified for EC2 AMI creation"
51 @echo "--------------------------------------------------------------"
54 /usr/local/bin/bsdec2-image-upload ${PUBLISH} --sriov \
56 "${TYPE} ${REVISION}-${BRANCH}-${TARGET}${AMINAMESUFFIX}" \
57 "${TYPE} ${REVISION}-${BRANCH}-${TARGET}" \
58 ${AWSREGION} ${AWSBUCKET} ${AWSKEYFILE}