Created
August 4, 2014 01:45
-
-
Save wolfg1969/a7525384b71666b32661 to your computer and use it in GitHub Desktop.
create a eb environment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e | |
EB_CLI_HOME=$1 | |
APP_NAME=$2 | |
CONFIG_NAME=$3 | |
export AWS_CREDENTIAL_FILE=/var/lib/jenkins/.elasticbeanstalk/aws_credential_file | |
export PATH=$PATH:$EB_CLI_HOME/api/bin/ | |
d=`date +%_m%d` | |
d=${d%% } | |
d=${d## } | |
ENV_NAME="${APP_NAME}-prd-$d" | |
cat > options.txt <<EOF | |
[ | |
{"Namespace": "aws:elb:loadbalancer", | |
"OptionName": "LoadBalancerHTTPSPort", | |
"Value": "443"}, | |
{"Namespace": "aws:elb:loadbalancer", | |
"OptionName": "SSLCertificateId", | |
"Value": "arn:aws:iam::xxxxxxxx:server-certificate/Foo"} | |
] | |
EOF | |
elastic-beanstalk-create-environment -a "$APP_NAME" -l "sampleVersion" \ | |
-t "$CONFIG_NAME" -e "$ENV_NAME" -c "$ENV_NAME" -f options.txt | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment