Sha256: 685c2113e1cf88c5321aa5fbc98f6bd9e3e91dfdfe60072c3f518514a5668858

Contents?: true

Size: 806 Bytes

Versions: 4

Compression:

Stored size: 806 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 :target_file, -> { shared_path.join('.env') }
  DESC
  task :upload do
    on roles(fetch(:env_roles)) 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 roles(fetch(:env_roles)) 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_target, -> { shared_path.join('.env') }
  end
end

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
mascherano-1.1.0 lib/mascherano/tasks/env.cap
mascherano-1.0.4 lib/mascherano/tasks/env.cap
mascherano-1.0.3 lib/mascherano/tasks/env.cap
mascherano-1.0.2 lib/mascherano/tasks/env.cap