Last active
November 22, 2017 09:48
Revisions
-
jtadeulopes revised this gist
Mar 17, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -95,6 +95,6 @@ end end before 'deploy:assets:precompile', 'db:symlink' before 'deploy:assets:precompile', 'deploy:assets:install' before 'deploy:setup', 'db:configure' -
jtadeulopes revised this gist
Mar 13, 2014 . 1 changed file with 48 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,23 +35,66 @@ end namespace :assets do desc 'Install asset dependencies' task :install, roles: :app do run "cd #{latest_release} && bower install --no-color" end end end namespace :log do namespace :tail do desc "Show the production log" task :app, roles: :app do run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| puts "#{data}" break if stream == :err end end end end namespace :db do desc "Create database yaml in shared path" task :configure do set :database do Capistrano::CLI.password_prompt "Database: " end set :database_username do Capistrano::CLI.password_prompt "Database Username: " end set :database_password do Capistrano::CLI.password_prompt "Database Password: " end set :database_host do Capistrano::CLI.password_prompt "Database Host: " end db_config = <<-EOF production: database: #{database} adapter: mysql2 encoding: utf8 reconnect: false pool: 5 username: #{database_username} password: #{database_password} host: #{database_host} EOF run "mkdir -p #{shared_path}/config" put db_config, "#{shared_path}/config/database.yml" end desc "Make symlink for database yaml" task :symlink do run "ln -nfs #{shared_path}/config/database.yml #{latest_release}/config/database.yml" end end before 'deploy:assets:precompile', 'deploy:assets:install' before 'deploy:setup', 'db:configure' after 'deploy:update_code', 'db:symlink' -
jtadeulopes revised this gist
Mar 13, 2014 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,7 +22,7 @@ task :seed do run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" end namespace :web do desc "Present a maintenance page to visitors" task :disable, :roles => :web, :except => { :no_release => true } do @@ -33,8 +33,17 @@ put template, "#{shared_path}/system/maintenance.html", :mode => 0644 end end namespace :assets do desc 'install asset dependencies' task :install, roles: :app do run "cd #{latest_release} && bower install --no-color" end end end before 'deploy:assets:precompile', 'deploy:assets:install' namespace :log do namespace :tail do desc "Tail no log da aplicação em produção" -
jtadeulopes revised this gist
Feb 21, 2014 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,17 @@ task :seed do run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" end namespace :web do desc "Present a maintenance page to visitors" task :disable, :roles => :web, :except => { :no_release => true } do on_rollback { run "rm #{shared_path}/system/maintenance.html" } template = File.read("./public/503.html") put template, "#{shared_path}/system/maintenance.html", :mode => 0644 end end end namespace :log do -
jtadeulopes revised this gist
Nov 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ task :start do ; end task :stop do ; end task :restart, :roles => :app, :except => { :no_release => true } do run "touch #{shared_path}/#{application}-restart.txt" end desc "Reload the database with seed data" -
jtadeulopes revised this gist
Nov 1, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ 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','project-restart.txt')}" end desc "Reload the database with seed data" -
jtadeulopes revised this gist
Nov 1, 2013 . 1 changed file with 0 additions and 20 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,24 +34,4 @@ end end end end -
jtadeulopes revised this gist
Nov 1, 2013 . 1 changed file with 20 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -34,4 +34,24 @@ end end end end namespace :puma do desc "Start Puma" task :start, :except => { :no_release => true } do run "sudo start #{application}" end after "deploy:start", "puma:start" desc "Stop Puma" task :stop, :except => { :no_release => true } do run "sudo stop #{application}" end after "deploy:stop", "puma:stop" desc "Restart Puma" task :restart, roles: :app do run "sudo restart #{application}" end after "deploy:restart", "puma:restart" end -
jtadeulopes created this gist
Oct 31, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ set :repository, "git@bitbucket.org:repo/repo.git" set :user, "deploy" set :use_sudo, false set :scm, :git set :keep_releases, 5 set :domain, "000.000.000.000" set :application, "my_app" set :rails_env, "production" set :branch, "master" set :deploy_to, "/var/www/#{application}" set :port, 22 server domain, :app, :web, :db, :primary => true 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 desc "Reload the database with seed data" task :seed do run "cd #{current_path}; bundle exec rake db:seed RAILS_ENV=#{rails_env}" end end namespace :log do namespace :tail do desc "Tail no log da aplicação em produção" task :app, roles: :app do run "tail -f #{shared_path}/log/production.log" do |channel, stream, data| puts "#{data}" break if stream == :err end end end end