|
63 | 63 | default["jenkinsHomes"][jenkinsHome]["in_demand_delay"] = 1 # if builds are in queue for even one minute, launch this worker
|
64 | 64 | default["jenkinsHomes"][jenkinsHome]["idle_delay"] = 15 # take worker off-line after 15 min of idling (we're charged by the hour, so no rush)
|
65 | 65 |
|
66 |
| - # can't marshall closures, but they sometimes need to be shipped, so encode as string, closing over `node` |
67 | 66 | default["_jenkinsHome"] = jenkinsHome
|
68 | 67 | default["_jenkinsTmp"] = jenkinsTmp
|
| 68 | + |
| 69 | + # Worker-specific env, the rest is defined in master's attribs. |
| 70 | + # This needs to be a closure to get laziness so that we can refer to other attributes, but can't marshall closures, |
| 71 | + # and they sometimes need to be shipped, so encode as string, closing over `node`... |
69 | 72 | default["jenkinsHomes"][jenkinsHome]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
|
70 | 73 | lambda{| node | Chef::Node::ImmutableMash.new({
|
71 | 74 | "PATH" => "/bin:/usr/bin:/cygdrive/c/java/jdk-1.6/bin:/cygdrive/c/Program Files (x86)/Git/Cmd", # TODO express in terms of attributes
|
72 | 75 | "sbtLauncher" => "#{node['sbt']['launcher_path']}\\sbt-launch.jar", # from chef-sbt cookbook
|
73 | 76 | "WIX" => node['wix']['home'],
|
74 |
| - "JAVA_HOME" => node['java']['java_home'], |
75 | 77 | "TMP" => "#{node['_jenkinsTmp']}",
|
76 | 78 | "_JAVA_OPTIONS" => "-Duser.home=#{node['_jenkinsHome']}", # no other way to do this... sbt boot will fail pretty weirdly if it can't write to $HOME/.sbt and $TMP/...
|
77 | 79 | "SHELLOPTS" => "igncr" # ignore line-ending issues in shell scripts
|
|
110 | 112 | default["jenkinsHomes"]["/home/jenkins"]["usage_mode"] = publisher ? "exclusive" : "normal"
|
111 | 113 | default["jenkinsHomes"]["/home/jenkins"]["labels"] = ["linux", publisher ? "publish": "public"]
|
112 | 114 |
|
113 |
| - # can't marshall closures, and this one needs to be shipped from worker to master (note: sshCharaArgs only use on publisher, but doesn't contain any private date, so not bothering) |
| 115 | + # Worker-specific env, the rest is defined in master's attribs. |
| 116 | + # (note: sshCharaArgs only used on publisher, but doesn't contain any private date, so not bothering to split it out) |
| 117 | + # This needs to be a closure to get laziness so that we can refer to other attributes, but can't marshall closures, |
| 118 | + # and they sometimes need to be shipped, so encode as string, closing over `node`... |
114 | 119 | default["jenkinsHomes"]["/home/jenkins"]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
|
115 | 120 | lambda{| node | Chef::Node::ImmutableMash.new({
|
116 | 121 | "sshCharaArgs" => '("[email protected]" "-i" "/home/jenkins/.ssh/for_chara")',
|
117 | 122 | "sbtLauncher" => File.join(node['sbt']['launcher_path'], "sbt-launch.jar"), # from chef-sbt cookbook
|
118 |
| - "sbtCmd" => File.join(node['sbt-extras']['setup_dir'], node['sbt-extras']['script_name']), # sbt-extras |
119 |
| - "JAVA_HOME" => node['java']['java_home'] # we get the jre if we don't do this |
| 123 | + "sbtCmd" => File.join(node['sbt-extras']['setup_dir'], node['sbt-extras']['script_name']) # sbt-extras |
120 | 124 | })}
|
121 | 125 | EOH
|
122 | 126 |
|
|
0 commit comments