File: curator

package info (click to toggle)
elasticsearch-curator 5.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,708 kB
  • sloc: python: 14,223; sh: 395; makefile: 163
file content (30 lines) | stat: -rwxr-xr-x 783 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e

# Configure and start elasticsearch
echo "START_DAEMON=true" >> /etc/default/elasticsearch
echo 'path.repo: ["/tmp"]' >> /etc/elasticsearch/elasticsearch.yml
echo "Restarting Elasticsearch"
invoke-rc.d --quiet elasticsearch restart

# Wait until ES is up
tries=0
echo -n "Waiting for Elasticsearch to initialize"
while ! curl -s -XGET 'http://localhost:9200/_cluster/health' >/dev/null; do
	echo -n "."
	tries=$(($tries + 1))
	if [ $tries -gt 45 ]; then
		echo
		echo "Timed out waiting for elasticsearch to initialize"
		exit 1
	fi
	sleep 1;
done

echo " done."
echo "Running tests"

# Run as the 'elasticsearch' user to ensure that the FS repo directories
# created by the tests will be accessible by ES.
cd test && su -s /bin/sh -c ./run_tests.py elasticsearch