如何继续使用Accurev和Capistrano 3?

时间:2022-10-15 07:24:33

We use AccuRev (and I cannot change that) and have been deploying with Capistrano 2. I need to upgrade to Capistrano 3, but it seems that the Accurev SCM module has been removed. Is there a way I can continue to use AccuRev and deploy with Capistrano 3?

我们使用AccuRev(我无法改变这一点),并一直与Capistrano 2一起部署。我需要升级到Capistrano 3,但是似乎Accurev SCM模块已经被删除了。是否有办法继续使用AccuRev并与Capistrano 3一起部署?

deploy.rb piece

部署。rb块

set :scm, :accurev

Deployment error

部署错误

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

2 个解决方案

#1


2  

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

正如Capistrano3文档所言——只有git、hg和svn支持。

But it should not be so hard to port old accurev module from Capistrano 2 to Capistrano 3. Some classes changed but core is same - functions have to return proper commands with proper parameters.

但是将旧的accurev模块从Capistrano 2移植到Capistrano 3应该不会太难。有些类发生了更改,但核心是相同的——函数必须返回带有适当参数的正确命令。

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

您可以从master的git实现开始,然后用AccuRev替换它。

#2


0  

The workaround I am using since one year is the following:

我用了一年的时间做了以下工作:

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

1-编辑文件capistrand -3.3.5/lib/capistrano/setup。rb和替换

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

by

通过

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

2- Add in your config/deploy.rb file

2-添加配置/部署。rb文件

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

That will give to capistrano a chance to open the configuration schema of accurev. Note that capistrano v3 changed its syntax, and you may have to modify accurev files (I suggest then to duplicate them in your lib folder).

这将使capistrano有机会打开accurev的配置模式。注意,capistrano v3改变了它的语法,您可能需要修改accurev文件(我建议您在lib文件夹中复制它们)。

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

直接编辑gem文件内容很难看,但是这里没有其他方法。如果您愿意,您也可以为他们提供git,并在您的fork上进行修改。

I have a similar problem because I am using custom-made scm in capistrano. Tried to get them to accept a pull request to add this scm_path configuration option since last year but they refuse, saying that they will migrate to something better soon ...

我有一个类似的问题,因为我在capistrano使用定制的scm。自去年以来,他们试图让他们接受添加scm_path配置选项的拉取请求,但他们拒绝了,说他们很快就会迁移到更好的地方……

#1


2  

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

正如Capistrano3文档所言——只有git、hg和svn支持。

But it should not be so hard to port old accurev module from Capistrano 2 to Capistrano 3. Some classes changed but core is same - functions have to return proper commands with proper parameters.

但是将旧的accurev模块从Capistrano 2移植到Capistrano 3应该不会太难。有些类发生了更改,但核心是相同的——函数必须返回带有适当参数的正确命令。

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

您可以从master的git实现开始,然后用AccuRev替换它。

#2


0  

The workaround I am using since one year is the following:

我用了一年的时间做了以下工作:

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

1-编辑文件capistrand -3.3.5/lib/capistrano/setup。rb和替换

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

by

通过

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

2- Add in your config/deploy.rb file

2-添加配置/部署。rb文件

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

That will give to capistrano a chance to open the configuration schema of accurev. Note that capistrano v3 changed its syntax, and you may have to modify accurev files (I suggest then to duplicate them in your lib folder).

这将使capistrano有机会打开accurev的配置模式。注意,capistrano v3改变了它的语法,您可能需要修改accurev文件(我建议您在lib文件夹中复制它们)。

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

直接编辑gem文件内容很难看,但是这里没有其他方法。如果您愿意,您也可以为他们提供git,并在您的fork上进行修改。

I have a similar problem because I am using custom-made scm in capistrano. Tried to get them to accept a pull request to add this scm_path configuration option since last year but they refuse, saying that they will migrate to something better soon ...

我有一个类似的问题,因为我在capistrano使用定制的scm。自去年以来,他们试图让他们接受添加scm_path配置选项的拉取请求,但他们拒绝了,说他们很快就会迁移到更好的地方……