Skip to content

Commit df4ec9a

Browse files
authored
[build] Include architecture in latest snapshot downloads (#840)
* Include architecture in latest snapshot downloads * Fix typo in architecture target * Update build targets Update references to 6 based build targets Remove 6.x branch build target Add 7.x and 8.x build targets * Fix LATEST-SNAPSHOT calculation * Integration test fixes Remove doc types from tests that were still using them
1 parent 21c61c1 commit df4ec9a

File tree

4 files changed

+53
-27
lines changed

4 files changed

+53
-27
lines changed

.travis.yml

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,38 @@ env:
88
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=2.4.4 TEST_DEBUG=true
99
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=5.6.13 TEST_DEBUG=true
1010
- DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=6.0.0 TEST_DEBUG=true
11-
- DISTRIBUTION=oss INTEGRATION=true ES_VERSION=6.4.3 TEST_DEBUG=true
12-
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=6.4.3 TEST_DEBUG=true
11+
- DISTRIBUTION=oss INTEGRATION=true ES_VERSION=6.6.0 TEST_DEBUG=true
12+
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=6.6.0 TEST_DEBUG=true
1313
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-6 TEST_DEBUG=true
14-
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 TEST_DEBUG=true
14+
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 ARCH=LINUX TEST_DEBUG=true
15+
- DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-8 ARCH=LINUX TEST_DEBUG=true
1516
- DISTRIBUTION=legacyxpack SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=5.6.13
1617
TEST_DEBUG=true
17-
- DISTRIBUTION=default SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=6.4.3 TEST_DEBUG=true
18+
- DISTRIBUTION=default SECURE_INTEGRATION=true INTEGRATION=true ES_VERSION=6.6.0 TEST_DEBUG=true
1819
rvm:
1920
- jruby-1.7.25
2021
matrix:
2122
include:
2223
- rvm: jruby-9.1.13.0
2324
env: LOGSTASH_BRANCH=master
2425
- rvm: jruby-9.1.13.0
25-
env: LOGSTASH_BRANCH=6.x
26+
env: LOGSTASH_BRANCH=7.x
2627
- rvm: jruby-9.1.13.0
27-
env: LOGSTASH_BRANCH=6.5
28+
env: LOGSTASH_BRANCH=6.7
2829
- rvm: jruby-1.7.27
2930
env: LOGSTASH_BRANCH=5.6
3031
- rvm: jruby-1.7.27
3132
env: DISTRIBUTION=legacy INTEGRATION=true ES_VERSION=5.6.13 LOGSTASH_BRANCH=5.6 TEST_DEBUG=true
3233
- rvm: jruby-9.1.13.0
33-
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-6 LOGSTASH_BRANCH=6.6 TEST_DEBUG=true
34+
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-6 LOGSTASH_BRANCH=6.7 TEST_DEBUG=true
3435
- rvm: jruby-9.1.13.0
35-
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 LOGSTASH_BRANCH=master TEST_DEBUG=true
36+
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 ARCH=LINUX LOGSTASH_BRANCH=7.x TEST_DEBUG=true
37+
- rvm: jruby-9.1.13.0
38+
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-8 ARCH=LINUX LOGSTASH_BRANCH=master TEST_DEBUG=true
3639
allow_failures:
37-
- env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 TEST_DEBUG=true
40+
- env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-8 ARCH=LINUX TEST_DEBUG=true
3841
- rvm: jruby-9.1.13.0
39-
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-7 LOGSTASH_BRANCH=master TEST_DEBUG=true
42+
env: DISTRIBUTION=default INTEGRATION=true ES_VERSION=LATEST-SNAPSHOT-8 ARCH=LINUX LOGSTASH_BRANCH=master TEST_DEBUG=true
4043
fast_finish: true
4144
install: true
4245
script: ci/build.sh

ci/run.sh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,29 @@ else
137137
extra_tag_args="$extra_tag_args --tag ~distribution:oss --tag distribution:xpack"
138138
fi
139139

140+
arch=""
141+
142+
case "$ARCH" in
143+
LINUX)
144+
arch="-linux-x86_64"
145+
;;
146+
MAC_OS)
147+
arch="-darwin-x86_64"
148+
;;
149+
NONE)
150+
arch=""
151+
;;
152+
esac
153+
140154
case "$ES_VERSION" in
141155
LATEST-SNAPSHOT-*)
142156
split_latest=${ES_VERSION##*-}
143157

144-
LATEST_ES_VERSION=$(curl -sL https://artifacts-api.elastic.co/v1/versions/ | jq -r --arg LATEST $split_latest '[.versions[] | select(startswith($LATEST))][-1]')
158+
LATEST_ES_VERSION=$(curl -sL https://artifacts-api.elastic.co/v1/versions/ | jq -r --arg LATEST $split_latest '[.versions[] | select(startswith($LATEST)) | select(endswith("SNAPSHOT"))][-1]')
145159
if [[ "$DISTRIBUTION" == "oss" ]]; then
146-
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-oss-${LATEST_ES_VERSION}.tar.gz
160+
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-oss-${LATEST_ES_VERSION}${arch}.tar.gz
147161
elif [[ "$DISTRIBUTION" == "default" ]]; then
148-
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${LATEST_ES_VERSION}.tar.gz
162+
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${LATEST_ES_VERSION}${arch}.tar.gz
149163
fi
150164
es_distribution_version=$(get_es_distribution_version)
151165
start_es
@@ -154,15 +168,24 @@ else
154168

155169
*-SNAPSHOT)
156170
if [[ "$DISTRIBUTION" == "oss" ]]; then
157-
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-oss-${ES_VERSION}.tar.gz
171+
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-oss-${ES_VERSION}${arch}.tar.gz
158172
elif [[ "$DISTRIBUTION" == "default" ]]; then
159-
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
173+
setup_es https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}${arch}.tar.gz
174+
fi
175+
es_distribution_version=$(get_es_distribution_version)
176+
start_es
177+
bundle exec rspec -fd $extra_tag_args --tag update_tests:painless --tag update_tests:groovy --tag es_version:$es_distribution_version $spec_path
178+
;;
179+
7.*)
180+
if [[ "$DISTRIBUTION" == "oss" ]]; then
181+
setup_es https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-${ES_VERSION}${arch}.tar.gz
182+
elif [[ "$DISTRIBUTION" == "default" ]]; then
183+
setup_es https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}${arch}.tar.gz
160184
fi
161185
es_distribution_version=$(get_es_distribution_version)
162186
start_es
163187
bundle exec rspec -fd $extra_tag_args --tag update_tests:painless --tag update_tests:groovy --tag es_version:$es_distribution_version $spec_path
164188
;;
165-
166189
6.[0-2]*)
167190
setup_es https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz https://artifacts.elastic.co/downloads/packs/x-pack/x-pack-${ES_VERSION}.zip
168191
es_distribution_version=$(get_es_distribution_version)

spec/fixtures/template-with-policy-es7x.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"number_of_shards": 1
77
},
88
"mappings" : {
9-
"_doc" : {
109
"dynamic_templates" : [ {
1110
"message_field" : {
1211
"path_match" : "message",
@@ -42,5 +41,5 @@
4241
}
4342
}
4443
}
45-
}
44+
4645
}

spec/integration/outputs/parent_spec.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,19 @@
2424
before do
2525
# Add mapping and a parent document
2626
index_url = "http://#{get_host_port()}/#{index}"
27-
mapping = {
28-
"mappings" => {
29-
type => {
30-
"properties" => {
31-
join_field => {
32-
"type" => "join",
33-
"relations" => { parent_relation => child_relation }
34-
}
35-
}
27+
28+
properties = {
29+
"properties" => {
30+
join_field => {
31+
"type" => "join",
32+
"relations" => { parent_relation => child_relation }
3633
}
3734
}
3835
}
36+
37+
mapping = ESHelper.es_version_satisfies?('<7') ? { "mappings" => { type => properties } }
38+
: { "mappings" => properties}
39+
3940
if ESHelper.es_version_satisfies?('<6')
4041
mapping.merge!({
4142
"settings" => {

0 commit comments

Comments
 (0)