Gitslave support for Capistrano 3
require 'capistrano/gitslave-strategy'
gem 'capistrano-gitslave'
set :scm, :git
set :git_strategy, Capistrano::Git::SlaveStrategy
You .gitslave file must reference the absolute link to the repostory, contrary to the advice on the .gitslave instructions.
I couldn't work out a way to keep relative urls without having to redefine your slave repositorys in the Capistrano configuration. See the TODO section below for some ideas on this.
The process might look something like this
- Override Capistrano::Git#repo_path to be `File.join(context.repo_path, 'master')
- Archive master's .gitslave file into a tmp location
- Read it for details on required repos
- Run clone and update on these slave repos into `File.join(context.repo_path, slave_repo)
Gitslave is probably a bit heavy for what we need when deploying, and we could save ourselves the hassel of installing it. Once we have all the slave repositories mirrored on the machine, we simply need to archive each of them into the release path based on the master's .gitslave file.
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
== Copyright
Copyright (c) 2014 Trak.io Ltd