Capistrano 3 copy strategy equivalent

2019-04-05 18:26发布

I updated to Cap 3 and it appears that set :deploy_via, :copy is no longer supported. In the release annoucement there is a link to a video for replicating the copy strategy which currently returns a 404.

I used the :copy strategy because the server did not have access to git or access to the repository because it was behind a firewall.

What is the best way to replicate this functionality with v3?

3条回答
【Aperson】
2楼-- · 2019-04-05 19:08

You can use its gem - https://github.com/WildZero/capistrano-scm-tar-copy

set:

set :scm, :copy

set :include_dir, '/User/w1ldzer0/ExampleDir'

and go

查看更多
爷的心禁止访问
3楼-- · 2019-04-05 19:16

I ran into the same issue and posted a similar question on the capistrano google group.

See here: https://groups.google.com/forum/#!topic/capistrano/BRa4Vj1_mEo

Short answer: Write your own rake task.

The capistrano maintainer provided some example code, via a blog post on his website, that can be found here: http://lee.hambley.name/2013/06/11/using-capistrano-v3-with-chef.html

In the end, we've decided to go w/ a different strategy entirely, and implement a mirror repository on the same network as our servers.

查看更多
再贱就再见
4楼-- · 2019-04-05 19:19

There is one work in the exact same way

https://github.com/xuwupeng2000/capsitrano-scm-gitcopy

Capistrano 3 :copy

A copy strategy for Capistrano 3, which mimics the :copy scm of Capistrano 2. This Gem is inspired by and based on https://github.com/wercker/capistrano-scm-copy. Thank wercker so much.

This will make Capistrano tar the a specific git branch, upload it to the server(s) and then extract it in the release directory.

Usage

cap uat deploy -s branch=(your release branch)

查看更多
登录 后发表回答