|
33 | 33 | # node.normal['jenkins']['master']['install_method'] = 'war'
|
34 | 34 | #
|
35 | 35 | master['install_method'] = case node['platform_family']
|
36 |
| - when 'debian', 'rhel', 'amazon' then 'package' |
| 36 | + when 'debian', 'rhel', 'amazon' |
| 37 | + 'package' |
| 38 | + when 'windows' |
| 39 | + 'msi' |
37 | 40 | else 'war'
|
38 | 41 | end
|
39 | 42 |
|
| 43 | + # |
| 44 | + # Installation options to pass to MSI installer. |
| 45 | + # |
| 46 | + # node.normal['jenkins']['master']['msi_install_options'] = "JENKINSDIR=\"#{node['jenkins']['master']['home']}\"" |
| 47 | + # |
| 48 | + master['msi_install_options'] = nil |
| 49 | + |
40 | 50 | #
|
41 | 51 | # The version of the Jenkins master to install. This can be a specific
|
42 | 52 | # package version (from the yum or apt repo), or the version of the war
|
43 | 53 | # file to download from the Jenkins mirror.
|
44 | 54 | #
|
45 |
| - master['version'] = nil |
| 55 | + master['version'] = case node['os'] |
| 56 | + when 'windows' then '2.89.2' |
| 57 | + end |
46 | 58 |
|
47 | 59 | #
|
48 | 60 | # The "channel" to use, default is stable
|
|
64 | 76 | master['mirror'] = 'https://updates.jenkins.io'
|
65 | 77 |
|
66 | 78 | #
|
67 |
| - # The full URL to the Jenkins WAR file on the remote mirror. This attribute is |
68 |
| - # only used in the "war" installation method. This is a compiled attribute |
69 |
| - # from the +mirror+ and +version+ attributes, but you can override this |
70 |
| - # attribute and specify the full URL path to a remote file for the Jenkins |
71 |
| - # war file. If you choose to override this file manually, it is highly |
72 |
| - # recommended that you also set the +checksum+ attribute. |
| 79 | + # The full URL to the Jenkins WAR/ZIP file on the remote mirror. This |
| 80 | + # attribute is only used in the "war" & "msi" installation methods. This is a |
| 81 | + # compiled attribute from the +mirror+ and +version+ attributes, but you can |
| 82 | + # override this attribute and specify the full URL path to a remote file for |
| 83 | + # the Jenkins war/zip file. If you choose to override this file manually, it |
| 84 | + # is highly recommended that you also set the +checksum+ attribute. |
73 | 85 | #
|
74 | 86 | # node.normal['jenkins']['master']['source'] = 'http://fs01.example.com/jenkins.war'
|
75 | 87 | #
|
76 | 88 | # Warning: Setting this attribute will negate/ignore any values for +mirror+
|
77 |
| - # and +version+. |
78 |
| - # |
79 |
| - master['source'] = "#{node['jenkins']['master']['mirror']}/"\ |
80 |
| - "#{node['jenkins']['master']['version'] || node['jenkins']['master']['channel']}/"\ |
81 |
| - 'latest/jenkins.war' |
| 89 | + # and (for the "war" installation method) +version+. |
| 90 | + # |
| 91 | + master['source'] = |
| 92 | + case node['os'] |
| 93 | + when 'windows' |
| 94 | + "http://mirrors.jenkins-ci.org/windows-#{node['jenkins']['master']['channel']}/"\ |
| 95 | + "jenkins-#{node['jenkins']['master']['version']}.zip" |
| 96 | + else |
| 97 | + "#{node['jenkins']['master']['mirror']}/"\ |
| 98 | + "#{node['jenkins']['master']['version'] || node['jenkins']['master']['channel']}/"\ |
| 99 | + 'latest/jenkins.war' |
| 100 | + end |
82 | 101 |
|
83 | 102 | #
|
84 |
| - # The checksum of the war file. This is use to verify that the remote war file |
85 |
| - # has not been tampered with (such as a MITM attack). If you leave this # |
| 103 | + # The checksum of the war or zip file. This is use to verify that the remote |
| 104 | + # file has not been tampered with (such as a MITM attack). If you leave this |
86 | 105 | # attribute set to +nil+, no validation will be performed. If this attribute
|
87 | 106 | # is set to the wrong SHA-256 checksum, the Chef Client run will fail.
|
88 | 107 | #
|
89 | 108 | # node.normal['jenkins']['master']['checksum'] = 'abcd1234...'
|
90 | 109 | #
|
91 |
| - master['checksum'] = nil |
| 110 | + master['checksum'] = case node['os'] |
| 111 | + when 'windows' then 'b0c65a14d554d2b5b588c3ee8ab69af68334aea1bcfeebefb40c84fa7b6d5526' |
| 112 | + end |
92 | 113 |
|
93 | 114 | #
|
94 |
| - # The list of options to pass to the Java JVM script when using the package |
95 |
| - # installer. For example: |
| 115 | + # When installing Jenkins via a msi on Windows, this attribute can be used |
| 116 | + # to specify the msi's SHA-256 checksum. |
| 117 | + # |
| 118 | + # node.normal['jenkins']['master']['msi_checksum'] = 'abcd1234...' |
| 119 | + # |
| 120 | + master['msi_checksum'] = nil |
| 121 | + |
| 122 | + # |
| 123 | + # The list of options to pass to the Java JVM script when using the |
| 124 | + # package/msi installer. For example: |
96 | 125 | #
|
97 | 126 | # node.normal['jenkins']['master']['jvm_options'] = '-Xmx256m'
|
98 | 127 | #
|
99 |
| - master['jvm_options'] = '-Djenkins.install.runSetupWizard=false' |
| 128 | + master['jvm_options'] = |
| 129 | + case node['os'] |
| 130 | + when 'windows' |
| 131 | + '-Xrs -Xmx256m -Djenkins.install.runSetupWizard=false -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=8080 --webroot="%BASE%\war"' |
| 132 | + else |
| 133 | + '-Djenkins.install.runSetupWizard=false' |
| 134 | + end |
100 | 135 |
|
101 | 136 | #
|
102 | 137 | # The list of Jenkins arguments to pass to the initialize script. This varies
|
|
125 | 160 | #
|
126 | 161 | # node.normal['jenkins']['master']['user'] = 'root'
|
127 | 162 | #
|
128 |
| - master['user'] = 'jenkins' |
| 163 | + master['user'] = case node['os'] |
| 164 | + when 'windows' then 'SYSTEM' |
| 165 | + else 'jenkins' |
| 166 | + end |
129 | 167 |
|
130 | 168 | #
|
131 | 169 | # The group under which Jenkins is running. Jenkins doesn't actually use or
|
132 | 170 | # honor this attribute - it is used for file permission purposes.
|
133 | 171 | #
|
134 |
| - master['group'] = 'jenkins' |
| 172 | + master['group'] = case node['os'] |
| 173 | + when 'windows' then 'Administrators' |
| 174 | + else 'jenkins' |
| 175 | + end |
135 | 176 |
|
136 | 177 | #
|
137 | 178 | # Jenkins user/group should be created as `system` accounts for `war` install.
|
|
180 | 221 | # configuration and build artifacts. You should ensure this directory resides
|
181 | 222 | # on a volume with adequate disk space.
|
182 | 223 | #
|
183 |
| - master['home'] = '/var/lib/jenkins' |
| 224 | + master['home'] = case node['os'] |
| 225 | + when 'windows' then 'C:\Program Files (x86)\Jenkins' |
| 226 | + else '/var/lib/jenkins' |
| 227 | + end |
184 | 228 |
|
185 | 229 | #
|
186 | 230 | # The directory where Jenkins should write its logfile(s). **This attribute
|
|
0 commit comments