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

  • 8lacKy

    8lacKy

    30 Mart 2009
  • Official Android Tips

    Official And

    23 EYLÜL 2009
  • PorterRobinsonVEVO

    PorterRobins

    11 Kasım 2013