Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Travis VM Infrastructure #337

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
sudo: false
language: node_js
# Once openjdk/oraclejdk dependencies are resolved, change to dist: xenial
dist: trusty
notifications:
email: false
node_js:
- 8
- 10
- 8.13.0
- 10.13.0
matrix:
fast_finish: true
env:
Expand All @@ -14,7 +15,6 @@ env:
jdk:
- oraclejdk8
install:
- mkdir /tmp/elasticsearch
- ./scripts/setup_ci.sh
- npm i
script:
Expand Down
36 changes: 17 additions & 19 deletions scripts/setup_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,27 @@ set -e
# download and install elasticsearch with ICU plugin
# note: the download servers and plugin install binary changed between versions

if [[ "${ES_VERSION}" == "2.4"* ]]; then

# download from legacy host
wget -O - https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/tar/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.tar.gz \
| tar xz --directory=/tmp/elasticsearch --strip-components=1
# default download and plugin locations
ES_PLUGIN_BIN="/usr/share/elasticsearch/bin/elasticsearch-plugin"
ES_DEB_URL="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.deb"

# install ICU plugin
/tmp/elasticsearch/bin/plugin install analysis-icu
# override if using old Elasticsearch versions
if [[ "${ES_VERSION}" == "2.4"* ]]; then
ES_PLUGIN_BIN="/usr/share/elasticsearch/bin/plugin"
ES_DEB_URL="https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/${ES_VERSION}/elasticsearch-${ES_VERSION}.deb"
fi

# start elasticsearch server
/tmp/elasticsearch/bin/elasticsearch --daemonize --path.data /tmp
else
# download correct ES version
curl -O $ES_DEB_URL

# download from new host
wget -O - https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz \
| tar xz --directory=/tmp/elasticsearch --strip-components=1
# install debian package
sudo dpkg -i --force-confnew elasticsearch-${ES_VERSION}.deb

# install ICU plugin
/tmp/elasticsearch/bin/elasticsearch-plugin install analysis-icu
# install ICU plugin
sudo $ES_PLUGIN_BIN install analysis-icu

# start elasticsearch server
/tmp/elasticsearch/bin/elasticsearch --daemonize -Epath.data=/tmp -Edefault.path.data=/tmp -Ediscovery.type=single-node
fi
# restart elasticsearch server
sudo service elasticsearch restart

# set the correct esclient.apiVersion in pelias.json
v=( ${ES_VERSION//./ } ) # split version number on '.'
Expand All @@ -37,4 +35,4 @@ echo "--- pelias.json ---"
cat ~/pelias.json

echo "--- elasticsearch.yml ---"
cat /tmp/elasticsearch/config/elasticsearch.yml
sudo cat /etc/elasticsearch/elasticsearch.yml