Bonjour à tous.
Je suis nouveau sur ce forum. Je viens y poser ma question sous les conseils de Camille.
Cela fait quelques années que je n’ai pas fait de RoR et du coup je me suis pris quelques versions dans la tête. Je démarre un nouveau projet sous ROR 4 que je souhaite déployer avec Capistrano 3 sur un serveur mutualisé Dreamhost.
Après avoir installé Capistrano, configurer un dépot GIT sur Dreamhost, ma tentative de cap production deploy:setup --trace abouti à une erreur que je ne sais pas trop interpréter. Je suis un peu rouillé…
Voici la trace :
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
cap aborted!
Don't know how to build task 'deploy:setup'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/task_manager.rb:62:in `[]'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:149:in `invoke_task'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/Library/Ruby/Gems/2.0.0/gems/capistrano-3.2.1/lib/capistrano/application.rb:15:in `run'
/Library/Ruby/Gems/2.0.0/gems/capistrano-3.2.1/bin/cap:3:in `<top (required)>'
/usr/bin/cap:23:in `load'
/usr/bin/cap:23:in `<main>'
Voici le fichier config/deploy/production.rb :
# Simple Role Syntax
# ==================
# Supports bulk-adding hosts to roles, the primary server in each group
# is considered to be the first unless any hosts have the primary
# property set. Don't declare `role :all`, it's a meta role.
role :app, %w{[email protected]}
role :web, %w{[email protected]}
role :db, %w{[email protected]}
# Extended Server Syntax
# ======================
# This can be used to drop a more detailed server definition into the
# server list. The second argument is a, or duck-types, Hash and is
# used to set extended properties on the server.
server 'hlin.dreamhost.com', user: 'hfisselier', roles: %w{web app}, my_property: :my_value
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult[net/ssh documentation](http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start).
#
# Global options
# --------------
# set :ssh_options, {
# keys: %w(/home/rlisowski/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(password)
# }
#
# And/or per server (overrides global)
# ------------------------------------
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/user_name/.ssh/id_rsa),
# forward_agent: false,
# auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
Et le fichier config/deploy.rb :
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'snapdir'
set :repo_url, '[email protected]:/home/hfisselier/repo/snapdir.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
# Default deploy_to directory is /var/www/my_app
# set :deploy_to, '/var/www/my_app'
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :pretty
# set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
Des idées? Des pistes?