Skip to content
Snippets Groups Projects
Commit 0b527b3f authored by Allen Gilliland's avatar Allen Gilliland
Browse files

Merge pull request #776 from metabase/more_deploy_scripts

simple bash scripts for uploading EB versions and deploying them
parents bef8c998 f8cd3e83
Branches
Tags
No related merge requests found
#!/bin/bash
BASEDIR=$(dirname $0)
if [ -z $1 ]; then
echo "Oops! You need to specify the name of the EB app version to deploy."
exit 1
fi
APP_BUNDLE=$1
ENVIRONMENT=metabase-proto
# deploy EB version to environment
${BASEDIR}/deploy_version.sh ${APP_BUNDLE} ${ENVIRONMENT}
#!/bin/bash
BASEDIR=$(dirname $0)
if [ -z $1 ]; then
echo "Oops! You need to specify the name of the EB app version to deploy."
exit 1
fi
APP_BUNDLE=$1
ENVIRONMENT=metabase-staging
# deploy EB version to environment
${BASEDIR}/deploy_version.sh ${APP_BUNDLE} ${ENVIRONMENT}
#!/bin/bash
BASEDIR=$(dirname $0)
if [ -z $1 ]; then
echo "usage: deploy_version.sh <version> <environment>"
exit 1
fi
if [ -z $2 ]; then
echo "usage: deploy_version.sh <version> <environment>"
exit 1
fi
APP_BUNDLE=$1
ENVIRONMENT=$2
# upload app version to EB
# TODO: check if version already exists
${BASEDIR}/upload_version.sh ${APP_BUNDLE}
# deploy EB version to environment
aws elasticbeanstalk update-environment --region us-east-1 --environment-name ${ENVIRONMENT} --version-label ${APP_BUNDLE}
#!/bin/bash
if [ -z $1 ]; then
echo "Oops! You need to specify the name of the EB zip file to upload."
exit 1
fi
APP_BUNDLE=$1
UUID=$(cat /dev/urandom | env LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
S3_KEY="${UUID}_${APP_BUNDLE}.zip"
S3_BUCKET=elasticbeanstalk-us-east-1-867555200881
APPLICATION=Metabase
# upload bundle to s3
echo "Uploading app version to S3"
aws s3api put-object --bucket ${S3_BUCKET} --key ${S3_KEY} --body ${APP_BUNDLE}.zip
# create EB version
echo "Creating app version in EB"
aws elasticbeanstalk create-application-version --no-auto-create-application --region us-east-1 --application-name ${APPLICATION} --version-label ${APP_BUNDLE} --source-bundle S3Bucket="${S3_BUCKET}",S3Key="${S3_KEY}"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment