SORU
26 AĞUSTOS 2008, Salı


Dağıtma Capistrano Gıt bir alt

Ana dal benim düzen böyle

/&;-- üst düzey lt

/istemci&;-- masaüstü istemcisi kaynak dosyaları lt

/server<-- Raylar app

Yapmak istediğim şey deploy.rb ama ben /server dizini bunu yapmak için herhangi bir yol bulamadım aşağı çekin. İstemci /dizin / / sunucu kopyası için bir kanca ayarlama çok iyi çalışmaz, sadece Raylar app aşağı çekme ihtiyacı çok büyük.

CEVAP
12 Ocak 2010, Salı


Herhangi bir kirli değildi ama eylem olmadan bile daha kirli !

Benim config/dağıtmak.rb :

set :deploy_subdir, "project/subdir"

O zaman benim Capfile için bu yeni strateji ekledim :

require 'capistrano/recipes/deploy/strategy/remote_cache'

class RemoteCacheSubdir < Capistrano::Deploy::Strategy::RemoteCache

  private

  def repository_cache_subdir
    if configuration[:deploy_subdir] then
      File.join(repository_cache, configuration[:deploy_subdir])
    else
      repository_cache
    end
  end

  def copy_repository_cache
    logger.trace "copying the cached version to #{configuration[:release_path]}"
    if copy_exclude.empty? 
      run "cp -RPp #{repository_cache_subdir} #{configuration[:release_path]} && #{mark}"
    else
      exclusions = copy_exclude.map { |e| "--exclude=\"#{e}\"" }.join(' ')
      run "rsync -lrpt #{exclusions} #{repository_cache_subdir}/* #{configuration[:release_path]} && #{mark}"
    end
  end

end


set :strategy, RemoteCacheSubdir.new(self)

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Bryan Adams

    Bryan Adams

    30 Mart 2006
  • Cole Rolland

    Cole Rolland

    23 Kasım 2008
  • Dion Coulls

    Dion Coulls

    16 AĞUSTOS 2006