lib/mascherano/tasks/env.cap in mascherano-1.1.0 vs lib/mascherano/tasks/env.cap in mascherano-1.2.0

- old
+ new

@@ -2,34 +2,36 @@ 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') } + 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 roles(fetch(:env_roles)) 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 roles(fetch(:env_roles)) 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_target, -> { shared_path.join('.env') } + 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'