You can always use if..elseif..end
as follows:
if fetch(:stage) == :production
...
elsif fetch(:stage) == :staging
...
end
Or, if you have staging and production only:
task :upload_config do
on roles(:all) do |host|
within fetch(:shared_path) do
upload! "#{fetch(:stage).to_s}-config.php", "#{fetch :shared_path}/#{fetch(:stage).to_s}-config.php"
end
end
end