Skip to content

Instantly share code, notes, and snippets.

@nicgrayson
Created December 9, 2014 21:12
Show Gist options
  • Save nicgrayson/df5534c152f6503071ed to your computer and use it in GitHub Desktop.
Save nicgrayson/df5534c152f6503071ed to your computer and use it in GitHub Desktop.
class CMSPromotionStrategy < PromotionStrategy
include SkippableYes
attr_reader :options
def initialize(env, shell, options)
@env = env
@shell = shell
@options = options
end
def before_alpha
@shell.say("Route all traffic to beta to deploy to alpha...", :green)
revert_or_continue?
end
def between_alpha_and_beta
@shell.say("Waiting for cms alpha to come up..")
revert_or_continue?
end
def before_beta
@shell.say("Routing traffic to alpha to deploy to beta...", :green)
revert_or_continue?
end
def after_beta
@shell.say("Route traffic to both.", :green)
revert_or_continue?
end
def revert_or_continue?
skippable_yes?("Should we rollback?")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment