Last active
December 19, 2015 15:29
-
-
Save hpatoio/5976877 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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