forked from jbdemonte/mongoose-elasticsearch-xp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
58 lines (47 loc) · 2.63 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
language: node_js
cache:
yarn: true
directories:
- node_modules
node_js:
- "10"
- "8"
addons:
apt:
packages:
- oracle-java9-set-default
services:
- mongodb
- elasticsearch
env:
- ES=2
- ES=5
- ES=6
- ES=7
before_install:
- if [ "$ES" -eq "2" ]; then echo "DOWNLOADING V2"; curl -O https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.0/elasticsearch-2.2.0.deb && sudo dpkg -i --force-confnew elasticsearch-2.2.0.deb ; fi
- if [ "$ES" -eq "5" ]; then echo "DOWNLOADING V5"; curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.deb && sudo dpkg -i --force-confnew elasticsearch-5.0.0.deb ; fi
- if [ "$ES" -eq "6" ]; then echo "DOWNLOADING V6"; curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.0.0.deb && sudo dpkg -i --force-confnew elasticsearch-6.0.0.deb ; fi
- if [ "$ES" -eq "7" ]; then echo "DOWNLOADING V7"; curl -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.0.1-amd64.deb && sudo dpkg -i --force-confnew elasticsearch-7.0.1-amd64.deb ; fi
- echo `pwd`
- sudo cat ./scripts/docker/es${ES}/elasticsearch.yml |sudo tee -a /etc/elasticsearch/elasticsearch.yml
- sudo cat /etc/elasticsearch/elasticsearch.yml
- sudo chown -R elasticsearch:elasticsearch /etc/default/elasticsearch # https://discuss.elastic.co/t/permission-denied-starting-elasticsearch-7-0/179336
- sudo chown -R elasticsearch:elasticsearch /etc/elasticsearch
- sudo chown -R elasticsearch:elasticsearch /usr/share/elasticsearch
- if [ "$ES" -eq "5" -o "$ES" -eq "6" ];then sudo service elasticsearch start; fi
- if [ "$ES" -eq "2" -o "$ES" -eq "7" ];then sudo service elasticsearch restart; fi
- sleep 15
- sudo tail -n50 /var/log/elasticsearch/elasticsearch_xp.log || true # Don't die on this
- sudo service elasticsearch status
script:
- if [ "$ES" -eq "2" ]; then echo "RUNNING V2"; npm run-script test-v2-covered ; fi
- if [ "$ES" -eq "5" ]; then echo "RUNNING V5"; npm run-script test-v5-covered ; fi
- if [ "$ES" -eq "6" ]; then echo "RUNNING V6"; npm run-script test-v6-covered ; fi
- if [ "$ES" -eq "7" ]; then echo "RUNNING V7"; npm run-script test-v7-covered ; fi
after_success:
- 'curl -Lo travis_after_all.py https://git.io/travis_after_all'
- python travis_after_all.py
- export $(cat .to_export_back) &> /dev/null
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 ]]; then cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js; fi
- if [[ "$TRAVIS_JOB_NUMBER" == *.1 && "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]]; then npm run semantic-release; fi