-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheb-shell.sh
More file actions
executable file
·24 lines (18 loc) · 817 Bytes
/
eb-shell.sh
File metadata and controls
executable file
·24 lines (18 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env bash
#
# Run on AWS Elastic Beanstalk instance to get a shell that can execute rails commands
# for the deployed code.
#
# Run this script from the app dir (/var/app/current) as root (sudo ./eb-console.sh)
#
set -xe
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
EB_PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir)
EB_LOG_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir)
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_DEPLOY_DIR
su -s /bin/bash $EB_APP_USER