How can I continue to use Accurev with Capistrano 3?

We are using AccuRev (and I cannot change that) and deployed from Capistrano 2. I need to upgrade to Capistrano 3 but it seems that the Accurev SCM has been removed. Is there a way I can continue to use AccuRev and deploy from Capistrano 3?

deploy.rb

set :scm, :accurev

      

Deployment error

cap aborted!
LoadError: cannot load such file -- capistrano/accurev.rb

      

+3


source to share


2 answers


As the Capistrano3 documentation says - there is only git, hg and svn support.

But it is not that difficult to port the old accurev module from Capistrano 2 to Capistrano 3. Some classes have changed, but the core is the same - functions must return the correct commands with the appropriate parameters.



You can start by implementing git from master and replace it with AccuRev.

+2


source


The workaround that I have been using since one year is the following:

1 - Edit the capistrano-3.3.5 / lib / capistrano / setup.rb file and replace

load "capistrano/#{fetch(:scm)}.rb"

      

by

load "#{fetch(:scm_path, 'capistrano')}/#{fetch(:scm)}.rb"

      



2 - Add to file config / deploy.rb

set :scm_path, 'path/to/accurev/directory'

      

This will give capistrano the ability to open the accurev config schema. Note that capistrano v3 has changed its syntax and you may have to modify the accurev files (I suggest then duplicating them in your lib folder).

It's ugly to edit the contents of the gem file directly, but there is no other way here. You can also unblock them with git and do the modification on your fork if you like.

I have a similar problem because I am using a custom scm in capistrano. Tried getting them to accept a pull request to add this config option scm_path

from last year, but they refuse, saying they will be moving to something better soon ...

0


source







All Articles