A bit hackish so far. Be sure to read:
Created
February 15, 2012 11:23
-
-
Save thbar/1835161 to your computer and use it in GitHub Desktop.
How I got git working with chef on windows
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
include_recipe "windows::default" | |
include_recipe "windows::git" | |
=begin | |
# Doesn't work (yet?), see http://tickets.opscode.com/browse/CHEF-2931 | |
git node.app.deploy_to do | |
repository node.app.git.repository | |
reference node.app.git.reference | |
action :sync | |
end | |
=end | |
# using plain "git" won't seem to catch git.exe even if in the path, both for the git or the execute resource | |
git_command = [node.git.install_path, 'bin', 'git.exe'].join("\\") | |
# very basic, no symlink, no branch management etc git clone/pull work-around | |
execute "git clone" do | |
command "#{git_command} clone #{node.app.git.repository} #{node.app.deploy_to}" | |
creates node.app.deploy_to | |
end | |
execute "git pull" do | |
command "#{git_command} pull" | |
cwd node.app.deploy_to | |
only_if { File.exist?(node.app.deploy_to) } | |
end | |
gem_package 'bundler' do | |
version '1.0.22' | |
action :install | |
end |
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
# extra recipe for git | |
windows_package "Git" do | |
source node.git.source | |
installer_type :inno | |
action :install | |
options "/DIR=\"#{node.git.install_path}\"" | |
not_if { File.exist?(File.join(node.git.install_path, 'bin', 'git.exe')) } | |
end |
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
{ | |
"run_list": [ | |
"application::default" | |
], | |
"git": { | |
"install_path": "c:\\git", | |
"source": "http://msysgit.googlecode.com/files/Git-1.7.9-preview20120201.exe" | |
}, | |
"app": { | |
"deploy_to": "c:\\app", | |
"git": { | |
"repository": "git@xxxx:/repo.git" | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks! had no idea about
inno
this works.it would be most awesome if the env path was set. as well.