Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use relative path for logs as the script runs in the staging directory #221

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 30 additions & 31 deletions .ebextensions/sidekiq_permissions.config
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
commands:
create_log_dir:
command: "mkdir -p /var/app/current/log"
create_post_dir:
command: "mkdir -p /opt/elasticbeanstalk/hooks/appdeploy/post"
ignoreErrors: true
files:
"/opt/elasticbeanstalk/hooks/appdeploy/post/40_chmod_logs.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
. /opt/elasticbeanstalk/support/envvars

SIDEKIQ_LOG=$EB_APP_DEPLOY_DIR/log/sidekiq.log
SIDEKIQ_LOG=log/sidekiq.log

case $RACK_ENV in
"integration")
RAILS_LOG=$EB_APP_DEPLOY_DIR/log/integration.log
;;
"staging")
RAILS_LOG=$EB_APP_DEPLOY_DIR/log/staging.log
;;
"production")
RAILS_LOG=$EB_APP_DEPLOY_DIR/log/production.log
;;
esac
case $RACK_ENV in
"integration")
RAILS_LOG=log/integration.log
;;
"staging")
RAILS_LOG=log/staging.log
;;
"production")
RAILS_LOG=log/production.log
;;
esac

echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
echo ' '
echo 'SIDEKIQ_LOG='+$SIDEKIQ_LOG
echo 'RAILS_LOG='+$RAILS_LOG
echo ' '
echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'

sudo touch $SIDEKIQ_LOG
sudo chmod 0664 $SIDEKIQ_LOG
sudo touch $RAILS_LOG
sudo chmod 0664 $RAILS_LOG
echo '===================== Log Locations ====================='
echo ' '
echo 'SIDEKIQ_LOG='$SIDEKIQ_LOG
echo 'RAILS_LOG='$RAILS_LOG
echo ' '
echo '========================================================='

touch $SIDEKIQ_LOG
chmod 0664 $SIDEKIQ_LOG
touch $RAILS_LOG
chmod 0664 $RAILS_LOG

container_commands:
run_chmod_logs:
Expand Down