diff --git a/.ci/os.sh b/.ci/os.sh index 82490e09b42..59e8de36af1 100755 --- a/.ci/os.sh +++ b/.ci/os.sh @@ -31,12 +31,6 @@ cp -v .ci/init.gradle $HOME/.gradle/init.d unset JAVA_HOME -if ! [ -e "/usr/bin/bats" ] ; then - git clone https://github.com/sstephenson/bats /tmp/bats - sudo /tmp/bats/install.sh /usr -fi - - if [ -f "/etc/os-release" ] ; then cat /etc/os-release . /etc/os-release @@ -54,16 +48,8 @@ else fi sudo bash -c 'cat > /etc/sudoers.d/elasticsearch_vars' << SUDOERS_VARS - Defaults env_keep += "ZIP" - Defaults env_keep += "TAR" - Defaults env_keep += "RPM" - Defaults env_keep += "DEB" - Defaults env_keep += "PACKAGING_ARCHIVES" - Defaults env_keep += "PACKAGING_TESTS" - Defaults env_keep += "BATS_UTILS" - Defaults env_keep += "BATS_TESTS" - Defaults env_keep += "SYSTEM_JAVA_HOME" Defaults env_keep += "JAVA_HOME" + Defaults env_keep += "SYSTEM_JAVA_HOME" SUDOERS_VARS sudo chmod 0440 /etc/sudoers.d/elasticsearch_vars diff --git a/Vagrantfile b/Vagrantfile index d7ff25a6a74..19effced2d7 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -336,7 +336,7 @@ def sles_common(config, name) zypper ar http://download.opensuse.org/distribution/12.3/repo/oss/ oss zypper --non-interactive --gpg-auto-import-keys refresh zypper --non-interactive install git-core - # choose to "ignore some dependencies" of expect, which has a problem with tcl... + # choose to "ignore some dependencies" of expect, which has a problem with tcl... zypper --non-interactive install --force-resolution expect SHELL suse_common config, name, extra: extra @@ -468,39 +468,13 @@ def sh_install_deps(config, #{extra} - installed java || { - echo "==> Java is not installed" - return 1 - } - cat \<\ /etc/profile.d/java_home.sh -if [ -z "\\\$JAVA_HOME" ]; then - export JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java)))) -fi -export SYSTEM_JAVA_HOME=\\\$JAVA_HOME -unset JAVA_HOME -JAVA ensure tar ensure curl ensure unzip ensure rsync ensure expect - installed bats || { - # Bats lives in a git repository.... - ensure git - echo "==> Installing bats" - git clone https://github.com/sstephenson/bats /tmp/bats - # Centos doesn't add /usr/local/bin to the path.... - /tmp/bats/install.sh /usr - rm -rf /tmp/bats - } - cat \<\ /etc/sudoers.d/elasticsearch_vars -Defaults env_keep += "BATS_UTILS" -Defaults env_keep += "BATS_TESTS" -Defaults env_keep += "BATS_PLUGINS" -Defaults env_keep += "BATS_UPGRADE" -Defaults env_keep += "PACKAGE_NAME" Defaults env_keep += "JAVA_HOME" Defaults env_keep += "SYSTEM_JAVA_HOME" SUDOERS_VARS @@ -509,23 +483,9 @@ SUDOERS_VARS end def windows_common(config, name) - config.vm.provision 'markerfile', type: 'shell', inline: <<-SHELL - $ErrorActionPreference = "Stop" - New-Item C:/is_vagrant_vm -ItemType file -Force | Out-Null - SHELL - config.vm.provision 'set prompt', type: 'shell', inline: <<-SHELL $ErrorActionPreference = "Stop" $ps_prompt = 'function Prompt { "#{name}:$($ExecutionContext.SessionState.Path.CurrentLocation)>" }' $ps_prompt | Out-File $PsHome/Microsoft.PowerShell_profile.ps1 SHELL - - config.vm.provision 'set env variables', type: 'shell', inline: <<-SHELL - $ErrorActionPreference = "Stop" - [Environment]::SetEnvironmentVariable("PACKAGING_ARCHIVES", "C:/project/build/packaging/archives", "Machine") - $javaHome = [Environment]::GetEnvironmentVariable("JAVA_HOME", "Machine") - [Environment]::SetEnvironmentVariable("SYSTEM_JAVA_HOME", $javaHome, "Machine") - [Environment]::SetEnvironmentVariable("PACKAGING_TESTS", "C:/project/build/packaging/tests", "Machine") - [Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine") - SHELL end diff --git a/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java b/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java index 8f19ede0534..235030754b6 100644 --- a/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java +++ b/buildSrc/src/main/java/org/elasticsearch/gradle/test/DistroTestPlugin.java @@ -265,6 +265,7 @@ public class DistroTestPlugin implements Plugin { VagrantExtension vagrant = project.getExtensions().getByType(VagrantExtension.class); vagrant.setBox(box); vagrant.vmEnv("SYSTEM_JAVA_HOME", convertPath(project, vagrant, systemJdk, "", "")); + vagrant.vmEnv("JAVA_HOME", ""); // make sure any default java on the system is ignored vagrant.vmEnv("PATH", convertPath(project, vagrant, gradleJdk, "/bin:$PATH", "\\bin;$Env:PATH")); // pass these along to get correct build scans if (System.getenv("JENKINS_URL") != null) {