Permalink
Browse files

Merge pull request #10 from Nordstrom/cook-2020

Cook 2020: Add git to Windows path and improve package install
  • Loading branch information...
2 parents 51f1820 + 20b6d58 commit 4f0a36f1634552fb3ee1f9e0d89b6a9c1132b663 @jtimberman jtimberman committed Dec 10, 2012
Showing with 75 additions and 8 deletions.
  1. +4 −0 CHANGELOG.md
  2. +36 −1 README.md
  3. +1 −0 attributes/default.rb
  4. +1 −1 metadata.rb
  5. +1 −6 recipes/default.rb
  6. +32 −0 recipes/windows.rb
View
@@ -1,3 +1,7 @@
+## v1.1.1:
+
+* [COOK-2020] - Add setup option attributes to Git Windows package install
+
## v1.1.0:
* [COOK-1943] - Update to git 1.8.0
View
@@ -25,9 +25,33 @@ selection logic. This attribute was introduced in Ohai v0.6.12.
* runit
### Windows Dependencies
-The `windows_package` resource from the Windows cookbook is required to
+The [`windows_package`](https://github.com/opscode-cookbooks/windows#windows_package) resource from the Windows cookbook is required to
install the git package on Windows.
+## Attributes
+
+### default
+The following attributes are platform-specific.
+
+#### Windows
+
+* `node['git']['version']` - git version to install
+* `node['git']['url']` - URL to git package
+* `node['git']['checksum']` - package SHA256 checksum
+* `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent)
+
+#### Mac OS X
+
+* `node['git']['osx_dmg']['url']` - URL to git package
+* `node['git']['osx_dmg']['checksum']` - package SHA256 checksum
+
+#### Linux
+
+* `node['git']['prefix']` - git install directory
+* `node['git']['version']` - git version to install
+* `node['git']['url']` - URL to git tarball
+* `node['git']['checksum']` - tarball SHA256 checksum
+
Recipes
=======
@@ -43,12 +67,23 @@ Sets up a git daemon to provide a server.
Installs git from source.
+## windows
+
+Installs git client on Windows
+
Usage
=====
+
This cookbook primarily installs git core packages. It can also be
used to serve git repositories.
+To install git client (all supported platforms):
+
+ include_recipe 'git'
+
+To install git server:
+
include_recipe "git::server"
This creates the directory /srv/git and starts a git daemon, exporting
View
@@ -22,6 +22,7 @@
default['git']['version'] = "1.8.0-preview20121022"
default['git']['url'] = "http://github.com/downloads/msysgit/git/Git-#{node['git']['version']}.exe"
default['git']['checksum'] = "8ec19d04912fd27d7350823c857a4807b550fa63a3744bf6fd2841de8cfa9a0f"
+ default['git']['display_name'] = "Git version #{ node['git']['version'] }"
when "mac_os_x"
default['git']['osx_dmg']['app_name'] = "git-1.8.0-intel-universal-snow-leopard"
default['git']['osx_dmg']['volumes_dir'] = "Git 1.8.0 Snow Leopard Intel Universal"
View
@@ -4,7 +4,7 @@
license "Apache 2.0"
description "Installs git and/or sets up a Git server daemon"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version "1.1.0"
+version "1.1.1"
recipe "git", "Installs git"
recipe "git::server", "Sets up a runit_service for git daemon"
recipe "git::source", "Installs git from source"
View
@@ -26,12 +26,7 @@
end
package "git"
when "windows"
- windows_package "git" do
- source node['git']['url']
- checksum node['git']['checksum']
- action :install
- not_if { File.exists? 'C:\Program Files (x86)\Git\bin\git.exe' }
- end
+ include_recipe 'git::windows'
when "mac_os_x"
dmg_package "GitOSX-Installer" do
app node['git']['osx_dmg']['app_name']
View
@@ -0,0 +1,32 @@
+#
+# Cookbook Name:: git
+# Recipe:: windows
+#
+# Copyright 2008-2009, Opscode, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+windows_package node['git']['display_name'] do
+ action :install
+ source node['git']['url']
+ checksum node['git']['checksum']
+ installer_type :inno
+end
+
+# Git is installed to Program Files (x86) on 64-bit machines and
+# 'Program Files' on 32-bit machines
+PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
+
+windows_path "#{ PROGRAM_FILES }\\Git\\Cmd" do
+ action :add
+end

0 comments on commit 4f0a36f

Please sign in to comment.