3 # Copyright (C) 2010 Red Hat, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Uncomment for debugging.
32 # TBD: figure out what to do about these paths.
33 export EC2_HOME
=~
/jdarcy
/ec2-api-tools-1.3
-53907
34 export PATH
=$PATH:$EC2_HOME/bin
37 tmpdir
=$
(mktemp
-d -p $PWD/$bucket)
38 trap "rm -rf $tmpdir" EXIT
40 bundle_args
="--batch --arch x86_64 -c $cert_file -k $key_file -u $api_uid"
41 if [ "$kernel" != "_default_" ]; then
42 bundle_args
="$bundle_args --kernel $kernel"
44 if [ "$ramdisk" != "_default_" ]; then
45 bundle_args
="$bundle_args --ramdisk $ramdisk"
47 $ECHO ec2-bundle-image
-i $bucket/$object -d $tmpdir $bundle_args
49 echo "ERROR bundling_failed"
50 echo ec2-bundle-image
-i $bucket/$object -d $tmpdir $bundle_args
54 upload_args
="--batch --retry -b $ami_bkt -a $api_key -s $api_secret"
55 $ECHO ec2-upload-bundle
-m $tmpdir/$object.manifest.xml
$upload_args
57 echo "ERROR uploading_failed"
58 echo ec2-upload-bundle
-m $tmpdir/$object.manifest.xml
$upload_args
62 register_args
="-C $cert_file -K $key_file"
63 $ECHO ec2-register
$register_args $ami_bkt/$object.manifest.xml
-n $object
65 echo "ERROR registration_failed"
66 echo ec2-register
$register_args $ami_bkt/$object.manifest.xml
-n $object