pludoni-capistrano 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pludoni-capistrano.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Stefan Wienert
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,29 @@
1
+ # Pludoni::Capistrano
2
+
3
+ TODO: Write a gem description
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ gem 'pludoni-capistrano'
10
+
11
+ And then execute:
12
+
13
+ $ bundle
14
+
15
+ Or install it yourself as:
16
+
17
+ $ gem install pludoni-capistrano
18
+
19
+ ## Usage
20
+
21
+ TODO: Write usage instructions here
22
+
23
+ ## Contributing
24
+
25
+ 1. Fork it
26
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
27
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
28
+ 4. Push to the branch (`git push origin my-new-feature`)
29
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env rake
2
+ require "bundler/gem_tasks"
@@ -0,0 +1,7 @@
1
+ require "pludoni-capistrano/version"
2
+
3
+ module Pludoni
4
+ module Capistrano
5
+ # Your code goes here...
6
+ end
7
+ end
@@ -0,0 +1,6 @@
1
+ require 'bundler/capistrano'
2
+ # Add RVM's lib directory to the load ...path.
3
+ $:.unshift(File.expand_path('./lib', ENV['rvm_path']))
4
+ require "rvm/capistrano" # Load RVM's capistrano plugin.
5
+ require 'capistrano_colors'
6
+
@@ -0,0 +1,15 @@
1
+ require "pludoni-capistrano/setup"
2
+ Capistrano::Configuration.instance.load do
3
+ after "deploy:update_code", :symlink_db
4
+ after 'bundle:install', 'deploy:migrate'
5
+ after "deploy:setup", 'db_setup'
6
+
7
+ task :symlink_db do
8
+ run "ln -nfs #{shared_path}/db/production.sqlite3 #{release_path}/db/production.sqlite3"
9
+ end
10
+ task :db_setup, :roles => [:app, :db, :web] do
11
+ run <<-CMD
12
+ touch #{shared_path}/db/production.sqlite3
13
+ CMD
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance.load do
2
+ set :rails_env, "production" #added for delayed job
3
+ require "delayed/recipes"
4
+ set :delayed_job_args, "-n 1"
5
+ after "deploy:stop", "delayed_job:stop"
6
+ after "deploy:start", "delayed_job:start"
7
+ after "deploy:restart", "delayed_job:restart"
8
+ end
@@ -0,0 +1,8 @@
1
+ Capistrano::Configuration.instance.load do
2
+ folder = Dir.pwd
3
+ set :repository, "file://#{folder}"
4
+ set :local_repository, "file://."
5
+ role :web, "localhost" # Your HTTP server, Apache/etc
6
+ role :app, "localhost" # This may be the same as your `Web` server
7
+ role :db, "localhost", :primary => true # This is where Rails migrations will run
8
+ end
@@ -0,0 +1,9 @@
1
+ Capistrano::Configuration.instance.load do
2
+ namespace :deploy do
3
+ desc "build missing paperclip styles"
4
+ task :build_missing_paperclip_styles, :roles => :app do
5
+ run "cd #{release_path}; RAILS_ENV=production bundle exec rake paperclip:refresh:missing_styles"
6
+ end
7
+ end
8
+ after "deploy:update_code", "deploy:build_missing_paperclip_styles"
9
+ end
@@ -0,0 +1,10 @@
1
+ Capistrano::Configuration.instance.load do
2
+ namespace :deploy do
3
+ task :start do ; end
4
+ task :stop do ; end
5
+ task :restart, :roles => :app, :except => { :no_release => true } do
6
+ run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,12 @@
1
+ Capistrano::Configuration.instance.load do
2
+
3
+ set :mkdirs, %w[system db log] unless exists?(:mkdirs)
4
+ task :folder_setup, :roles => [:app, :db, :web] do
5
+ paths = mkdirs.map{|i| "#{shared_path}/#{i}"}.join(" ")
6
+ run <<-CMD
7
+ mkdir -p -m 775 #{release_path} #{paths}
8
+ CMD
9
+ end
10
+ after "deploy:setup", "folder_setup"
11
+
12
+ end
@@ -0,0 +1,15 @@
1
+ Capistrano::Configuration.instance.load do
2
+ set :test_log, "log/capistrano.test.log"
3
+ namespace :deploy do
4
+ before 'deploy:update_code' do
5
+ puts "--> Running tests, please wait ..."
6
+ unless system "bundle exec rspec > #{test_log} 2>&1" #' > /dev/null'
7
+ puts "--> Tests failed. Run `cat #{test_log}` to see what went wrong."
8
+ exit
9
+ else
10
+ puts "--> Tests passed"
11
+ system "rm #{test_log}"
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ Capistrano::Configuration.instance.load do
2
+
3
+ namespace :deploy do
4
+ task :new_sphinx, :roles => [:app] do
5
+ thinking_sphinx.stop
6
+ run "ln -nfs #{shared_path}/db/sphinx #{release_path}/db/sphinx"
7
+ thinking_sphinx.configure
8
+ #thinking_sphinx.start
9
+ end
10
+ end
11
+ require 'thinking_sphinx/deploy/capistrano'
12
+ after 'deploy:update_code', 'deploy:new_sphinx'
13
+ after 'deploy:update_code', 'thinking_sphinx:start'
14
+ after 'deploy:setup', 'thininking_sphinx:setup'
15
+ end
@@ -0,0 +1,24 @@
1
+ Capistrano::Configuration.instance.load do
2
+ namespace :thin do
3
+ desc "Start the Thin processes"
4
+ task :start do
5
+ run <<-CMD
6
+ cd #{current_path}; bundle exec thin start -C config/thin.yml
7
+ CMD
8
+ end
9
+ desc "Stop the Thin processes"
10
+ task :stop do
11
+ run <<-CMD
12
+ cd #{current_path}; bundle exec thin stop -C config/thin.yml
13
+ CMD
14
+ end
15
+ desc "Restart the Thin processes"
16
+ task :restart do
17
+ run <<-CMD
18
+ cd #{current_path}; bundle exec thin restart -C config/thin.yml
19
+ CMD
20
+ end
21
+
22
+ end
23
+ after 'deploy', "thin:restart"
24
+ end
@@ -0,0 +1,5 @@
1
+ module Pludoni
2
+ module Capistrano
3
+ VERSION = "0.0.1"
4
+ end
5
+ end
@@ -0,0 +1,19 @@
1
+ # -*- encoding: utf-8 -*-
2
+ require File.expand_path('../lib/pludoni-capistrano/version', __FILE__)
3
+
4
+ Gem::Specification.new do |gem|
5
+ gem.authors = ["Stefan Wienert"]
6
+ gem.email = ["stefan.wienert@pludoni.de"]
7
+ gem.description = %q{Some common tasks for capistrano}
8
+ gem.summary = %q{Some common tasks for capistrano}
9
+ gem.homepage = ""
10
+
11
+ gem.files = `git ls-files`.split($\)
12
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
13
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
14
+ gem.name = "pludoni-capistrano"
15
+ gem.require_paths = ["lib"]
16
+ gem.version = Pludoni::Capistrano::VERSION
17
+ gem.add_runtime_dependency "capistrano_colors"
18
+ gem.add_runtime_dependency "capistrano"
19
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pludoni-capistrano
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Stefan Wienert
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-06-29 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: capistrano_colors
16
+ requirement: &9460980 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: *9460980
25
+ - !ruby/object:Gem::Dependency
26
+ name: capistrano
27
+ requirement: &9459740 !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: *9459740
36
+ description: Some common tasks for capistrano
37
+ email:
38
+ - stefan.wienert@pludoni.de
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - .gitignore
44
+ - Gemfile
45
+ - LICENSE
46
+ - README.md
47
+ - Rakefile
48
+ - lib/pludoni-capistrano.rb
49
+ - lib/pludoni-capistrano/base.rb
50
+ - lib/pludoni-capistrano/database.rb
51
+ - lib/pludoni-capistrano/delayed_job.rb
52
+ - lib/pludoni-capistrano/local_deployment.rb
53
+ - lib/pludoni-capistrano/paperclip.rb
54
+ - lib/pludoni-capistrano/passenger.rb
55
+ - lib/pludoni-capistrano/setup.rb
56
+ - lib/pludoni-capistrano/specs.rb
57
+ - lib/pludoni-capistrano/sphinx.rb
58
+ - lib/pludoni-capistrano/thin.rb
59
+ - lib/pludoni-capistrano/version.rb
60
+ - pludoni-capistrano.gemspec
61
+ homepage: ''
62
+ licenses: []
63
+ post_install_message:
64
+ rdoc_options: []
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ! '>='
71
+ - !ruby/object:Gem::Version
72
+ version: '0'
73
+ required_rubygems_version: !ruby/object:Gem::Requirement
74
+ none: false
75
+ requirements:
76
+ - - ! '>='
77
+ - !ruby/object:Gem::Version
78
+ version: '0'
79
+ requirements: []
80
+ rubyforge_project:
81
+ rubygems_version: 1.8.15
82
+ signing_key:
83
+ specification_version: 3
84
+ summary: Some common tasks for capistrano
85
+ test_files: []