Commit f3aa802a authored by Florian Staudacher's avatar Florian Staudacher

remove capistrano from the main source code repo

capistrano deployment scripts will be maintained in a separate deployment repo
parent 19206fb6
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
# Precompile assets in deployment (for Capistrano >= 2.8.0)
load 'deploy/assets' if respond_to?(:namespace)
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
......@@ -23,14 +23,14 @@ To update do the following:
3. Start Resque web (you'll need temporary access to port 5678, check
your Firewall if needed!):
```
bundle exec resque-web
```
In case you need it you can adjust the port with the `-p` flag.
4. One last time, start a Resque worker:
```
RAILS_ENV=production QUEUE=* bundle exec rake resque:work
```
......@@ -38,7 +38,7 @@ To update do the following:
Visit Resque web via http://your_host:5678, wait until all queues but the
failed one are empty (show 0 jobs).
5. Kill the Resque worker by hitting Ctrl+C. Kill Resque web with:
```
bundle exec resque-web -k
```
......@@ -87,6 +87,14 @@ We're automatically adjusting the ActiveRecord connection pool size for you.
Larger Heroku setups should have enough expertise to figure out what to do
by them self.
### Removal of Capistrano
The Capistrano deployment scripts were removed from the main source code
repository, since they were no longer working.
They will be moved into their own repository with a new maintainer,
you'll be able to find them under the Diaspora* Github organization once
everything is set up.
### Other
* Cleaned up requires of our own libraries [#3993](https://github.com/diaspora/diaspora/pull/3993)
......
......@@ -148,22 +148,17 @@ group :production do # we don't install these on travis to speed up test runs
end
group :development do
# Deployment
gem 'capistrano', '2.12.0', :require => false
gem 'capistrano_colors', '0.5.5', :require => false
# Comparison images
gem 'rmagick', '2.13.2', :require => false
# Automatic test runs
gem 'guard-cucumber', '1.3.2'
gem 'guard-rspec', '2.5.1'
gem 'rb-fsevent', '0.9.3', :require => false
gem 'rb-inotify', '0.9.0', :require => false
# Preloading environment
gem 'guard-spork', '1.5.0'
......@@ -176,13 +171,13 @@ group :test do
gem 'fixture_builder', '0.3.5'
gem 'fuubar', '1.1.0'
gem 'rspec-instafail', '0.2.4', :require => false
# Cucumber (integration tests)
gem 'capybara', '1.1.3'
gem 'database_cleaner', '0.9.1'
gem 'selenium-webdriver', '2.31.0'
# General helpers
gem 'factory_girl_rails', '4.2.1'
......@@ -194,10 +189,10 @@ end
group :development, :test do
# RSpec (unit tests, some integration tests)
gem "rspec-rails", '2.13.0'
# Cucumber (integration tests)
gem 'cucumber-rails', '1.3.1', :require => false
# Jasmine (client side application tests (JS))
gem 'jasmine', '1.3.2'
end
......@@ -45,13 +45,6 @@ GEM
bootstrap-sass (2.2.2.0)
sass (~> 3.2)
builder (3.0.4)
capistrano (2.12.0)
highline
net-scp (>= 1.0.0)
net-sftp (>= 2.0.0)
net-ssh (>= 2.0.14)
net-ssh-gateway (>= 1.1.0)
capistrano_colors (0.5.5)
capybara (1.1.3)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
......@@ -172,7 +165,6 @@ GEM
sprockets (>= 2.0.3)
tilt
hashie (1.2.0)
highline (1.6.12)
hike (1.2.1)
http_accept_language (1.0.2)
httpauth (0.2.0)
......@@ -225,11 +217,7 @@ GEM
nested_form (0.3.1)
net-scp (1.1.0)
net-ssh (>= 2.6.5)
net-sftp (2.0.5)
net-ssh (>= 2.0.9)
net-ssh (2.6.6)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
nokogiri (1.5.9)
oauth (0.4.7)
oauth2 (0.8.0)
......@@ -428,8 +416,6 @@ DEPENDENCIES
addressable (= 2.3.3)
asset_sync (= 0.5.4)
bootstrap-sass (= 2.2.2.0)
capistrano (= 2.12.0)
capistrano_colors (= 0.5.5)
capybara (= 1.1.3)
carrierwave (= 0.8.0)
client_side_validations (= 3.2.2)
......
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
set :config_yaml, YAML.load_file(File.dirname(__FILE__) + '/deploy_config.yml')
require './config/cap_colors'
require 'bundler/capistrano'
require './config/boot'
require 'airbrake/capistrano'
set :bundle_dir, ''
set :stages, ['production', 'staging']
set :default_stage, 'staging'
require 'capistrano/ext/multistage'
set :application, 'diaspora'
set :scm, :git
set :use_sudo, false
set :scm_verbose, true
set :repository_cache, "remote_cache"
set :deploy_via, :checkout
set :bundle_without, [:development, :test, :heroku]
# Figure out the name of the current local branch
def current_git_branch
branch = `git symbolic-ref HEAD 2> /dev/null`.strip.gsub(/^refs\/heads\//, '')
logger.info "Deploying branch #{branch}"
branch
end
namespace :deploy do
task :symlink_config_files do
run "ln -s -f #{shared_path}/config/database.yml #{current_path}/config/database.yml"
run "ln -s -f #{shared_path}/config/diaspora.yml #{current_path}/config/diaspora.yml"
end
task :symlink_cookie_secret do
run "ln -s -f #{shared_path}/config/initializers/secret_token.rb #{current_path}/config/initializers/secret_token.rb"
end
task :bundle_static_assets do
run "cd #{current_path} && bundle exec rake assets:precompile"
end
task :restart do
thins = capture_svstat "/service/thin*"
matches = thins.split("\n").inject([]) do |list, line|
m = line.match(/(thin_\d+):/)
list << m.captures[0] unless m.nil?
end
matches.each_with_index do |thin, index|
unless index == 0
puts "sleeping for 20 seconds"
sleep(20)
end
svc "-t /service/#{thin}"
end
svc "-t /service/resque_worker*"
end
task :kill do
svc "-k /service/thin*"
svc "-k /service/resque_worker*"
end
task :start do
svc "-u /service/thin*"
svc "-u /service/resque_worker*"
end
task :stop do
svc "-d /service/thin*"
svc "-d /service/resque_worker*"
end
desc 'Copy resque-web assets to public folder'
task :copy_resque_assets do
target = "#{release_path}/public/resque-jobs"
run "cp -r `cd #{release_path} && bundle show resque`/lib/resque/server/public #{target}"
end
end
before 'deploy:update' do
set :branch, current_git_branch
end
after 'deploy:symlink' do
deploy.symlink_config_files
deploy.symlink_cookie_secret
deploy.bundle_static_assets
deploy.copy_resque_assets
end
def maybe_sudo(cmd)
"#{svc_sudo ? sudo : ''} #{cmd}"
end
def svc(opts)
run(maybe_sudo("svc #{opts}"))
end
def capture_svstat(opts)
capture(maybe_sudo("svstat #{opts}"))
end
set :config, config_yaml['production']
set :deploy_to, config['deploy_to']
set :current_dir, config['current_dir']
set :rails_env, config['rails_env']
set :user, config['user']
if config['password']
set :password, config['password']
end
if config['branch']
set :branch, config['branch']
end
set :repository, config['repo']
server config['server'], :app, :web, :db, :primary => true
set :svc_sudo, (config['svc_sudo'] || false)
default_run_options[:pty] = true if svc_sudo
set :config, config_yaml['staging']
set :deploy_to, config['deploy_to']
set :current_dir, config['current_dir']
set :rails_env, config['rails_env']
set :user, config['user']
if config['password']
set :password, config['password']
end
if config['branch']
set :branch, config['branch']
end
set :repository, config['repo']
server config['server'], :app, :web, :db, :primary => true
set :svc_sudo, (config['svc_sudo'] || false)
default_run_options[:pty] = true if svc_sudo
# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
production:
server: 'example.com'
deploy_to: '/var/www/diaspora'
current_dir: 'diaspora'
user: 'diaspora'
password: 'password'
rails_env: 'production'
repo: 'git://github.com/diaspora/diaspora.git'
#set svc_sudo to true if you want to run scv and svstat with sudo. default: false
svc_sudo: false
staging:
server: 'staging.example.com'
deploy_to: '/var/www/diaspora'
current_dir: 'diaspora'
user: 'diaspora'
password: 'password'
rails_env: 'staging'
repo: 'git://github.com/diaspora/diaspora.git'
svc_sudo: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment