これについていくつかの記事がありますが、私はElastic BeanstalkにRailsアプリケーションをデプロイし、デプロイメントプロセスでdelayed_jobを開始しようとしていますが、これはまだ動作するようにしてください。デーモンタスクとして実行されているdelayed_jobでアプリケーションをデプロイする
コマンド::私は.ebextensionsフォルダに設定ファイルを設定しようとしました
作成ポスト-DIR: コマンド: "MKDIRは/ opt/elasticbeanstalk /フック/ appdeploy /ポスト" ignoreErrorsがします:真
ファイル: "/opt/elasticbeanstalk/hooks/appdeploy/post/restart_delayed_job.sh": モード: "000755" 所有者:ルート グループ:ルート 内容:| #!は/ usr/binに/のenv bashの
# Loading environment data
EB_APP_USER=$(/opt/elasticbeanstalk/bin/get-config container -k app_user)
EB_APP_DEPLOY_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir)
EB_APP_PID_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_pid_dir)
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
EB_SUPPORT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k support_dir)
# Export EB_APP_LOG_DIR so we can access it when running bin/delayed_job below,
# which accesses config/initializers/delayed_job.rb, which uses EB_APP_LOG_DIR.
export EB_APP_LOG_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_log_dir)
# Make sure the delayed_job.log exists and is owned by $EB_APP_USER
touch $EB_APP_LOG_DIR/delayed_job.log
chown $EB_APP_USER:$EB_APP_USER $EB_APP_LOG_DIR/delayed_job.log
# Setting up correct environment and ruby version so that bundle can load all gems
. $EB_SUPPORT_DIR/envvars
. $EB_SCRIPT_DIR/use-app-ruby.sh
# Now we can do the actual restart of the worker. Make sure to have double quotes when using env vars in the command.
# For Rails 4, replace script/delayed_job with bin/delayed_job
cd $EB_APP_DEPLOY_DIR
su -s /bin/bash -c "bundle exec bin/delayed_job --pid-dir=$EB_APP_PID_DIR restart" $EB_APP_USER
su -s /bin/bash -c "bundle exec bin/delayed_job --pid-dir=$EB_APP_PID_DIR status" $EB_APP_USER
仕事にこれを取得してすべてのヘルプは大歓迎です!
これですべての運(デーモンを再起動休憩ため、と)それぞれの新しい展開に削除されるよう