Skip to content

Instantly share code, notes, and snippets.

@hiroosak
Created July 14, 2014 15:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiroosak/52e0570888134e689398 to your computer and use it in GitHub Desktop.
Save hiroosak/52e0570888134e689398 to your computer and use it in GitHub Desktop.
capistrano3のデプロイを把握する ref: http://qiita.com/taizo/items/afff46a260bd11588962
$ gem install capistrano
$ cap install
mkdir -p config/deploy
create config/deploy.rb
create config/deploy/staging.rb
create config/deploy/production.rb
mkdir -p lib/capistrano/tasks
Capified
$ cap staging deploy --dry-run
** Invoke staging (first_time)
** Execute (dry run) staging
** Invoke deploy (first_time)
** Execute (dry run) deploy
deploy:starting
deploy:check
#{scm}:check
deploy:check:directories
deploy:check:linked_dirs
deploy:check:make_linked_dirs
deploy:check:linked_files
deploy:set_previous_revision
deploy:started
deploy:updating
#{scm}:create_release
deploy:symlink:shared
deploy:symlink:linked_files
deploy:symlink:linked_dirs
deploy:updated
deploy:publishing
deploy:symlink:release
deploy:published
deploy:finishing
deploy:cleanup
deploy:finished
deploy:log_revision
deploy:starting
deploy:check
#{scm}:check
deploy:check:directories
deploy:check:linked_dirs
deploy:check:make_linked_dirs
deploy:check:linked_files
deploy:set_previous_revision
deploy:started
deploy:updating
#{scm}:create_release
deploy:symlink:shared
deploy:symlink:linked_files
deploy:symlink:linked_dirs
deploy:updated
deploy:compile_assets # 追加
deploy:assets:precompile # 追加
deploy:assets:backup_manifest # 追加
deploy:normalize_assets # 追加
deploy:publishing
deploy:symlink:release
deploy:published
deploy:finishing
deploy:cleanup
deploy:finished
deploy:log_revision
deploy:starting
deploy:check
#{scm}:check
deploy:check:directories
deploy:check:linked_dirs
deploy:check:make_linked_dirs
deploy:check:linked_files
deploy:set_previous_revision
deploy:started
deploy:updating
#{scm}:create_release
deploy:symlink:shared
deploy:symlink:linked_files
deploy:symlink:linked_dirs
deploy:updated
deploy:migrate # 追加
deploy:publishing
deploy:symlink:release
deploy:published
deploy:finishing
deploy:cleanup
deploy:finished
deploy:log_revision
deploy:starting
deploy:check
#{scm}:check
deploy:check:directories
deploy:check:linked_dirs
deploy:check:make_linked_dirs
deploy:check:linked_files
deploy:set_previous_revision
deploy:started
deploy:updating
#{scm}:create_release
deploy:symlink:shared
deploy:symlink:linked_files
deploy:symlink:linked_dirs
npm:install # 追加
deploy:updated
deploy:publishing
deploy:symlink:release
deploy:published
deploy:finishing
deploy:cleanup
deploy:finished
deploy:log_revision
namespace :npm do
desc <<-DESC
# 省略
DESC
task :install do # npm:install タスクを作成
on roles fetch(:npm_roles) do
within fetch(:npm_target_path, release_path) do
execute :npm, 'install', fetch(:npm_flags)
end
end
end
before 'deploy:updated', 'npm:install' # deploy:updateの前に npm:install を実行する
# ...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment