Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Cook 2020: Add git to Windows path and improve package install #10

Merged
merged 9 commits into from over 1 year ago

2 participants

Doug Ireton Joshua Timberman
Doug Ireton
  1. Move Windows package install to separate recipe
  2. Add git to Windows path and improve package install

http://tickets.opscode.com/browse/COOK-2020

Joshua Timberman jtimberman merged commit 4f0a36f into from December 10, 2012
Joshua Timberman jtimberman closed this December 10, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
4  CHANGELOG.md
Source Rendered
... ...
@@ -1,3 +1,7 @@
  1
+## v1.1.1:
  2
+
  3
+* [COOK-2020] - Add setup option attributes to Git Windows package install
  4
+
1 5
 ## v1.1.0:
2 6
 
3 7
 * [COOK-1943] - Update to git 1.8.0
37  README.md
Source Rendered
@@ -25,9 +25,33 @@ selection logic. This attribute was introduced in Ohai v0.6.12.
25 25
 * runit
26 26
 
27 27
 ### Windows Dependencies
28  
-The `windows_package` resource from the Windows cookbook is required to
  28
+The [`windows_package`](https://github.com/opscode-cookbooks/windows#windows_package) resource from the Windows cookbook is required to
29 29
 install the git package on Windows.
30 30
 
  31
+## Attributes
  32
+
  33
+### default
  34
+The following attributes are platform-specific.
  35
+
  36
+#### Windows
  37
+
  38
+* `node['git']['version']` - git version to install
  39
+* `node['git']['url']` - URL to git package
  40
+* `node['git']['checksum']` - package SHA256 checksum
  41
+* `node['git']['display_name']` - `windows_package` resource Display Name (makes the package install idempotent) 
  42
+
  43
+#### Mac OS X
  44
+
  45
+* `node['git']['osx_dmg']['url']` - URL to git package
  46
+* `node['git']['osx_dmg']['checksum']` - package SHA256 checksum
  47
+
  48
+#### Linux
  49
+
  50
+* `node['git']['prefix']` - git install directory
  51
+* `node['git']['version']` - git version to install
  52
+* `node['git']['url']` - URL to git tarball
  53
+* `node['git']['checksum']` - tarball SHA256 checksum
  54
+
31 55
 Recipes
32 56
 =======
33 57
 
@@ -43,12 +67,23 @@ Sets up a git daemon to provide a server.
43 67
 
44 68
 Installs git from source.
45 69
 
  70
+## windows
  71
+
  72
+Installs git client on Windows
  73
+
46 74
 Usage
47 75
 =====
48 76
 
  77
+
49 78
 This cookbook primarily installs git core packages. It can also be
50 79
 used to serve git repositories.
51 80
 
  81
+To install git client (all supported platforms):
  82
+
  83
+    include_recipe 'git'
  84
+
  85
+To install git server:
  86
+
52 87
     include_recipe "git::server"
53 88
 
54 89
 This creates the directory /srv/git and starts a git daemon, exporting
1  attributes/default.rb
@@ -22,6 +22,7 @@
22 22
   default['git']['version'] = "1.8.0-preview20121022"
23 23
   default['git']['url'] = "http://github.com/downloads/msysgit/git/Git-#{node['git']['version']}.exe"
24 24
   default['git']['checksum'] = "8ec19d04912fd27d7350823c857a4807b550fa63a3744bf6fd2841de8cfa9a0f"
  25
+  default['git']['display_name'] = "Git version #{ node['git']['version'] }"
25 26
 when "mac_os_x"
26 27
   default['git']['osx_dmg']['app_name']    = "git-1.8.0-intel-universal-snow-leopard"
27 28
   default['git']['osx_dmg']['volumes_dir'] = "Git 1.8.0 Snow Leopard Intel Universal"
2  metadata.rb
@@ -4,7 +4,7 @@
4 4
 license           "Apache 2.0"
5 5
 description       "Installs git and/or sets up a Git server daemon"
6 6
 long_description  IO.read(File.join(File.dirname(__FILE__), 'README.md'))
7  
-version           "1.1.0"
  7
+version           "1.1.1"
8 8
 recipe            "git", "Installs git"
9 9
 recipe            "git::server", "Sets up a runit_service for git daemon"
10 10
 recipe            "git::source", "Installs git from source"
7  recipes/default.rb
@@ -26,12 +26,7 @@
26 26
   end
27 27
   package "git"
28 28
 when "windows"
29  
-  windows_package "git" do
30  
-    source node['git']['url']
31  
-    checksum node['git']['checksum']
32  
-    action :install
33  
-    not_if { File.exists? 'C:\Program Files (x86)\Git\bin\git.exe' }
34  
-  end
  29
+  include_recipe 'git::windows'
35 30
 when "mac_os_x"
36 31
   dmg_package "GitOSX-Installer" do
37 32
     app node['git']['osx_dmg']['app_name']
32  recipes/windows.rb
... ...
@@ -0,0 +1,32 @@
  1
+#
  2
+# Cookbook Name:: git
  3
+# Recipe:: windows
  4
+#
  5
+# Copyright 2008-2009, Opscode, Inc.
  6
+#
  7
+# Licensed under the Apache License, Version 2.0 (the "License");
  8
+# you may not use this file except in compliance with the License.
  9
+# You may obtain a copy of the License at
  10
+#
  11
+#     http://www.apache.org/licenses/LICENSE-2.0
  12
+#
  13
+# Unless required by applicable law or agreed to in writing, software
  14
+# distributed under the License is distributed on an "AS IS" BASIS,
  15
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16
+# See the License for the specific language governing permissions and
  17
+# limitations under the License.
  18
+
  19
+windows_package node['git']['display_name'] do
  20
+  action :install
  21
+  source node['git']['url']
  22
+  checksum node['git']['checksum']
  23
+  installer_type :inno
  24
+end
  25
+
  26
+# Git is installed to Program Files (x86) on 64-bit machines and
  27
+# 'Program Files' on 32-bit machines
  28
+PROGRAM_FILES = ENV['ProgramFiles(x86)'] || ENV['ProgramFiles']
  29
+
  30
+windows_path "#{ PROGRAM_FILES }\\Git\\Cmd" do
  31
+  action :add
  32
+end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.