# Taking advantage of scm for deployment

**URL:** <https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530>\
**Category:** Deployment\
**Created:** [June 15, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530 "2008-06-15T20:45:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 15, 2008, 8:45pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/1 "2008-06-15T20:45:19Z")

</div>

Using :export takes quite a long time, even for editing one file.

Is there a way to only push the difference, and not the entire trunk?

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 16, 2008, 1:20pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/2 "2008-06-16T13:20:38Z")

</div>

As far as I know there is no support for a “diferential” or “delta”  
deploymet.

Its an interesting idea, but seems complex.

–  
Aníbal Rojas

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 16, 2008, 7:42pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/3 "2008-06-16T19:42:01Z")

</div>

I disagree, why else would you have an scm option to begin with?  
The whole advantage of using it for a pull scenario is that you can  
just “svn up” the diff.

On Mon, Jun 16, 2008 at 4:19 AM, Aníbal Rojas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [http://anibal.rojas.com.ve](http://anibal.rojas.com.ve)

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 16, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/4 "2008-06-16T19:47:20Z")

</div>

A crude way of doing it would be to keep a svn/git copy in your prod  
server,  
run a update/pull and from the log/output figure out what files changed  
and  
copy only those files to the right places. Hope it helps,

AEM

On Sun, Jun 15, 2008 at 12:43 PM, Anthony E. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> [http://anthony.ettinger.name](http://anthony.ettinger.name)
> 
> >

–  
Adrian Esteban Madrid  
Lead Developer, Prefab Markets  
[http://www.prefabmarkets.com](http://www.prefabmarkets.com)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 16, 2008, 7:57pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/5 "2008-06-16T19:57:58Z")

</div>

I knew there had to be a better way already made. Gotta check out that  
option in Capistrano. haven’t read their docs in years seems like.

AEM

On Mon, Jun 16, 2008 at 11:49 AM, Jesse P. \<  
removed\_email\_address@domain.invalid\> wrote:

> Jesse P., Blue Box Group, LLC  
> [http://www.blueboxgrp.com](http://www.blueboxgrp.com)
> 
> >

–  
Adrian Esteban Madrid  
Lead Developer, Prefab Markets  
[http://www.prefabmarkets.com](http://www.prefabmarkets.com)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 16, 2008, 7:55pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/6 "2008-06-16T19:55:01Z")

</div>

> Using :export takes quite a long time, even for editing one file.
> 
> Is there a way to only push the difference, and not the entire trunk?

Using Capistrano 2, you can use the set :deploy\_via, :remote\_cache  
variable to have it keep a cached copy and just do an update and copy  
from that.

–

Jesse P., Blue Box Group, LLC  
[http://www.blueboxgrp.com](http://www.blueboxgrp.com)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 17, 2008, 12:58pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/7 "2008-06-17T12:58:26Z")

</div>

Anthony,

```
The problem is that there is not a one to one match with the

```

deployed application and the content of the SCM. Common deployment  
recipes involve symlinking, generating a version file, etc. Also,  
letting the .svn (in the Subversion case) files in releases/  
 is a security risk, most people sets capistrano to do a  
checkout losing the version metadata.

```
I understand your point, actually Bazaar has this concept:

$ bzr checkout --lightweight http://whatever

If this were going to be implemented the first thing to solve is

```

how to manage the releases/ folders, maybe copying the the  
previous release and generating the delta against the new version. I  
need to keep the ability to do rollbacks.

–  
Anibal

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 17, 2008, 8:16pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/8 "2008-06-17T20:16:19Z")

</div>

There’s a program called rsnapshot used for creating hourly backups,  
similar pattern may be applicable to deployments.

I’m currently using the :export option, which makes a duplicate of the  
entire tree (even if only 1 file has changed).

The rsnapshot perl script I’m referring to uses rsync to provide the  
delta and only copies files that have been changed, added, or removed.

It makes a hardlink of all existing files that have not been modified  
(saving on disk space) to create the rest of the un-modified tree.

The advantage is that a deploy could take a few seconds vs. several  
minutes, and save on disk space.

On Tue, Jun 17, 2008 at 3:57 AM, Aníbal Rojas [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> I understand your point, actually Bazaar has this concept:
> 
> > > deploymet.
> > > 
> > > > Using :export takes quite a long time, even for editing one file.

–  
Anthony E.  
408-656-2473  
[http://anthony.ettinger.name](http://anthony.ettinger.name)

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 22, 2008, 4:17am UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/9 "2008-06-22T04:17:27Z")

</div>

Please do investigate that. Sounds like it would make a great plugin  
for capistrano.

- Jamis

---

<div class="post-metadata">

**Author:** ![chovy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/ecd19e/32.png) [@chovy](https://www.ruby-forum.com/u/chovy)\
**Post date:** [June 17, 2008, 12:59pm UTC](https://www.ruby-forum.com/t/taking-advantage-of-scm-for-deployment/140530/10 "2008-06-17T12:59:37Z")

</div>

That’s it, thanks.

–  
Aníbal

On Jun 17, 12:49 pm, Jesse P. \<jesse.proudman-
