ruby - Why does capistrano abort during deploy? -
my first day capistrano, , i'm total ruby noob. when run cap production deploy
get: (about half-way down you'll see "cap aborted!")
debug uploading /tmp/git-ssh.sh 0.0% info uploading /tmp/git-ssh.sh 100.0% info [a4358a68] running /usr/bin/env chmod +x /tmp/git-ssh.sh on 205.149.129.67 debug [a4358a68] command: /usr/bin/env chmod +x /tmp/git-ssh.sh info [a4358a68] finished in 0.094 seconds command successful. info [7e2d6b30] running /usr/bin/env git ls-remote git@github.com:johnnyfreeman/ng-phrases-node.git on 205.149.129.67 debug [7e2d6b30] command: ( git_askpass=/bin/echo git_ssh=/tmp/git-ssh.sh /usr/bin/env git ls-remote git@github.com:johnnyfreeman/ng-phrases-node.git ) debug [7e2d6b30] 870ca21b256ec53ffba50da1d8ecf7cb4c36e561 debug [7e2d6b30] debug [7e2d6b30] head debug [7e2d6b30] debug [7e2d6b30] 870ca21b256ec53ffba50da1d8ecf7cb4c36e561 debug [7e2d6b30] debug [7e2d6b30] refs/heads/master debug [7e2d6b30] info [7e2d6b30] finished in 2.289 seconds command successful. info [982c4c8c] running /usr/bin/env mkdir -pv /home/deploy/ng-phrases-node/shared /home/deploy/ng-phrases-node/releases on 205.149.129.67 debug [982c4c8c] command: /usr/bin/env mkdir -pv /home/deploy/ng-phrases-node/shared /home/deploy/ng-phrases-node/releases info [982c4c8c] finished in 1.084 seconds command successful. debug [b52bf507] running /usr/bin/env [ -f /home/deploy/ng-phrases-node/repo/head ] on 205.149.129.67 debug [b52bf507] command: [ -f /home/deploy/ng-phrases-node/repo/head ] debug [b52bf507] finished in 1.151 seconds command successful. info repository mirror @ /home/deploy/ng-phrases-node/repo debug [5a6d473a] running /usr/bin/env if test ! -d /home/deploy/ng-phrases-node/repo; echo "directory not exist '/home/deploy/ng-phrases-node/repo'" 1>&2; false; fi on 205.149.129.67 debug [5a6d473a] command: if test ! -d /home/deploy/ng-phrases-node/repo; echo "directory not exist '/home/deploy/ng-phrases-node/repo'" 1>&2; false; fi debug [5a6d473a] finished in 1.022 seconds command successful. info [ebde0a3b] running /usr/bin/env git remote update on 205.149.129.67 debug [ebde0a3b] command: cd /home/deploy/ng-phrases-node/repo && /usr/bin/env git remote update debug [ebde0a3b] fetching origin debug [ebde0a3b] info [ebde0a3b] finished in 1.485 seconds command successful. debug [42faf760] running /usr/bin/env if test ! -d /home/deploy/ng-phrases-node/repo; echo "directory not exist '/home/deploy/ng-phrases-node/repo'" 1>&2; false; fi on 205.149.129.67 debug [42faf760] command: if test ! -d /home/deploy/ng-phrases-node/repo; echo "directory not exist '/home/deploy/ng-phrases-node/repo'" 1>&2; false; fi debug [42faf760] finished in 1.195 seconds command successful. info [7c34b6a2] running /usr/bin/env git clone --branch master --depth 1 --recursive --no-hardlinks /home/deploy/ng-phrases-node/repo /home/deploy/ng-phrases-node/releases/20130807190743 on 205.149.129.67 debug [7c34b6a2] command: cd /home/deploy/ng-phrases-node/repo && ( git_askpass=/bin/echo git_ssh=/tmp/git-ssh.sh /usr/bin/env git clone --branch master --depth 1 --recursive --no-hardlinks /home/deploy/ng-phrases-node/repo /home/deploy/ng-phrases-node/releases/20130807190743 ) debug [7c34b6a2] warning: --depth ignored in local clones; use file:// instead. debug [7c34b6a2] debug [7c34b6a2] cloning '/home/deploy/ng-phrases-node/releases/20130807190743'... debug [7c34b6a2] debug [7c34b6a2] done. debug [7c34b6a2] info [7c34b6a2] finished in 0.259 seconds command successful. info [e945e1c7] running /usr/bin/env rm -rf /home/deploy/ng-phrases-node/current on 205.149.129.67 debug [e945e1c7] command: /usr/bin/env rm -rf /home/deploy/ng-phrases-node/current info [e945e1c7] finished in 1.062 seconds command successful. info [51d6629e] running /usr/bin/env ln -s /home/deploy/ng-phrases-node/releases/20130807190743 /home/deploy/ng-phrases-node/current on 205.149.129.67 debug [51d6629e] command: /usr/bin/env ln -s /home/deploy/ng-phrases-node/releases/20130807190743 /home/deploy/ng-phrases-node/current info [51d6629e] finished in 0.074 seconds command successful. cap aborted! filter `(no filter)` remove matching servers /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/configuration/servers.rb:73:in `filtered_servers' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/configuration/servers.rb:53:in `filter' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/configuration/servers.rb:48:in `fetch_roles' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/configuration/servers.rb:17:in `roles_for' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/configuration.rb:41:in `roles_for' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/dsl/env.rb:39:in `roles' /home/johnny/projects/ng-phrases-node/capfile:30:in `block (2 levels) in <top (required)>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/dsl.rb:14:in `invoke' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/tasks/deploy.rake:18:in `block (2 levels) in <top (required)>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/dsl.rb:14:in `invoke' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/tasks/framework.rake:66:in `block (2 levels) in <top (required)>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/tasks/framework.rake:65:in `each' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/tasks/framework.rake:65:in `block in <top (required)>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/lib/capistrano/application.rb:12:in `run' /home/johnny/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.0.0.pre14/bin/cap:3:in `<top (required)>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load' /home/johnny/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>' /home/johnny/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `eval' /home/johnny/.rvm/gems/ruby-2.0.0-p247/bin/ruby_noexec_wrapper:14:in `<main>' tasks: top => deploy:restart (see full trace running task --trace)
i'm not sure problem here , don't see in docs capistrano , filters.
not sure other information relevant know here, if i've left out please let me know.
thanks!
capistrano 3's deploy task depends on task named deploy:restart. unlike other tasks in default deploy flow, behaviour of deploy:restart isn't predefined you; need customize depending on applications server use. when run cap install
skeleton task created edit in capfile looks this.
desc 'restart application' task :restart on roles(:app), in: :sequence, wait: 5 # restart mechanism here, example: # execute :touch, release_path.join('tmp/restart.txt') end end
on roles(:app)
tells capistrano execute method on servers gave app role in config/deploy/production.rb. think didn't assign servers role, capistrano complaining doesn't have anywhere run task. now, modify task run on role. however, predefined tasks related linked files , directories refer app role, if started using them (e.g. database.yml) capistrano throw error again. thus, think better choice give server app role.
Comments
Post a Comment