Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/springtainer/springtainer-elasticsearch

Elasticsearch as docker-container for springboot testing
https://github.com/springtainer/springtainer-elasticsearch

elasticsearch spring spring-boot testcontainers testing

Last synced: 1 day ago
JSON representation

Elasticsearch as docker-container for springboot testing

Awesome Lists containing this project

README

        

# springtainer-elasticsearch

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.avides.springboot.springtainer/springtainer-elasticsearch/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.avides.springboot.springtainer/springtainer-elasticsearch)
[![Build](https://github.com/springtainer/springtainer-elasticsearch/workflows/release/badge.svg)](https://github.com/springtainer/springtainer-elasticsearch/actions)
[![Nightly build](https://github.com/springtainer/springtainer-elasticsearch/workflows/nightly/badge.svg)](https://github.com/springtainer/springtainer-elasticsearch/actions)
[![Coverage report](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-elasticsearch&metric=coverage)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-elasticsearch)
[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-elasticsearch&metric=alert_status)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-elasticsearch)
[![Technical dept](https://sonarcloud.io/api/project_badges/measure?project=springtainer_springtainer-elasticsearch&metric=sqale_index)](https://sonarcloud.io/dashboard?id=springtainer_springtainer-elasticsearch)

### Dependency

```xml

com.avides.springboot.springtainer
springtainer-elasticsearch
1.4.0
test

```

### Configuration

Properties consumed (in `bootstrap.properties`):

- `embedded.container.elasticsearch.enabled` (default is `true`)
- `embedded.container.elasticsearch.startup-timeout` (default is `30`)
- `embedded.container.elasticsearch.docker-image` (default is `docker.elastic.co/elasticsearch/elasticsearch:7.17.9`)
- `embedded.container.elasticsearch.http-port` (default is `9200`)
- `embedded.container.elasticsearch.transport-host` (default is `9300`)

Properties provided (in `application-it.properties`):

- `embedded.container.elasticsearch.host`
- `embedded.container.elasticsearch.http-port`
- `embedded.container.elasticsearch.transport-port`

Example for minimal configuration in `application-it.properties`:

```
spring.data.elasticsearch.cluster-nodes=${embedded.container.elasticsearch.host}:${embedded.container.elasticsearch.transport-port}
spring.data.elasticsearch.properties.client.transport.ignore_cluster_name=true
```

## Logging

To reduce logging insert this into the logback-configuration:

```xml

```

## Labels

The container exports multiple labels to analyze running springtainers:

- `SPRINGTAINER_SERVICE=elasticsearch`
- `SPRINGTAINER_IMAGE=${embedded.container.elasticsearch.docker-image}`
- `SPRINGTAINER_STARTED=$currentTimestamp`