Created
March 7, 2012 13:18
-
-
Save 0xAhmed/1993054 to your computer and use it in GitHub Desktop.
deployinator
This file contains 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
module Deployinator | |
module Stacks | |
module Webtier | |
### Production environment methods | |
## current version deployed in production | |
def webtier_prod_version | |
# %x{curl http://my-app.com/version.txt} | |
"1.1" | |
end | |
## current build deployed in production, inferred from the version | |
def webtier_current_prod_build | |
"build-153" | |
end | |
## next build that is about to be deployed in production | |
def webtier_next_prod_build | |
"build-154" | |
end | |
# What the "deploy production" button actually does | |
def webtier_production(options={}) | |
log_and_stream "Fill in the webtier_production method in stacks/webtier.rb!<br>" | |
# log the deploy | |
log_and_shout :old_build => environments[0][:current_build].call, :build => environments[0][:next_build].call | |
end | |
### Staging environment methods | |
## current version deployed on staging | |
def webtier_staging_version | |
"1.4" | |
end | |
## current build deployed in staging, inferred from the version | |
def webtier_current_staging_build | |
"build-160" | |
end | |
## next build that is about to be deployed in staging | |
def webtier_next_staging_build | |
"build-161" | |
end | |
def webtier_environments | |
[ | |
{ | |
:title => "Push to staging", | |
:name => "staging", | |
:method => "qa_rsync", | |
:current_version => webtier_staging_version, | |
:current_build => webtier_current_staging_build, | |
:next_build => webtier_next_staging_build | |
}, | |
{ | |
:title => "Push to production", | |
:name => "production", | |
:method => "prod_rsync", | |
:current_version => webtier_prod_version, | |
:current_build => webtier_current_prod_build, | |
:next_build => webtier_next_prod_build | |
} | |
] | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
module Deployinator
module Stacks
module Webtier
end
end