Sha256: 489890299ffaa2697e616365176fd0531f281e5bacee0f373eee7d443d3ad0c7

Contents?: true

Size: 675 Bytes

Versions: 2

Compression:

Stored size: 675 Bytes

Contents

module Capistrano
  module Env
    module Plugin
      def use
        config = Capistrano::Env::Config.new
        yield(config)
        add config
        config
      end

      def add(config)
        namespace :deploy do
          namespace :capenv do
            task :copy do
              parent.parent.upload StringIO.new(config.capenv_content), "#{fetch(:current_path)}/#{config.capenv_file}"
            end
          end
        end
        after 'deploy:finalize_update', 'deploy:capenv:copy'
        before 'deploy:restart', 'deploy:capenv:copy'
      end
    end
  end
end

Capistrano.plugin :capenv, Capistrano::Env::Plugin if Capistrano.respond_to?(:plugin)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-env-0.0.3 lib/capistrano/env/plugin.rb
capistrano-env-0.0.2 lib/capistrano/env/plugin.rb