# Testing

To run tests, you must run elastic:
```bash
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms2g -Xmx2g" registry.iwarma.ru/iwa/dev/console-docker/console-elasticsearch:latest
```

Second variant:
```
docker-compose -f cicd/docker-compose.yml up -d && docker-compose -f cicd/docker-compose.yml logs -f golang
docker-compose -f cicd/docker-compose.yml down
```

# Testing SSL

To test against SSL, you should use [this](https://www.elastic.co/guide/en/elasticsearch/reference/current/configuring-tls-docker.html) instruction for
creating elastic with SSL.

To test ssl connection, use:
```bash
curl -k -u elastic:changeme https://elasticsearch:9200/
```

*Important!* need to change elastic password to `changeme` in `.env` file

# Building

To build correlator for running with docker:
```bash
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"'
```

This will build static version of correlator witch can be used on alpine image, maybe on mac .