Skip to content

Standardize on sbt-extras #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@

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

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're living in the glorious future, huzzah! 🎉

# JAVA
# TODO does this actually do anything???
Expand Down
13 changes: 7 additions & 6 deletions attributes/worker.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
default['sbt']['version'] = "0.13.12"

if (node.name =~ /.*-worker-.*/) != nil
case node["platform_family"]
when "windows"

override['sbt']['script_name'] = 'sbt.bat'
override['sbt']['launcher_path'] = 'C:\sbt'
override['sbt']['bin_path'] = 'C:\sbt'
override['sbt']['launcher_path'] = 'C:\sbt\sbt-launch.jar'

# this zip was reworked to have the binaries under the `bin/` directory, which is what sbt-nativepackager expects
override['wix']['home'] = 'C:\Program Files (x86)\WiX Toolset v3.9'
Expand Down Expand Up @@ -63,7 +62,7 @@
default["jenkinsHomes"][jenkinsHome]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
lambda{| node | Chef::Node::ImmutableMash.new({
"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
"sbtLauncher" => "#{node['sbt']['launcher_path']}\\sbt-launch.jar", # from chef-sbt cookbook
"sbtLauncher" => node['sbt']['launcher_path'],
"WIX" => node['wix']['home'],
"TMP" => "#{node['_jenkinsTmp']}",
"_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/...
Expand All @@ -76,6 +75,8 @@
publisher = (node.name =~ /.*-publish.*/) != nil # TODO: use tag?
lightWorker = publisher # TODO: better heuristic...

override['sbt']['launcher_path'] = '/usr/local/lib/share/sbt-launch.jar'

default['graphviz']['url'] = 'https://dl.dropboxusercontent.com/u/12862572/graphviz_2.28.0-1_amd64.deb'
default['graphviz']['checksum'] = '76236edc36d5906b93f35e83f8f19a2045318852d3f826e920f189431967c081'
default['graphviz']['version'] = '2.28.0-1'
Expand Down Expand Up @@ -103,7 +104,7 @@
default["jenkinsHomes"]["/home/jenkins"]["env"] = <<-'EOH'.gsub(/^ {4}/, '')
lambda{| node | Chef::Node::ImmutableMash.new({
"sshCharaArgs" => '("[email protected]" "-i" "/home/jenkins/.ssh/for_chara")',
"sbtLauncher" => File.join(node['sbt']['launcher_path'], "sbt-launch.jar"), # from chef-sbt cookbook
"sbtLauncher" => node['sbt']['launcher_path'],
"sbtCmd" => File.join(node['sbt-extras']['setup_dir'], node['sbt-extras']['script_name']) # sbt-extras
})}
EOH
Expand Down
1 change: 0 additions & 1 deletion doc/staging.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ knife cookbook site install nodejs

```
knife cookbook github install adriaanm/jenkins/fix305 # custom fixes + https://github.com/opscode-cookbooks/jenkins/pull/313 (b-dean/jenkins/http_ca_fixes)
knife cookbook github install adriaanm/chef-sbt
knife cookbook github install gildegoma/chef-sbt-extras
knife cookbook github install adriaanm/artifactory
```
Expand Down
2 changes: 0 additions & 2 deletions metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
depends 'git'
depends 'git_user'

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

depends 'runit', '~> 1.5'
Expand Down
17 changes: 14 additions & 3 deletions recipes/worker-init.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@

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

include_recipe "chef-sbt" unless platform_family?("windows")
include_recipe "sbt-extras" unless platform_family?("windows")
include_recipe "sbt-extras"

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

include_recipe "scala-jenkins-infra::_jvm-select"
include_recipe "scala-jenkins-infra::_jvm-select"

# The bit from chef-sbt that's missing in chef-sbt-extras...
# (Easily find the launcher jar for those paranoid jobs that want to invoke sbt using the java command
# could update those scripts to use sbt-extras more carefully, I suppose.)
# TODO: remove and rework scripts
remote_file "#{node['sbt']['launcher_path']}" do
source "https://repo.lightbend.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/#{node['sbt']['version']}/sbt-launch.jar"
action :create
owner "root"
group "root"
mode 0755
end