Skip to content

Commit 9169351

Browse files
authored
Merge pull request #194 from adriaanm/sbtx
Standardize on sbt-extras
2 parents 9cc579a + 5c1ffcd commit 9169351

File tree

5 files changed

+23
-16
lines changed

5 files changed

+23
-16
lines changed

attributes/default.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@
2222

2323
default['s3']['downloads']['host'] = "downloads.typesafe.com.s3.amazonaws.com"
2424

25-
# work around https://github.com/gildegoma/chef-sbt-extras/issues/33 by overriding the URL we get
26-
# the sbt launch script from. latest version as of 9 Sep 2015
27-
# sbt is used by Scabot and by the dotty build, and in some glorious future, the scala build too
28-
default["sbt-extras"]["download_url"] = "https://raw.githubusercontent.com/paulp/sbt-extras/968cd027dabf894bae63efd2a671aae74390d81f/sbt"
25+
# bumped to sbt-extras as of Oct 21 2016 (0.13.13-RC3)
26+
default["sbt-extras"]["download_url"] = "https://raw.githubusercontent.com/paulp/sbt-extras/ab365a8354a493fa90deabfd7884da0bed976c8b/sbt"
2927

3028
# JAVA
3129
# TODO does this actually do anything???

attributes/worker.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1+
default['sbt']['version'] = "0.13.12"
2+
13
if (node.name =~ /.*-worker-.*/) != nil
24
case node["platform_family"]
35
when "windows"
4-
5-
override['sbt']['script_name'] = 'sbt.bat'
6-
override['sbt']['launcher_path'] = 'C:\sbt'
7-
override['sbt']['bin_path'] = 'C:\sbt'
6+
override['sbt']['launcher_path'] = 'C:\sbt\sbt-launch.jar'
87

98
# this zip was reworked to have the binaries under the `bin/` directory, which is what sbt-nativepackager expects
109
override['wix']['home'] = 'C:\Program Files (x86)\WiX Toolset v3.9'
@@ -63,7 +62,7 @@
6362
default["jenkinsHomes"][jenkinsHome]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
6463
lambda{| node | Chef::Node::ImmutableMash.new({
6564
"PATH" => "/bin:/usr/bin:/cygdrive/c/Program Files/Java/jdk1.8.0_92/bin:/cygdrive/c/Program Files (x86)/Git-2.5.3/Cmd", # TODO express in terms of attributes
66-
"sbtLauncher" => "#{node['sbt']['launcher_path']}\\sbt-launch.jar", # from chef-sbt cookbook
65+
"sbtLauncher" => node['sbt']['launcher_path'],
6766
"WIX" => node['wix']['home'],
6867
"TMP" => "#{node['_jenkinsTmp']}",
6968
"_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/...
@@ -76,6 +75,8 @@
7675
publisher = (node.name =~ /.*-publish.*/) != nil # TODO: use tag?
7776
lightWorker = publisher # TODO: better heuristic...
7877

78+
override['sbt']['launcher_path'] = '/usr/local/lib/share/sbt-launch.jar'
79+
7980
default['graphviz']['url'] = 'https://dl.dropboxusercontent.com/u/12862572/graphviz_2.28.0-1_amd64.deb'
8081
default['graphviz']['checksum'] = '76236edc36d5906b93f35e83f8f19a2045318852d3f826e920f189431967c081'
8182
default['graphviz']['version'] = '2.28.0-1'
@@ -103,7 +104,7 @@
103104
default["jenkinsHomes"]["/home/jenkins"]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
104105
lambda{| node | Chef::Node::ImmutableMash.new({
105106
"sshCharaArgs" => '("[email protected]" "-i" "/home/jenkins/.ssh/for_chara")',
106-
"sbtLauncher" => File.join(node['sbt']['launcher_path'], "sbt-launch.jar"), # from chef-sbt cookbook
107+
"sbtLauncher" => node['sbt']['launcher_path'],
107108
"sbtCmd" => File.join(node['sbt-extras']['setup_dir'], node['sbt-extras']['script_name']) # sbt-extras
108109
})}
109110
EOH

doc/staging.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ knife cookbook site install nodejs
7979

8080
```
8181
knife cookbook github install adriaanm/jenkins/fix305 # custom fixes + https://github.com/opscode-cookbooks/jenkins/pull/313 (b-dean/jenkins/http_ca_fixes)
82-
knife cookbook github install adriaanm/chef-sbt
8382
knife cookbook github install gildegoma/chef-sbt-extras
8483
knife cookbook github install adriaanm/artifactory
8584
```

metadata.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
depends 'git'
2929
depends 'git_user'
3030

31-
# TODO remove chef-sbt dependency, but not sure sbt-extras supports windows
32-
depends 'chef-sbt'
3331
depends 'sbt-extras'
3432

3533
depends 'runit', '~> 1.5'

recipes/worker-init.rb

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,20 @@
1212

1313
include_recipe "git" unless platform_family?("windows")
1414

15-
include_recipe "chef-sbt" unless platform_family?("windows")
16-
include_recipe "sbt-extras" unless platform_family?("windows")
15+
include_recipe "sbt-extras"
1716

1817
include_recipe "scala-jenkins-infra::_worker-init-#{node["platform_family"]}"
1918

20-
include_recipe "scala-jenkins-infra::_jvm-select"
19+
include_recipe "scala-jenkins-infra::_jvm-select"
20+
21+
# The bit from chef-sbt that's missing in chef-sbt-extras...
22+
# (Easily find the launcher jar for those paranoid jobs that want to invoke sbt using the java command
23+
# could update those scripts to use sbt-extras more carefully, I suppose.)
24+
# TODO: remove and rework scripts
25+
remote_file "#{node['sbt']['launcher_path']}" do
26+
source "https://repo.lightbend.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/#{node['sbt']['version']}/sbt-launch.jar"
27+
action :create
28+
owner "root"
29+
group "root"
30+
mode 0755
31+
end

0 commit comments

Comments
 (0)