Skip to content

Instantly share code, notes, and snippets.

@kastner
Forked from caseybecking/gist:1130632
Created August 7, 2011 18:48
Show Gist options
  • Save kastner/1130642 to your computer and use it in GitHub Desktop.
Save kastner/1130642 to your computer and use it in GitHub Desktop.
deployinator multiple deployments
module Deployinator
module Stacks
module Boilerplate
def boilerplate_production_version
# %x{curl http://my-app.com/version.txt}
"cf44aab-20110729-230910-UTC"
end
def boilerplate_head_build
# the build version you're about to push
# %x{git ls-remote #{your_git_repo_url} HEAD | cut -c1-7}.chomp
"11666e3"
end
def boilerplate_production(options={})
log_and_stream "Fill in the boilerplate_production method in stacks/boilerplate.rb!<br>"
# log the deploy
log_and_shout :old_build => environments[1][:current_build].call, :build => environments[1][:next_build].call
end
def boilerplate_development_version
# %x{curl http://my-app.com/version.txt}
"cf44aab-20110729-230910-UTC"
end
def boilerplate_head_build
# the build version you're about to push
# %x{git ls-remote #{your_git_repo_url} HEAD | cut -c1-7}.chomp
"11666e3"
end
def boilerplate_development(options={})
log_and_stream "Fill in the boilerplate_development method in stacks/boilerplate.rb!<br>"
# log the deploy
log_and_shout({
:old_build => environments[0][:current_build].call, :build => environments[0][:next_build],
:env => environments[0][:name]
})
end
def boilerplate_environments
[
{
:title => "Push to development",
:name => "development",
:method => "#{stack}_development",
:current_version => send(:"#{stack}_development_version"),
:current_build => proc{Version.get_build(send(:"#{stack}_development_version"))},
:next_build => boilerplate_head_build
},
{
:title => "Push to production!",
:name => "production",
:method => "#{stack}_production",
:current_version => send(:"#{stack}_production_version"),
:current_build => proc{Version.get_build(send(:"#{stack}_production_version"))},
:next_build => proc{Version.get_build(send(:"#{stack}_development_version"))},
}
]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment