Sha256: 981e781320d34dd92ae4167f020e3327a4c8ebc3ece50c60c1c8786e81e2b514

Contents?: true

Size: 1.12 KB

Versions: 35

Compression:

Stored size: 1.12 KB

Contents

Capistrano::Configuration.instance(:must_exist).load do
  # Maintains a second checkout SVN locally, then uses sftp to push.
  # This avoids the deployment target needing to have any direct
  # access to the source code repository.
  set :scm, :subversion
  set :deploy_via, :copy
  set :copy_strategy, :export
  set :copy_cache, 'tmp/deployment'
  set :copy_dir, 'tmp/staging'

  namespace :ndr_dev_support do
    desc 'Remove the SVN cache (it may be pointing at the wrong branch)'
    task :remove_svn_cache_if_needed do
      cache = fetch(:copy_cache)
      unless Dir.exist?(cache) && `svn info #{cache}`.include?(fetch(:repository))
        logger.debug "Cache is stale for #{fetch(:branch)}, wiping..."
        system("rm -rf #{cache}")
      end
    end

    desc 'Ensures compilation artefacts are removed from the compressed archive sent to the server'
    task :augment_copy_exclude do
      set :copy_exclude, (fetch(:copy_exclude) || []) + %w[node_modules tmp/*]
    end
  end

  before 'deploy:update_code', 'ndr_dev_support:augment_copy_exclude'
  before 'deploy:update_code', 'ndr_dev_support:remove_svn_cache_if_needed'
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ndr_dev_support-6.1.0 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-6.0.4 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-6.0.3 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-6.0.2 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-6.0.1 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-6.0.0 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.10.2 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.10.1 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.10.0 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.9.0 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.8.2 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.8.1 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.8.0 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.7.1 lib/ndr_dev_support/capistrano/svn_cache.rb
ndr_dev_support-5.7.0 lib/ndr_dev_support/capistrano/svn_cache.rb