Fix the services restarting every time the recipe is executed
* Manually send a restart action from the application_git resource * Do not depend on application_ruby anymore
This commit is contained in:
parent
4b39ea60dd
commit
438c5ff72d
|
@ -10,8 +10,8 @@ depends "kosmos-nginx"
|
||||||
depends "kosmos-nodejs"
|
depends "kosmos-nodejs"
|
||||||
depends "kosmos-redis"
|
depends "kosmos-redis"
|
||||||
depends "poise-ruby-build"
|
depends "poise-ruby-build"
|
||||||
depends "application_ruby"
|
depends "application"
|
||||||
depends "application_javascript"
|
depends "application_git"
|
||||||
depends "postgresql"
|
depends "postgresql"
|
||||||
depends "kosmos-postgresql"
|
depends "kosmos-postgresql"
|
||||||
depends "backup"
|
depends "backup"
|
||||||
|
|
|
@ -128,7 +128,11 @@ application mastodon_path do
|
||||||
owner "mastodon"
|
owner "mastodon"
|
||||||
group "mastodon"
|
group "mastodon"
|
||||||
|
|
||||||
environment "HOME" => mastodon_path
|
# Take care of application restarts manually, in the git resource
|
||||||
|
action_on_update false
|
||||||
|
|
||||||
|
environment "HOME" => mastodon_path,
|
||||||
|
"PATH" => "/opt/ruby_build/builds/#{ruby_version}/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
|
||||||
|
|
||||||
ruby_runtime ruby_version do
|
ruby_runtime ruby_version do
|
||||||
provider :ruby_build
|
provider :ruby_build
|
||||||
|
@ -140,6 +144,8 @@ application mastodon_path do
|
||||||
group mastodon_user
|
group mastodon_user
|
||||||
repository "https://gitea.kosmos.org/kosmos/mastodon.git"
|
repository "https://gitea.kosmos.org/kosmos/mastodon.git"
|
||||||
revision "production"
|
revision "production"
|
||||||
|
# Restart services on deployments
|
||||||
|
notifies :restart, "application[#{mastodon_path}]", :delayed
|
||||||
end
|
end
|
||||||
|
|
||||||
mastodon_credentials = data_bag_item('credentials', 'mastodon')
|
mastodon_credentials = data_bag_item('credentials', 'mastodon')
|
||||||
|
@ -180,12 +186,6 @@ application mastodon_path do
|
||||||
command "yarn install --pure-lockfile"
|
command "yarn install --pure-lockfile"
|
||||||
end
|
end
|
||||||
|
|
||||||
rails do
|
|
||||||
migrate false
|
|
||||||
rails_env "production"
|
|
||||||
precompile_assets false # buggy, done manually below
|
|
||||||
end
|
|
||||||
|
|
||||||
execute 'rake db:migrate' do
|
execute 'rake db:migrate' do
|
||||||
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
|
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
|
||||||
user mastodon_user
|
user mastodon_user
|
||||||
|
@ -194,9 +194,6 @@ application mastodon_path do
|
||||||
command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake db:migrate"
|
command "PATH=\"/opt/ruby_build/builds/#{ruby_version}/bin:$PATH\" bundle exec rake db:migrate"
|
||||||
end
|
end
|
||||||
|
|
||||||
# This is the only way I could find that makes compiling the assets
|
|
||||||
# successfully for now. application_ruby's precompile_assets crashes because
|
|
||||||
# it cannot find the bundled gems
|
|
||||||
execute 'rake assets:precompile' do
|
execute 'rake assets:precompile' do
|
||||||
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
|
environment "RAILS_ENV" => "production", "HOME" => mastodon_path
|
||||||
user mastodon_user
|
user mastodon_user
|
||||||
|
|
Loading…
Reference in New Issue