Skip to content
Snippets Groups Projects
Commit 42493eef authored by Dmitry Fleytman's avatar Dmitry Fleytman Committed by Pekka Enberg
Browse files

release-ec2: Introduce AWS regions list parameter


Parameter --override-regions added

Signed-off-by: default avatarDmitry Fleytman <dmitry@daynix.com>
Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent ed690e4b
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,7 @@ PARAM_PRIVATE_ONLY="--private-ami-only" ...@@ -11,6 +11,7 @@ PARAM_PRIVATE_ONLY="--private-ami-only"
PARAM_INSTANCE="--instance-only" PARAM_INSTANCE="--instance-only"
PARAM_IMAGE="--override-image" PARAM_IMAGE="--override-image"
PARAM_VERSION="--override-version" PARAM_VERSION="--override-version"
PARAM_REGIONS="--override-regions"
print_help() { print_help() {
cat <<HLPEND cat <<HLPEND
...@@ -52,6 +53,7 @@ This script receives following command line arguments: ...@@ -52,6 +53,7 @@ This script receives following command line arguments:
$PARAM_VERSION <version string> - do not generate version based on repository, use specified string instead $PARAM_VERSION <version string> - do not generate version based on repository, use specified string instead
$PARAM_PRIVATE_ONLY - do not publish or replicate AMI - useful for pre-release build verification $PARAM_PRIVATE_ONLY - do not publish or replicate AMI - useful for pre-release build verification
$PARAM_INSTANCE - do not rebuild, upload existing image and stop afer instance creation - useful for development phase $PARAM_INSTANCE - do not rebuild, upload existing image and stop afer instance creation - useful for development phase
$PARAM_REGIONS <regions list> - replicate to specified regions only
HLPEND HLPEND
} }
...@@ -81,6 +83,10 @@ do ...@@ -81,6 +83,10 @@ do
DONT_BUILD=1 DONT_BUILD=1
shift shift
;; ;;
"$PARAM_REGIONS")
REGIONS_LIST=$2
shift 2
;;
"$PARAM_HELP") "$PARAM_HELP")
print_help print_help
exit 0 exit 0
...@@ -310,8 +316,20 @@ make_ami_private() { ...@@ -310,8 +316,20 @@ make_ami_private() {
$EC2_HOME/bin/ec2-modify-image-attribute $AMI_ID --launch-permission --remove all $* $EC2_HOME/bin/ec2-modify-image-attribute $AMI_ID --launch-permission --remove all $*
} }
list_regions() {
if test x"$REGIONS_LIST" = x""; then
$EC2_HOME/bin/ec2-describe-regions | ec2_response_value REGION REGION
else
for region in $REGIONS_LIST; do echo $region; done
fi
}
list_additional_regions() { list_additional_regions() {
$EC2_HOME/bin/ec2-describe-regions | ec2_response_value REGION REGION | grep -v $AWS_DEFAULT_REGION
list_regions | grep -v $AWS_DEFAULT_REGION
} }
get_own_ami_info() { get_own_ami_info() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment