Skip to content

Commit f2f2304

Browse files
committed
Merge remote-tracking branch 'es/7.x' into enrich-7.x
2 parents a66c0dc + 4506b37 commit f2f2304

File tree

830 files changed

+25401
-8143
lines changed

Some content is hidden

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

830 files changed

+25401
-8143
lines changed

.ci/bwcVersions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ BWC_VERSION:
4343
- "7.3.0"
4444
- "7.3.1"
4545
- "7.3.2"
46-
- "7.3.3"
4746
- "7.4.0"
47+
- "7.4.1"

.ci/init.gradle

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ initscript {
1010
}
1111
}
1212

13-
['VAULT_ADDR', 'VAULT_ROLE_ID', 'VAULT_SECRET_ID'].each {
14-
if (System.env."$it" == null) {
15-
throw new GradleException("$it must be set!")
13+
boolean USE_ARTIFACTORY=false
1614

17-
}
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+
}
18+
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.")
1822
}
1923

20-
final String vaultToken = new Vault(
24+
final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
2125
new VaultConfig()
2226
.address(System.env.VAULT_ADDR)
2327
.engineVersion(1)
@@ -37,46 +41,52 @@ final Vault vault = new Vault(
3741
)
3842
.withRetries(5, 1000)
3943

40-
final Map<String,String> artifactoryCredentials = vault.logical()
41-
.read("secret/elasticsearch-ci/artifactory.elstc.co")
42-
.getData();
4344

44-
logger.info("Using elastic artifactory repos")
45-
Closure configCache = {
46-
return {
47-
name "artifactory-gradle-release"
48-
url "https://artifactory.elstc.co/artifactory/gradle-release"
49-
credentials {
50-
username artifactoryCredentials.get("username")
51-
password artifactoryCredentials.get("token")
45+
if (USE_ARTIFACTORY) {
46+
final Map<String,String> artifactoryCredentials = vault.logical()
47+
.read("secret/elasticsearch-ci/artifactory.elstc.co")
48+
.getData();
49+
logger.info("Using elastic artifactory repos")
50+
Closure configCache = {
51+
return {
52+
name "artifactory-gradle-release"
53+
url "https://artifactory.elstc.co/artifactory/gradle-release"
54+
credentials {
55+
username artifactoryCredentials.get("username")
56+
password artifactoryCredentials.get("token")
57+
}
5258
}
5359
}
54-
}
55-
settingsEvaluated { settings ->
56-
settings.pluginManagement {
57-
repositories {
58-
maven configCache()
60+
settingsEvaluated { settings ->
61+
settings.pluginManagement {
62+
repositories {
63+
maven configCache()
64+
}
5965
}
6066
}
61-
}
62-
projectsLoaded {
63-
allprojects {
64-
buildscript {
67+
projectsLoaded {
68+
allprojects {
69+
buildscript {
70+
repositories {
71+
maven configCache()
72+
}
73+
}
6574
repositories {
6675
maven configCache()
6776
}
6877
}
69-
repositories {
70-
maven configCache()
71-
}
7278
}
79+
}
80+
81+
projectsLoaded {
7382
rootProject {
7483
project.pluginManager.withPlugin('com.gradle.build-scan') {
7584
buildScan.server = 'https://gradle-enterprise.elastic.co'
7685
}
7786
}
7887
}
7988

89+
8090
final String buildCacheUrl = System.getProperty('org.elasticsearch.build.cache.url')
8191
final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticsearch.build.cache.push', 'false'))
8292

.ci/os.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
# CI configures these, uncoment if running manually
9+
#
10+
# $env:ES_BUILD_JAVA="java12"
11+
#$env:ES_RUNTIME_JAVA="java11"
12+
13+
$ErrorActionPreference="Stop"
14+
$gradleInit = "C:\Users\$env:username\.gradle\init.d\"
15+
echo "Remove $gradleInit"
16+
Remove-Item -Recurse -Force $gradleInit -ErrorAction Ignore
17+
New-Item -ItemType directory -Path $gradleInit
18+
echo "Copy .ci/init.gradle to $gradleInit"
19+
Copy-Item .ci/init.gradle -Destination $gradleInit
20+
21+
[Environment]::SetEnvironmentVariable("JAVA_HOME", $null, "Machine")
22+
$env:PATH="C:\Users\jenkins\.java\$env:ES_BUILD_JAVA\bin\;$env:PATH"
23+
$env:JAVA_HOME=$null
24+
$env:SYSTEM_JAVA_HOME="C:\Users\jenkins\.java\$env:ES_RUNTIME_JAVA"
25+
Remove-Item -Recurse -Force \tmp -ErrorAction Ignore
26+
New-Item -ItemType directory -Path \tmp
27+
28+
$ErrorActionPreference="Continue"
29+
# 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
30+
& .\gradlew.bat -g "C:\Users\$env:username\.gradle" --parallel --scan --console=plain destructiveDistroTest `
31+
-x :distribution:packages:buildOssDeb `
32+
-x :distribution:packages:buildDeb `
33+
-x :distribution:packages:buildOssRpm `
34+
-x :distribution:packages:buildRpm `
35+
36+
exit $?

.ci/os.sh

Lines changed: 68 additions & 0 deletions
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)