Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add capistrano for deployment.

  • Loading branch information...
commit 459aea7112dd015c5c376a1e2461c3614af38425 1 parent fad4276
@greggersh greggersh authored
View
2  .gitignore
@@ -14,3 +14,5 @@
/log/*.log
/tmp
/coverage
+/config/deploy.rb
+/config/database.yml
View
4 Capfile
@@ -0,0 +1,4 @@
+load 'deploy'
+# Uncomment if you are using Rails' asset pipeline
+load 'deploy/assets'
+load 'config/deploy' # remove this line to skip loading any of the default tasks
View
6 Gemfile
@@ -6,20 +6,20 @@ gem 'rails', '3.2.6'
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
+gem 'jquery-rails'
gem 'haml-rails'
gem 'httparty'
gem 'formtastic'
gem "cocoon"
+gem 'capistrano'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
-
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
-
gem 'uglifier', '>= 1.0.3'
end
@@ -35,8 +35,6 @@ group :test do
gem 'simplecov', :require => false
end
-gem 'jquery-rails'
-
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
View
15 Gemfile.lock
@@ -31,6 +31,12 @@ GEM
addressable (2.3.2)
arel (3.0.2)
builder (3.0.4)
+ capistrano (2.13.5)
+ highline
+ net-scp (>= 1.0.0)
+ net-sftp (>= 2.0.0)
+ net-ssh (>= 2.0.14)
+ net-ssh-gateway (>= 1.1.0)
capybara (2.0.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
@@ -62,6 +68,7 @@ GEM
activesupport (>= 3.1, < 4.1)
haml (~> 3.1)
railties (>= 3.1, < 4.1)
+ highline (1.6.15)
hike (1.2.1)
httparty (0.9.0)
multi_json (~> 1.0)
@@ -84,6 +91,13 @@ GEM
multi_json (1.3.7)
multi_xml (0.5.1)
mysql2 (0.3.11)
+ net-scp (1.0.4)
+ net-ssh (>= 1.99.1)
+ net-sftp (2.0.5)
+ net-ssh (>= 2.0.9)
+ net-ssh (2.6.2)
+ net-ssh-gateway (1.1.0)
+ net-ssh (>= 1.99.1)
nokogiri (1.5.5)
polyglot (0.3.3)
rack (1.4.1)
@@ -160,6 +174,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ capistrano
capybara
cocoon
coffee-rails (~> 3.2.1)
View
0  config/database.yml → config/database.yml.sample
File renamed without changes
View
38 config/deploy.rb.sample
@@ -0,0 +1,38 @@
+require 'bundler/capistrano'
+
+set :application, "mygov-forms"
+set :scm, "git"
+set :repository, "git@github.com:GSA-OCSIT/mygov-forms.git"
+# Use this if you're stuck behind a draconion VPN
+# set(:real_revision) { source.query_revision( revision ) { |cmd| capture(cmd) } }
+set :use_sudo, false
+set :deploy_via, :remote_cache
+
+set :user, "YOUR_DEPLOY_USERNAME"
+set :deploy_to, "/home/#{user}/#{application}"
+
+set :domain, "YOUR DOMAIN HERE"
+role :web, "#{domain}" # Your HTTP server, Apache/etc
+role :app, "#{domain}" # This may be the same as your `Web` server
+role :db, "#{domain}", :primary => true # This is where Rails migrations will run
+
+before 'deploy:assets:precompile', 'deploy:symlink_db'
+before "deploy:create_symlink", "deploy:web:disable"
+after "deploy:restart", "deploy:web:enable"
+after "deploy:restart", "deploy:cleanup"
+
+# 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
+
+namespace :deploy do
+ desc "Symlinks the database.yml"
+ task :symlink_db, :roles => :app do
+ run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.