Migrate CI to Jenkins on 7.x branch (#1114)
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
ARG PYTHON_VERSION=3
|
||||
FROM python:${PYTHON_VERSION}
|
||||
RUN apt-get update && apt-get install -y git curl
|
||||
RUN pip install ipdb python-dateutil GitPython
|
||||
|
||||
RUN git clone https://github.com/elastic/elasticsearch.git /code/elasticsearch
|
||||
|
||||
WORKDIR /code/elasticsearch-py
|
||||
COPY .. .
|
||||
RUN pip install .[develop]
|
||||
RUN python setup.py develop
|
||||
CMD ["/code/wait-for-elasticsearch.sh", "http://elasticsearch:9200", "--", "python", "setup.py", "test"]
|
||||
@@ -1,38 +0,0 @@
|
||||
version: '3.2'
|
||||
services:
|
||||
client:
|
||||
image: docker.elastic.co/clients/elasticsearch-py:${PYTHON_VERSION:-3}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./Dockerfile
|
||||
args:
|
||||
PYTHON_VERSION: ${PYTHON_VERSION:-3}
|
||||
environment:
|
||||
- "TEST_ES_SERVER=http://elasticsearch:9200"
|
||||
volumes:
|
||||
- ..:/code/elasticsearch-py
|
||||
- esvol:/tmp
|
||||
networks:
|
||||
- esnet
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
command: ["true"] # dummy command to override the command in the Dockerfile and do nothing.
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch-oss:${ELASTICSEARCH_VERSION:-6.2.4}
|
||||
volumes:
|
||||
- esvol:/tmp
|
||||
networks:
|
||||
- esnet
|
||||
environment:
|
||||
- path.repo=/tmp
|
||||
- "repositories.url.allowed_urls=http://*"
|
||||
- node.attr.testattr=test
|
||||
- bootstrap.memory_lock=false
|
||||
- "node.name=test"
|
||||
- "cluster.initial_master_nodes=test"
|
||||
- "discovery.zen.ping.unicast.hosts=elasticsearch"
|
||||
- "http.max_content_length=5mb"
|
||||
networks:
|
||||
esnet:
|
||||
volumes:
|
||||
esvol:
|
||||
@@ -1,37 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
host="$1"
|
||||
shift
|
||||
cmd="$@"
|
||||
|
||||
|
||||
until $(curl --output /dev/null --silent --head --fail "$host"); do
|
||||
printf '.'
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# First wait for ES to start...
|
||||
response=$(curl $host)
|
||||
|
||||
until [ "$response" = "200" ]; do
|
||||
response=$(curl --write-out %{http_code} --silent --output /dev/null "$host")
|
||||
>&2 echo "Elasticsearch is unavailable - sleeping"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
|
||||
# next wait for ES status to turn to Green
|
||||
health="$(curl -fsSL "$host/_cat/health?h=status")"
|
||||
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ")
|
||||
|
||||
until [ "$health" = 'green' ]; do
|
||||
health="$(curl -fsSL "$host/_cat/health?h=status")"
|
||||
health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ")
|
||||
>&2 echo "Elasticsearch is unavailable - sleeping"
|
||||
sleep 1
|
||||
done
|
||||
|
||||
>&2 echo "Elasticsearch is up"
|
||||
exec $cmd
|
||||
Reference in New Issue
Block a user