Created
July 6, 2010 23:04
-
-
Save paul/466062 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
app_path = node[:core][:app_path] | |
branch = node[:core][:deploy_branch] | |
directory app_path do | |
owner "ssbe" | |
group "ssbe" | |
mode "0755" | |
end | |
execute "Update repo" do | |
command %{ cd #{app_path}; git fetch origin; git reset --hard #{branch} } | |
user "ssbe" | |
only_if "file -d #{app_path}/.git" | |
end | |
execute "Clone repo" do | |
command %{ git clone --quiet --branch #{branch} [email protected]:absperf/core.git #{app_path} } | |
user "ssbe" | |
not_if "file -d #{app_path}/.git" | |
end | |
template "database.yml" do | |
local true | |
source File.join(app_path, 'config/database.yml.example') | |
path File.join(app_path, 'config/database.yml') | |
@postgresql_server = search( :node, "role:#{node[:environment]} AND role:postgresql").first | |
@tokyotyrant_server = search( :node, "role:#{node[:environment]} AND role:tokyotyrant").first | |
@mongodb_server = search( :node, "role:#{node[:environment]} AND role:mongodb").first | |
variables( | |
:postgresql_fqdn => @postgresql_server[:fqdn], | |
:postgresql_password => @postgresql_server[:postgresql][:ssbe_password], | |
:ttserver_fqdn => @tokyotyrant_server[:fqdn], | |
:mongodb_fqdn => @mongodb_server[:fqdn], | |
:mongodb_password => @mongodb_server[:mongodb][:ssbe_password] | |
) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment