Sha256: 704a27f8bb8c31c092a3a129b0637897c2c5b1b1664474369f2b5fb4b4d42730

Contents?: true

Size: 939 Bytes

Versions: 1

Compression:

Stored size: 939 Bytes

Contents

namespace :env do
  desc <<-DESC
    Upload env file to the server

    You can override any of these defaults by setting the variables shown below.

    set :env_file,     ".env"
    set :env_roles,    :all
    set :env_servers,  -> { release_roles(fetch(:env_roles)) }
    set :env_target,   -> { shared_path.join('.env') }
  DESC
  task :upload do
    on fetch(:env_servers) do
      upload! fetch(:env_file), fetch(:env_target)
    end
  end

  desc <<-DESC
    Symlink the .env file to the release_path
  DESC
  task :symlink do
    on fetch(:env_servers) do
      execute :ln, '-sf', fetch(:env_target), release_path.join('.env')
    end
  end
end

namespace :load do
  task :defaults do
    set :env_file,     ".env"
    set :env_roles,    :all
    set :env_servers,  -> { release_roles(fetch(:env_roles)) }
    set :env_target,   -> { shared_path.join('.env') }
  end
end

namespace :deploy do
  after :updating, 'env:symlink'
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mascherano-1.2.0 lib/mascherano/tasks/env.cap