Elasticsearch Integ Tests

To run integ tests against ElasticSearch use Elastic's official docker image as a base and extend it by sudo

FROM elasticsearch:8.2.2
USER root
RUN apt update && apt install -y sudo

Suppose you published the image to oozie/elastic. From there, simply run your integ tests in the task container. ElasticSearch will take about 30 seconds to boot up.

Running an ElasticSearch instance in a Concourse task

A minimal self-contained pipeline:

jobs:
- name: run-elastic
plan:
- task: integtest
config:
platform: linux
image_resource:
type: docker-image
source:
repository: oozie/elastic
run:
path: /bin/bash
args:
- -c
- |
(sudo -u elasticsearch /usr/share/elasticsearch/bin/elasticsearch -Expack.security.enabled=false -E discovery.type=single-node > elastic.log) &
while ! curl http://localhost:9200; do sleep 10; done