Skip to content

Commit b205c29

Browse files
author
jdeolive
committed
migrating to eu region, disabling migration to us-west
git-svn-id: http://svn.opengeo.org/suite/trunk@2607 fe66add1-021f-4af3-b75b-ea5154e73f91
1 parent dcc6a0f commit b205c29

6 files changed

+106
-11
lines changed

aws/build_ubuntu_ami.sh

+3
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ if [ -z $SKIP_CREATE_IMAGE ]; then
179179

180180
scp $SSH_OPTS s3cfg-$ACCOUNT.us-west ubuntu@$HOST:/tmp/s3cfg.us-west
181181
check_rc $? "upload s3cfg-$ACCOUNT.us-west"
182+
183+
scp $SSH_OPTS s3cfg-$ACCOUNT.eu-west ubuntu@$HOST:/tmp/s3cfg.eu-west
184+
check_rc $? "upload s3cfg-$ACCOUNT.eu-west"
182185

183186
ssh $SSH_OPTS ubuntu@$HOST "cd /tmp && ./bundle_s3_image.sh $IMAGE_NAME $IMAGE_ARCH -p $PRODUCT_ID $SKIP_PRODUCT_CODE"
184187
check_rc $? "remote bundle image"

aws/bundle_s3_image.sh

+25-11
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for (( i=2; i < ${#args[*]}; i++ )); do
2828
fi
2929
done
3030

31-
IMAGE_NAME_BASE=$1
31+
IMAGE_NAME=$1
3232
IMAGE_ARCH=$2
3333
export EC2_PRIVATE_KEY=`ls /tmp/pk-*`
3434
export EC2_CERT=`ls /tmp/cert-*`
@@ -61,28 +61,41 @@ fi
6161

6262
S3_BUCKET=$S3_BUCKET_ROOT/$IMAGE_NAME
6363
S3_BUCKET_WEST=$S3_BUCKET_ROOT_WEST/$IMAGE_NAME
64+
S3_BUCKET_EU=$S3_BUCKET_ROOT_EU/$IMAGE_NAME
6465
S3CMD_CONFIG=/tmp/s3cfg
6566
S3CMD_CONFIG_WEST=/tmp/s3cfg.us-west
67+
S3CMD_CONFIG_EU=/tmp/s3cfg.us-west
6668

6769
s3cmd -c $S3CMD_CONFIG ls s3://$S3_BUCKET_ROOT
6870
check_rc $? "listing contents of $S3_BUCKET_ROOT"
6971

7072
# figure out if the directory already exists, and delete it if necessary
71-
s3cmd -c $S3CMD_CONFIG ls s3://$S3_BUCKET_ROOT | grep $IMAGE_NAME
72-
if [ $? -eq 0 ]; then
73-
s3cmd -c $S3CMD_CONFIG -r del s3://$S3_BUCKET
74-
fi
75-
s3cmd -c $S3CMD_CONFIG_WEST ls s3://$S3_BUCKET_ROOT_WEST | grep $IMAGE_NAME
76-
if [ $? -eq 0 ]; then
77-
s3cmd -c $S3CMD_CONFIG_WEST -r del s3://$S3_BUCKET_WEST
78-
fi
73+
74+
# clear_s3_bucket <S3CMD_CONFIG> <BUCKET_ROOT>
75+
function clear_s3_bucket() {
76+
s3cmd -c $1 ls s3://$2 | grep $IMAGE_NAME
77+
if [ $? -eq 0 ]; then
78+
s3cmd -c $1 -r del s3://$2
79+
fi
80+
}
81+
#s3cmd -c $S3CMD_CONFIG ls s3://$S3_BUCKET_ROOT | grep $IMAGE_NAME
82+
#if [ $? -eq 0 ]; then
83+
# s3cmd -c $S3CMD_CONFIG -r del s3://$S3_BUCKET
84+
#fi
85+
clear_s3_bucket $S3CMD_CONFIG $S3_BUCKET_ROOT
86+
clear_s3_bucket $S3CMD_CONFIG_EU $S3_BUCKET_ROOT_EU
7987

8088
if [ -z $SKIP_UPLOAD ]; then
8189
# upload the bundle
8290
ec2-upload-bundle --retry -b $S3_BUCKET -m $IMAGE_MANIFEST -a $S3_ACCESS_KEY -s $S3_SECRET_KEY
8391
check_rc $? "ec2-upload-bundle"
8492

85-
ec2-migrate-bundle --retry -a $S3_ACCESS_KEY -s $S3_SECRET_KEY -b $S3_BUCKET -m `basename $IMAGE_MANIFEST` -d $S3_BUCKET_WEST --location us-west-1
93+
# migrate to us west
94+
#ec2-migrate-bundle --retry -a $S3_ACCESS_KEY -s $S3_SECRET_KEY -b $S3_BUCKET -m `basename $IMAGE_MANIFEST` -d $S3_BUCKET_WEST --location us-west-1
95+
#check_rc $? "ec2-migrate-bundle $S3_BUCKET to us-west-1"
96+
97+
# migrate to eu west
98+
ec2-migrate-bundle --retry -a $S3_ACCESS_KEY -s $S3_SECRET_KEY -b $S3_BUCKET -m `basename $IMAGE_MANIFEST` -d $S3_BUCKET_EU --location eu-west-1
8699
check_rc $? "ec2-migrate-bundle $S3_BUCKET to us-west-1"
87100
fi
88101

@@ -111,5 +124,6 @@ function register_ami() {
111124
if [ -z $SKIP_REGISTER ]; then
112125
# register the ami
113126
register_ami $S3_BUCKET us-east-1
114-
register_ami $S3_BUCKET_WEST us-west-1
127+
#register_ami $S3_BUCKET_WEST us-west-1
128+
register_ami $S3_BUCKET_EU eu-west-1
115129
fi

aws/s3-dev.properties

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
S3_USER=372029072695
22
S3_BUCKET_ROOT=s3.dev.suite.opengeo.org
33
S3_BUCKET_ROOT_WEST=s3.us-west.dev.suite.opengeo.org
4+
S3_BUCKET_ROOT_EU=s3.eu-west.dev.suite.opengeo.org
45
S3_ACCESS_KEY=AKIAIEIFXZRDU4AY5B3Q
56
S3_SECRET_KEY=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

aws/s3-prod.properties

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
S3_USER=431117387956
22
S3_BUCKET_ROOT=s3.prod.suite.opengeo.org
33
S3_BUCKET_ROOT_WEST=s3.us-west.prod.suite.opengeo.org
4+
S3_BUCKET_ROOT_EU=s3.eu-west.prod.suite.opengeo.org
45
S3_ACCESS_KEY=AKIAI7SFU3MT3R5WKHSA
56
S3_SECRET_KEY=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

aws/s3cfg-dev.eu-west

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[default]
2+
access_key = AKIAIEIFXZRDU4AY5B3Q
3+
bucket_location = eu-west-1
4+
cloudfront_host = cloudfront.amazonaws.com
5+
cloudfront_resource = /2010-07-15/distribution
6+
default_mime_type = binary/octet-stream
7+
delete_removed = False
8+
dry_run = False
9+
encoding = UTF-8
10+
encrypt = False
11+
follow_symlinks = False
12+
force = False
13+
get_continue = False
14+
gpg_command = None
15+
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
16+
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
17+
gpg_passphrase =
18+
guess_mime_type = True
19+
host_base = s3.amazonaws.com
20+
host_bucket = %(bucket)s.s3.amazonaws.com
21+
human_readable_sizes = False
22+
list_md5 = False
23+
log_target_prefix =
24+
preserve_attrs = True
25+
progress_meter = True
26+
proxy_host =
27+
proxy_port = 0
28+
recursive = False
29+
recv_chunk = 4096
30+
reduced_redundancy = False
31+
secret_key = LbEM4l6xxqHiJUY6Kb6eHyvl3Ryn3ItefAz02mnd
32+
send_chunk = 4096
33+
simpledb_host = sdb.amazonaws.com
34+
skip_existing = False
35+
socket_timeout = 10
36+
urlencoding_mode = normal
37+
use_https = False
38+
verbosity = WARNING

aws/s3cfg-prod.eu-west

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[default]
2+
access_key = AKIAI7SFU3MT3R5WKHSA
3+
bucket_location = eu-west-1
4+
cloudfront_host = cloudfront.amazonaws.com
5+
cloudfront_resource = /2010-07-15/distribution
6+
default_mime_type = binary/octet-stream
7+
delete_removed = False
8+
dry_run = False
9+
encoding = UTF-8
10+
encrypt = False
11+
follow_symlinks = False
12+
force = False
13+
get_continue = False
14+
gpg_command = None
15+
gpg_decrypt = %(gpg_command)s -d --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
16+
gpg_encrypt = %(gpg_command)s -c --verbose --no-use-agent --batch --yes --passphrase-fd %(passphrase_fd)s -o %(output_file)s %(input_file)s
17+
gpg_passphrase =
18+
guess_mime_type = True
19+
host_base = s3.amazonaws.com
20+
host_bucket = %(bucket)s.s3.amazonaws.com
21+
human_readable_sizes = False
22+
list_md5 = False
23+
log_target_prefix =
24+
preserve_attrs = True
25+
progress_meter = True
26+
proxy_host =
27+
proxy_port = 0
28+
recursive = False
29+
recv_chunk = 4096
30+
reduced_redundancy = False
31+
secret_key = aKbeL+akiq069+k8FFScdKXTogTwb8ZnXjD4yObq
32+
send_chunk = 4096
33+
simpledb_host = sdb.amazonaws.com
34+
skip_existing = False
35+
socket_timeout = 10
36+
urlencoding_mode = normal
37+
use_https = False
38+
verbosity = WARNING

0 commit comments

Comments
 (0)