Skip to content

Instantly share code, notes, and snippets.

@hpatoio
Last active December 19, 2015 15:29
Show Gist options
  • Select an option

  • Save hpatoio/5976877 to your computer and use it in GitHub Desktop.

Select an option

Save hpatoio/5976877 to your computer and use it in GitHub Desktop.
set :stages, %w(staging prod)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
namespace :demo_task do
desc <<-DESC
Demo task
DESC
task :task, :roles => :app do
capifony_pretty_print "--> Demo task #{foo_var}"
// If I run the task for the environment where foo_var is defined the value of foo_var is printed correctly
/ otherwise I get an error message telling me that foo_var is nil (but this is not the problem)
// Do something for all environment
if defined?(foo_var)
// Do something only if foo_var is defined for the the environment
// This code is never executed
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment