It's only a guess, but I think it can work. As far as I can see the git strategy can be replaced via
set :git_strategy, MyMod
in you'r stage, deploy or cap file.
Now the interesting part is this in the strategy
def release
git :archive, fetch(:branch), '| tar -x -f - -C', release_path
end
in
Capistrano::Git::DefaultStrategy
a new Module can change this behavior
module MyMod
include Capistrano::Git::DefaultStrategy
def release
git :archive, fetch(:branch), '| tar -x -f -',' --strip', fetch(:levels_to_skip) ,' -C', release_path, fetch(:subfolder)
end
end
I didn't test it, but tar should support extraction of only one special folder (fetch(:subfolder)).
--strip or --strip-components=, throws n levels of the directory structure away