Giter Site home page Giter Site logo

fast_remote_cache's People

Contributors

jamis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fast_remote_cache's Issues

git reset --hard breaks the hard links

Although the copy.rb script will make the copy into the release directory fast, this time is actually just shifting to the git reset --hard command since it will break all the hard links, even for unchanged files. Breaking hard links equates to copying the file to replace the hard link.

Ideally this would be fixed in git, but as a workaround I found that git reset --mixed #{revision} && git checkout -f . checks out the files without breaking hard links, so actually speeds up deploys when using fast_remote_cache.

Adding the following to config/deploy.rb will speed up deploys by using avoid git reset --hard.

module FastGitSync
  def sync(revision, destination)
    git     = command
    remote  = origin
    branch  = head

    execute = []
    execute << "cd #{destination}"

    execute << "#{git} fetch #{verbose} #{remote} +#{branch}:refs/remotes/#{remote}/#{branch}"

    # Reset the git index
    execute << "#{git} reset #{verbose} --mixed #{revision}"

    # Checkout the index into the work tree
    execute << "#{git} checkout -f ."

    # Remove untracked files
    execute << "#{git} clean #{verbose} -d -x -f"

    execute.join(" && ")
  end
end

set(:source) { Capistrano::Deploy::SCM.new(scm, self).extend(FastGitSync) }

Some conditions from sync where removed for brevity. See the original source for the sync method for details.

Any thoughts on how this change should be integrated into fast_remote_cache?

No such file or directory -- /data/myapp/shared/bin/copy.rb (LoadError)

Trying to use fast_remote_cache for the first time, I get:

    copying the cached version to /data/myapp/releases/20100317102524
  * executing "ruby /data/myapp/shared/bin/copy.rb /data/myapp/shared/cached-copy /data/myapp/releases/20100317102524 test doc && (echo 211ffbb4792233899a947d745fb89e14d0d0374b > /data/myapp/releases/20100317102524/REVISION)"
    servers: ["myhost.com"]
    [myhost.com] executing command
 ** [out :: myhost.com] ruby:
 ** [out :: myhost.com] No such file or directory -- /data/myapp/shared/bin/copy.rb (LoadError)
    command finished

I'm on ruby 1.8.7, Capistrano 2.5.18, Rails 2.3.5 with the proper line in my Capfile. I added:

set :deploy_via,          :fast_remote_cache
set :copy_exclude,        %w(test doc)

to my config/deploy.rb

Here is the full deploy log: https://gist.github.com/1931a5a675becab7a13d

Why is it running "git ls-remote"? Isn't that superseded by fast_remote_cache?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.