diff --git a/.travis.yml b/.travis.yml index acde7103..eff67ac7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -14,7 +15,6 @@ env: jdk: - oraclejdk8 install: - - mkdir /tmp/elasticsearch - ./scripts/setup_ci.sh - npm i script: diff --git a/scripts/setup_ci.sh b/scripts/setup_ci.sh index e846454a..c5db395e 100755 --- a/scripts/setup_ci.sh +++ b/scripts/setup_ci.sh @@ -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 '.' @@ -37,4 +35,4 @@ echo "--- pelias.json ---" cat ~/pelias.json echo "--- elasticsearch.yml ---" -cat /tmp/elasticsearch/config/elasticsearch.yml \ No newline at end of file +sudo cat /etc/elasticsearch/elasticsearch.yml