Sha256: 0bcd63ef32f6428402ded018460e05945b23cd86eaa0de74159f4417fbf15c90

Contents?: true

Size: 841 Bytes

Versions: 3

Compression:

Stored size: 841 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do
  rails_root =
    case
      when defined?(RAILS_ROOT)
        RAILS_ROOT
      when defined?(Rails.root)
        Rails.root
      else
        nil
    end

  if rails_root.nil?
    Capistrano::Configuration.instance.load_paths.each do |load_path| 
      if test(?e, File.join(load_path, 'Capfile'))
        rails_root = File.expand_path(load_path)
        break
      end
    end
  end

  abort 'could not determine rails_root!' unless rails_root
        
  namespace :sekrets do
    task :upload_key do
    
      src = File.join(rails_root, '.sekrets.key')
      dst = File.join(deploy_to, 'current', '.sekrets.key')
      
      if test(?s, src)
        upload(src, dst, :recursive => true)
      end
    end
  end
  
  
  after('deploy:create_symlink', 'sekrets:upload_key')
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sekrets-1.7.0/lib/sekrets/capistrano.rb
sekrets-1.7.0 lib/sekrets/capistrano.rb
sekrets-1.6.0 lib/sekrets/capistrano.rb