Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created January 22, 2015 11:22
Show Gist options
  • Save rummelonp/c2e74b29190c828309ab to your computer and use it in GitHub Desktop.
Save rummelonp/c2e74b29190c828309ab to your computer and use it in GitHub Desktop.
capistrano 3 でサブディレクトリをデプロイするやつ
require 'capistrano/git'
class Capistrano::Git
module SubDirectoryStrategy
include DefaultStrategy
def release
git :archive, fetch(:branch), fetch(:project_root), '| tar -x -C', release_path, "--strip=#{fetch(:project_root).count('/')+1}"
end
end
end
set :git_strategy, Capistrano::Git::SubDirectoryStrategy
set :project_root, 'front'
set :git_strategy, Capistrano::Git::SubDirectoryStrategy
set :project_root, 'server'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment