install script fixes

This commit is contained in:
r888888888 2015-10-02 14:51:02 -07:00
parent 781fd8fda2
commit dd36da1a45
3 changed files with 33 additions and 4 deletions

View File

@ -91,8 +91,11 @@ sudo -u danbooru bash -l -c 'cd ~/danbooru ; bundle'
echo "* Creating a new local git branch called develop"
sudo -u danbooru bash -l -c 'cd ~/danbooru ; git checkout -b develop'
mkdir -p /var/www/danbooru2
chown danbooru:danbooru /var/www/danbooru2
mkdir -p /var/www/danbooru2/shared/config
mkdir -p /var/www/danbooru2/shared/data
sudo -u danbooru bash -l -c 'cp ~/danbooru/script/install/database.yml.templ /var/www/danbooru2/shared/config/database.yml'
sudo -u danbooru bash -l -c 'cp ~/danbooru/script/install/danbooru_local_config.rb.templ /var/www/danbooru2/shared/config/danbooru_local_config.rb'
chown -R danbooru:danbooru /var/www/danbooru2
echo "* Almost done! The code has been checked out at ~danbooru/danbooru. You can "
echo "* now login as the danbooru user and run the following commands to deploy to "

View File

@ -0,0 +1,25 @@
# Set your full path to application.
app_path = "/var/www/danbooru2/current"
# Set unicorn options
worker_processes 2
preload_app false
timeout 180
listen "127.0.0.1:9000"
# Spawn unicorn master worker for user apps (group: apps)
user 'danbooru', 'danbooru'
# Fill path to your app
working_directory app_path
# Should be 'production' by default, otherwise use other env
rails_env = ENV['RAILS_ENV'] || 'production'
# Log everything to one file
stderr_path "log/unicorn.log"
stdout_path "log/unicorn.log"
# Set master PID location
pid "#{app_path}/tmp/pids/unicorn.pid"

View File

@ -4,7 +4,9 @@ namespace :symlink do
on roles(:app) do
execute :ln, "-s", "#{deploy_to}/shared/config/danbooru_local_config.rb", "#{release_path}/config/danbooru_local_config.rb"
execute :ln, "-s", "#{deploy_to}/shared/config/database.yml", "#{release_path}/config/database.yml"
execute :ln, "-s", "#{deploy_to}/shared/config/newrelic.yml", "#{release_path}/config/newrelic.yml"
if test("[ -f #{deploy_to}/shared/config/newrelic.yml ]")
execute :ln, "-s", "#{deploy_to}/shared/config/newrelic.yml", "#{release_path}/config/newrelic.yml"
end
end
end
@ -13,7 +15,6 @@ namespace :symlink do
on roles(:app) do
execute :rm, "-f", "#{release_path}/public/data"
execute :ln, "-s", "#{deploy_to}/shared/data", "#{release_path}/public/data"
execute :mkdir, "-p", "#{release_path}/public/cache"
execute :mkdir, "-p", "#{deploy_to}/shared/system/cache"
execute :touch, "#{deploy_to}/shared/system/cache/tags.json"