1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-15 03:20:10 +01:00
fdroidserver/buildserver/cookbooks/gradle/recipes/default.rb

49 lines
1.1 KiB
Ruby
Raw Normal View History

2014-01-09 16:27:34 +01:00
user = node[:settings][:user]
gradle_script = IO.read(File.join(
File.expand_path(File.dirname(__FILE__)), "gradle"))
2014-01-09 18:30:35 +01:00
script "add-gradle-bindir" do
2014-01-09 16:27:34 +01:00
cwd "/tmp"
interpreter "bash"
2014-01-09 18:30:35 +01:00
code "mkdir -p /opt/gradle/bin"
not_if "test -d /opt/gradle/bin"
end
script "add-gradle-verdir" do
cwd "/tmp"
interpreter "bash"
code "mkdir -p /opt/gradle/versions"
not_if "test -d /opt/gradle/versions"
2014-01-09 16:27:34 +01:00
end
%w{1.4 1.6 1.7 1.8 1.9 1.10 1.11}.each do |ver|
2014-01-09 16:27:34 +01:00
script "install-gradle-#{ver}" do
cwd "/tmp"
interpreter "bash"
code "
unzip /vagrant/cache/gradle-#{ver}-bin.zip
2014-01-09 18:30:35 +01:00
mv gradle-#{ver} /opt/gradle/versions/#{ver}
2014-01-09 16:27:34 +01:00
"
2014-01-09 18:30:35 +01:00
not_if "test -d /opt/gradle/versions/#{ver}"
2014-01-09 16:27:34 +01:00
end
end
2014-01-09 18:30:35 +01:00
script "add-gradle-wrapper" do
cwd "/tmp"
interpreter "bash"
code "
cat << \"EOF\" > /opt/gradle/bin/gradle
#{gradle_script}
2014-01-09 18:30:35 +01:00
EOF
chmod a+x /opt/gradle/bin/gradle
"
2014-01-09 18:30:35 +01:00
end
execute "add-android-ndk-path" do
user user
command "echo \"export PATH=\\$PATH:/opt/gradle/bin #PATH-GRADLE\" >> /home/#{user}/.bsenv"
not_if "grep PATH-GRADLE /home/#{user}/.bsenv"
end