require 'capistrano/setup'
require 'capistrano/deploy'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }set :application, 'odpf'
set :repo_url, 'g...@github.com:myrepo/myapp.git'
set :branch, 'production_1.01'
set :deploy_to, '/var/www/odpf'
set :pty, false
set :scm, :git
set :format, :pretty
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# l'exemple correspond à ce qu'il faut pour restart passenger :
# http://www.modrails.com/documentation/Users%20guide%20Apache.html#_redeploying_restarting_the_ruby_on_rails_application
execute :mkdir, '-p', "#{release_path}/tmp"
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# Conformément à : http://guides.rubyonrails.org/v3.2.14/command_line.html#tmp
within release_path do
execute :rake, 'tmp:cache:clear'
end
end
end
# Create symlink to database.yml after publication
before 'deploy:published', 'db_access:create_symlinks'
after :finishing, 'deploy:cleanup'
endset :stage, :production
server 'myserver.net', user: 'rvm_admin', roles: %w{web app db}
set :ssh_options, { forward_agent: true, port: 8888 }
INFO [0a0dbcb0] Running /usr/bin/env rake tmp:cache:clear on phisa-odpf-vd.vserver.nimag.net
DEBUG [0a0dbcb0] Command: cd /var/www/odpf/releases/20140129101515 && /usr/bin/env rake tmp:cache:clear
DEBUG [0a0dbcb0] /usr/bin/env: rake
DEBUG [0a0dbcb0] : Aucun fichier ou dossier de ce type
cap aborted!
rake stdout: Nothing written
rake stderr: Nothing written
/home/douglas/.rvm/gems/ruby-2.1.0@rails3/gems/sshkit-1.0.0/lib/sshkit/command.rb:94:in `exit_status='
/home/douglas/.rvm/gems/ruby-2.1.0@rails3/gems/sshkit-1.0.0/lib/sshkit/backends/netssh.rb:125:in `block (4 levels) in _execute'
/home/douglas/.rvm/gems/ruby-2.1.0@rails3/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `call'rvm_admin@myserver:/var/www/odpf/current$ bundle show rake
/usr/local/rvm/gems/ruby-2.1.0/gems/rake-10.1.1
rvm_admin@myserver:/var/www/odpf/current$ which rake
/usr/local/rvm/gems/ruby-2.1.0/bin/rake
SSHKit.config.command_map[:rake] = "./bin/rake"
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/58a8122b-a09f-47b7-add5-6fe395d812dd%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
#!/bin/bash -eecho '9e6386d53f5200a3e7069107405b93f7 ruby-2.1.0.tar.gz' > ruby-2.1.0.tar.gz.md5summd5sum -c ruby-2.1.0.tar.gz.md5sumsudo apt-get install -y bison openssl libreadline6 libreadline6-dev zlib1g \zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev \ncurses-dev libcurl4-openssl-dev libopenssl-ruby apache2-prefork-dev \libapr1-dev libaprutil1-dev libx11-dev libffi-dev tcl-dev tk-dev
tar -xf ruby-2.1.0.tar.gzunlink ruby-2.1.0.tar.gzcd ruby-2.1.0./configure --enable-silent-rulesmake V=0make testsudo make install
gem install bundler
Thanks for your answer Lee.Apart from my original question.About ruby intallation, I was considering about not using RVM, but as the ruby installation is so unclear to me, and didnt found a decent tutorial to install Ruby on a server, I had to rely on RVM.Morevoer, despite spending hours reading official sites and questioned on stackoverflow about how gemset works, Bunlder and Gems remain very obscure to me when. The most puzzeling thing is when you do acommand, and you see different versions of the same gem installed, then you realized that gems can be installed everwhere, and you feel really lost.gem listSo if you could provide me a good tutorial or procedure to build a running Ruby environnement onto a server, I would be glad to remove this RVM.That would be great !Good evening
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/6aa67823-024a-4fd4-8bc4-7712c0436917%40googlegroups.com.
SSHKit.config.command_map[:rake] = "bundle exec rake tmp:cache:clear"--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/53f49611-17d8-4c7b-81e4-fad8254a8bd1%40googlegroups.com.
I have a hard fast rule that you should never use rben, rvm or any other ruby switcher on production or staging boxes. Ruby switching is a developers tool. Use one and one only version of ruby on a remote box. If you have two apps that need to use different rubies, and you want to make them work on the same box. Invest the time required to make the code use the same version of ruby instead of futzing with a ruby switcher. If you can't make them use the same version of ruby, in these days of cloud computing, put the apps on different servers. If you are so hard up for hardware then use something like LXC to provide that isolation.
--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/68b01b4e-27df-434d-9245-f56f26acacf3%40googlegroups.com.