From 9cdfeb4f52574d2b2ea169b1151615003c509adc Mon Sep 17 00:00:00 2001 From: Simon Tokumine Date: Thu, 30 Jun 2011 13:06:23 +0100 Subject: [PATCH] added initial capistrano files, and gem file --- Capfile | 2 -- Gemfile | 4 ++++ Gemfile.lock | 28 ++++++++++++++++++++++++++++ README.md | 13 ++++++++++--- TODO.md | 7 ------- config/deploy.rb | 27 +++++++-------------------- config/deploy/production.rb | 23 +++++++++++++++++++++++ 7 files changed, 72 insertions(+), 32 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 config/deploy/production.rb diff --git a/Capfile b/Capfile index d04de115..7faf486c 100644 --- a/Capfile +++ b/Capfile @@ -1,4 +1,2 @@ load 'deploy' if respond_to?(:namespace) # cap2 differentiator -Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } - load 'config/deploy' # remove this line to skip loading any of the default tasks \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..5c96f5e7 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source :gemcutter + +gem 'capistrano', '2.6.0' +gem 'capistrano-gitflow', '1.4.3' diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 00000000..5ab7e881 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,28 @@ +GEM + remote: http://rubygems.org/ + specs: + capistrano (2.6.0) + highline + net-scp (>= 1.0.0) + net-sftp (>= 2.0.0) + net-ssh (>= 2.0.14) + net-ssh-gateway (>= 1.1.0) + capistrano-gitflow (1.4.3) + capistrano + stringex + highline (1.6.2) + net-scp (1.0.4) + net-ssh (>= 1.99.1) + net-sftp (2.0.5) + net-ssh (>= 2.0.9) + net-ssh (2.1.4) + net-ssh-gateway (1.1.0) + net-ssh (>= 1.99.1) + stringex (1.2.1) + +PLATFORMS + ruby + +DEPENDENCIES + capistrano (= 2.6.0) + capistrano-gitflow (= 1.4.3) diff --git a/README.md b/README.md index ce00b158..c140bf71 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,6 @@ tests make test ``` - core requirements ------------- * pg_bouncer @@ -27,8 +26,16 @@ node.js dependencies --------------------- * npm -then to install dependencies from package.json: +To install dependencies from package.json: -``` npm install .``` +``` npm install``` + +deployment +---------- +* capistrano on ruby 1.9.2. + +To install dependencies from Gemfile: + +```bundle install``` diff --git a/TODO.md b/TODO.md index 4f8a1521..688e91e1 100644 --- a/TODO.md +++ b/TODO.md @@ -1,11 +1,4 @@ Prioritized todo ----------------- -Acceptance tests - DONE SSL - Do in NGINX -pg_bouncer/postgres pooling (test with Ab to get the errors below) -redis-pool - -psql solve: -* postgres "could not create socket" -* http://people.planetpostgresql.org/andrew/index.php?/archives/44-max_files_per_process-and-OS-limits.html diff --git a/config/deploy.rb b/config/deploy.rb index 0ce39d4a..cd5b9b14 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -1,22 +1,9 @@ -set :application, "set your application name here" -set :repository, "set your repository location here" +set :spinner_user, nil #weird hack +set :stages, %w(staging production) +require 'capistrano/ext/multistage' +require 'capistrano/ext/monitor' +require "bundler/capistrano" +require 'capistrano/gitflow' +ssh_options[:keys] = [File.join("config", "deploy", "ssh", "id-vizzuality.pem")] -set :scm, :subversion -# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` -role :web, "your web-server here" # Your HTTP server, Apache/etc -role :app, "your app-server here" # This may be the same as your `Web` server -role :db, "your primary db-server here", :primary => true # This is where Rails migrations will run -role :db, "your slave db-server here" - -# if you're still using the script/reaper helper you will need -# these http://github.com/rails/irs_process_scripts - -# If you are using Passenger mod_rails uncomment this: -# namespace :deploy do -# task :start do ; end -# task :stop do ; end -# task :restart, :roles => :app, :except => { :no_release => true } do -# run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" -# end -# end \ No newline at end of file diff --git a/config/deploy/production.rb b/config/deploy/production.rb new file mode 100644 index 00000000..2064d087 --- /dev/null +++ b/config/deploy/production.rb @@ -0,0 +1,23 @@ +# node deploy config + +# somehow we'll have to update this dynamically +set :host_1, "174.129.61.69" +role :app, [host_1] + +# repository +set :application, "node-sql-api" +set :repository, "git@github.com:tokumine/cartodb-sql-api.git" +set :scm, :git +#set :deploy_via, :remote_cache + +# deploy settings +set :node_file, "cluster.js" +set :deploy_to, "/home/ubuntu/www/#{application}" +set :user, "ubuntu" +set :runner, "ubuntu" +set :use_sudo, true + +default_run_options[:pty] = true + +#after "deploy:update_code", "deploy:link_production_db" +#after "deploy:symlink", "deploy:update_crontab"