Skip to content

Commit 3151b30

Browse files
committed
Merge branch 'master' into engine-mutex
2 parents 18f3f52 + 4703623 commit 3151b30

File tree

2,820 files changed

+81050
-31732
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,820 files changed

+81050
-31732
lines changed

.ci/bwcVersions

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ BWC_VERSION:
88
- "7.3.0"
99
- "7.3.1"
1010
- "7.3.2"
11-
- "7.3.3"
1211
- "7.4.0"
12+
- "7.4.1"
13+
- "7.4.2"
1314
- "7.5.0"
15+
- "7.6.0"
1416
- "8.0.0"

.ci/init.gradle

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,16 @@ initscript {
1212

1313
boolean USE_ARTIFACTORY=false
1414

15-
['VAULT_ADDR', 'VAULT_ROLE_ID', 'VAULT_SECRET_ID'].each {
16-
if (System.env."$it" == null) {
17-
throw new GradleException("$it must be set!")
15+
if (System.getenv('VAULT_ADDR') == null) {
16+
throw new GradleException("You must set the VAULT_ADDR environment variable to use this init script.")
17+
}
1818

19-
}
19+
if (System.getenv('VAULT_ROLE_ID') == null && System.getenv('VAULT_SECRET_ID') == null && System.getenv('VAULT_TOKEN') == null) {
20+
throw new GradleException("You must set either the VAULT_ROLE_ID and VAULT_SECRET_ID environment variables, " +
21+
"or the VAULT_TOKEN environment variable to use this init script.")
2022
}
2123

22-
final String vaultToken = new Vault(
24+
final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
2325
new VaultConfig()
2426
.address(System.env.VAULT_ADDR)
2527
.engineVersion(1)

.ci/os.ps1

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
2+
{
3+
# Relaunch as an elevated process:
4+
Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs
5+
exit
6+
}
7+
8+
$AppProps = ConvertFrom-StringData (Get-Content .ci/java-versions.properties -raw)
9+
$env:ES_BUILD_JAVA=$AppProps.ES_BUILD_JAVA
10+
$env:ES_RUNTIME_JAVA=$AppProps.ES_RUNTIME_JAVA
11+
12+
$ErrorActionPreference="Stop"
13+
$gradleInit = "C:\Users\$env:username\.gradle\init.d\"
14+
echo "Remove $gradleInit"
15+
Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore
16+
New-Item -ItemType directory -Path $gradleInit
17+
echo "Copy .ci/init.gradle to $gradleInit"
18+
Copy-Item .ci/init.gradle -Destination $gradleInit
19+
20+
[Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
21+
$env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH"
22+
$env:JAVA_HOME=$null
23+
$env:SYSTEM_JAVA_HOME="C:\Users\jenkins\.java\$env:ES_RUNTIME_JAVA"
24+
Remove-Item -Recurse -Force \tmp -ErrorAction Ignore
25+
New-Item -ItemType directory -Path \tmp
26+
27+
$ErrorActionPreference="Continue"
28+
# TODO: remove the task exclusions once dependencies are set correctly and these don't run for Windows or buldiung the deb on windows is fixed
29+
& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --scan --console=plain destructiveDistroTest
30+
31+
exit $LastExitCode

.ci/os.sh

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/bash
2+
3+
# opensuse 15 has a missing dep for systemd
4+
5+
if which zypper > /dev/null ; then
6+
sudo zypper install -y insserv-compat
7+
fi
8+
9+
# Required by bats
10+
sudo touch /etc/is_vagrant_vm
11+
sudo useradd vagrant
12+
13+
set -e
14+
15+
. .ci/java-versions.properties
16+
RUNTIME_JAVA_HOME=$HOME/.java/$ES_RUNTIME_JAVA
17+
BUILD_JAVA_HOME=$HOME/.java/$ES_BUILD_JAVA
18+
19+
rm -Rfv $HOME/.gradle/init.d/ && mkdir -p $HOME/.gradle/init.d
20+
cp -v .ci/init.gradle $HOME/.gradle/init.d
21+
22+
unset JAVA_HOME
23+
24+
if ! [ -e "/usr/bin/bats" ] ; then
25+
git clone https://github.com/sstephenson/bats /tmp/bats
26+
sudo /tmp/bats/install.sh /usr
27+
fi
28+
29+
30+
if [ -f "/etc/os-release" ] ; then
31+
cat /etc/os-release
32+
. /etc/os-release
33+
if [[ "$ID" == "debian" || "$ID_LIKE" == "debian" ]] ; then
34+
# FIXME: The base image should not have rpm installed
35+
sudo rm -Rf /usr/bin/rpm
36+
fi
37+
else
38+
cat /etc/issue || true
39+
fi
40+
41+
sudo bash -c 'cat > /etc/sudoers.d/elasticsearch_vars' << SUDOERS_VARS
42+
Defaults env_keep += "ZIP"
43+
Defaults env_keep += "TAR"
44+
Defaults env_keep += "RPM"
45+
Defaults env_keep += "DEB"
46+
Defaults env_keep += "PACKAGING_ARCHIVES"
47+
Defaults env_keep += "PACKAGING_TESTS"
48+
Defaults env_keep += "BATS_UTILS"
49+
Defaults env_keep += "BATS_TESTS"
50+
Defaults env_keep += "SYSTEM_JAVA_HOME"
51+
Defaults env_keep += "JAVA_HOME"
52+
SUDOERS_VARS
53+
sudo chmod 0440 /etc/sudoers.d/elasticsearch_vars
54+
55+
# Bats tests still use this locationa
56+
sudo rm -Rf /elasticsearch
57+
sudo mkdir -p /elasticsearch/qa/ && sudo chown jenkins /elasticsearch/qa/ && ln -s $PWD/qa/vagrant /elasticsearch/qa/
58+
59+
# sudo sets it's own PATH thus we use env to override that and call sudo annother time so we keep the secure root PATH
60+
# run with --continue to run both bats and java tests even if one fails
61+
# be explicit about Gradle home dir so we use the same even with sudo
62+
sudo -E env \
63+
PATH=$BUILD_JAVA_HOME/bin:`sudo bash -c 'echo -n $PATH'` \
64+
RUNTIME_JAVA_HOME=`readlink -f -n $RUNTIME_JAVA_HOME` \
65+
--unset=JAVA_HOME \
66+
SYSTEM_JAVA_HOME=`readlink -f -n $RUNTIME_JAVA_HOME` \
67+
./gradlew -g $HOME/.gradle --scan --parallel $@ --continue destructivePackagingTest
68+

0 commit comments

Comments
 (0)