Ticker

6/recent/ticker-posts

Elastic Beanstalk - RAILS - REDIS - SIDEKIQ


the only change in config files if you are using ubuntu

files:
  "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq":
    mode: "000755"
    content: |
      #!/bin/bash
      cd /var/app/current
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -TERM `cat /var/app/support/pids/sidekiq.pid`
        rm -rf /var/app/support/pids/sidekiq.pid
      fi
      . /opt/elasticbeanstalk/support/envvars.d/sysenv
      sleep 10

      bundle exec sidekiq \
        -e production \
        -P ~/sidekiq.pid \
        -C /var/app/current/config/sidekiq.yml \
        -L ~/sidekiq.log \
        -d
  "/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_sidekiq":
    mode: "000755"
    content: |
      #!/bin/bash
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -USR1 `cat /var/app/support/pids/sidekiq.pid`
      fi
  "/opt/elasticbeanstalk/support/conf/sidekiq.conf":
    mode: "000644"
    content: |
      description "Elastic Beanstalk Sidekiq Upstart Manager"
      cd /var/app/current
      ln -sf /var/app/current/log/sidekiq.log /var/app/containerfiles/logs/sidekiq.log
      if [ -f /var/app/support/pids/sidekiq.pid ]
      then
        kill -TERM `cat /var/app/support/pids/sidekiq.pid`
        rm -rf /var/app/support/pids/sidekiq.pid
      fi
      . /opt/elasticbeanstalk/support/envvars.d/sysenv
      sleep 10

      bundle exec sidekiq \
        -e production \
        -P ~/sidekiq.pid \
        -C /var/app/current/config/sidekiq.yml \
        -L ~/sidekiq.log \
        -d

files:
  "/etc/init/sidekiq.conf":
    mode: "120400"
    content: "/opt/elasticbeanstalk/support/conf/sidekiq.conf"
commands:
  reload_initctl_for_sidekiq:
    command: "sudo initctl reload-configuration"


Regards,
Pavan

Post a Comment

0 Comments