Skip to content

Instantly share code, notes, and snippets.

@paul
Created July 6, 2010 23:04
Show Gist options
  • Save paul/466062 to your computer and use it in GitHub Desktop.
Save paul/466062 to your computer and use it in GitHub Desktop.
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