From c9f645bb5cbf44ae860fb0e844d98ae423997468 Mon Sep 17 00:00:00 2001 From: Luke Barratt Date: Sun, 23 Mar 2014 00:56:13 +0000 Subject: [PATCH] Improve install log Remove unused files Update .env.example --- .env.sample => .env.example | 5 +++-- .gitignore | 3 ++- .ruby-version | 1 - INSTALL.md | 10 ++++++++++ config/deploy.rb | 24 ++++++++++++++++-------- 5 files changed, 31 insertions(+), 12 deletions(-) rename .env.sample => .env.example (91%) delete mode 100644 .ruby-version diff --git a/.env.sample b/.env.example similarity index 91% rename from .env.sample rename to .env.example index dd3e343..1637654 100644 --- a/.env.sample +++ b/.env.example @@ -1,8 +1,9 @@ +RAILS_ENV= +APP_SECRET= + UNICORN_WORKERS=3 UNICORN_PORT=5000 UNICORN_SOCKET=/tmp/unicorn.ensl.sock -APP_SECRET= - MYSQL_USERNAME= MYSQL_PASSWORD= diff --git a/.gitignore b/.gitignore index 66465ef..70dcf78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ -# Rails, etc +# Rails, Ruby, etc /coverage/ /log/* /tmp/* /spec/tmp/* +.ruby-version .env .tmp* .rspec diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index 3e3c2f1..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.1.1 diff --git a/INSTALL.md b/INSTALL.md index d523066..9655712 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -21,6 +21,16 @@ Add the following to `/etc/sudoers` to allow the `deploy` user to manage nginx a deploy ALL=NOPASSWD:START_FOREMAN deploy ALL=NOPASSWD:/etc/init.d/nginx +## Install MySQL + + sudo apt-get install mysql-server mysql-client libmysqlclient-dev + +Login to mysql as root, and create the database and user account: + + CREATE DATABASE `ensl`; + CREATE USER 'xxx'@'localhost' IDENTIFIED BY 'xxx'; + GRANT ALL PRIVILEGES ON ensl.* TO 'xxx'@'localhost' WITH GRANT OPTION; + ## Install rbenv, ruby and bundler As root, install dependencies diff --git a/config/deploy.rb b/config/deploy.rb index c7fe707..ea2669d 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -24,22 +24,30 @@ end namespace :foreman do desc "Export the Procfile to Ubuntu's upstart scripts" - task :export, :roles => :app do - run "cd #{current_path} && #{sudo} foreman export upstart /etc/init -a #{app_name} -u #{user} -l #{fetch(:deploy_to)}/shared/log" + task :export do + on roles(:app) do |host| + run "cd #{current_path} && #{sudo} foreman export upstart /etc/init -a #{app_name} -u #{user} -l #{fetch(:deploy_to)}/shared/log" + end end desc "Start the application services" - task :start, :roles => :app do - run "#{sudo} service #{app_name} start" + task :start do + on roles(:app) do |host| + run "#{sudo} service #{app_name} start" + end end desc "Stop the application services" - task :stop, :roles => :app do - run "#{sudo} service #{app_name} stop" + task :stop do + on roles(:app) do |host| + run "#{sudo} service #{app_name} stop" + end end desc "Restart the application services" - task :restart, :roles => :app do - run "#{sudo} service #{app_name} start || #{sudo} service #{app_name} restart" + task :restart do + on roles(:app) do |host| + run "#{sudo} service #{app_name} start || #{sudo} service #{app_name} restart" + end end end \ No newline at end of file