Created
November 3, 2011 00:16
-
-
Save torrancew/1335394 to your computer and use it in GitHub Desktop.
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
##################################### | |
### Set up the deploy environment ### | |
##################################### | |
# Define the name of the "application" we're deploying | |
set :application, 'puppet-modules' | |
# Define the VCS platform | |
set :scm, :git | |
set :repository, '[email protected]:puppet-modules' | |
# Where to place the deployed files (and who to do it as) | |
set :deploy_to, '/usr/local/share/puppet/modules' | |
set :deploy_user, 'root' | |
# Define the puppet masters | |
# as a pure ruby hash of arrays | |
# the keys represent sites/branches | |
# and the vals represent the site's masters | |
puppetmasters = { | |
:fcdc => [ 'horsehead.company.org' ], | |
:lvdc => [ 'eagle.lv.company.org' ], | |
:sfdc => [ 'hetfield.sf.company.org' ] | |
} | |
############################### | |
### Define the deploy tasks ### | |
############################### | |
namespace :deploy do | |
# Create a task for each site | |
puppetmasters.keys.each do |site| | |
desc "Deploys only to #{site.to_s.upcase}" | |
task site do | |
set :branch, site.to_s | |
set :master, puppetmasters[site] | |
deploy:setup | |
deploy:update | |
end | |
end | |
desc "Deploys to ALL sites (sequentially)" | |
task :all do | |
puppetmasters.keys.each do |site_cmd| | |
eval site_cmd | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment