Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command to clean elasticsearch #163

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ install-helm-readme:
helm-readme:
./scripts/generate_helm_readme.sh

#: Cleans Elasticsearch data, works only with default ES port. The command may take a very long time to complete
clean-elasticsearch:
@indices=$(shell curl -s -X GET "http://localhost:9200/_cat/indices" | awk '{print $$3}') ;\
for index in $$indices ; do \
echo "Deleting all documents from index $$index" ;\
curl -X POST "http://localhost:9200/$$index/_delete_by_query?conflicts=proceed" -H "Content-Type: application/json" -d '{"query": {"match_all": {}}}' ;\
echo "" ;\
done

#: Shows info about available commands
help:
@grep -B1 -E "^[a-zA-Z0-9_-]+\:([^\=]|$$)" Makefile \
Expand Down
91 changes: 48 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ All configuration variables can be checked in the [config directory](./config/).
#### Available Commands

<!--- GENERATED by ./scripts/add_descriptions_to_readme.sh --->

- `make all`: Builds binary executables for all OS (Win, Darwin, Linux).
- `make run`: Runs the Go Exporter application.
- `make build-linux`: Builds a binary executable for Linux.
Expand All @@ -124,8 +124,9 @@ All configuration variables can be checked in the [config directory](./config/).
- `make minify`: Minifies the binary executables.
- `make install-helm-readme`: Installs readme-generator-for-helm tool.
- `make helm-readme`: Generates Helm chart README.md file.
- `make clean-elasticsearch`: Cleans Elasticsearch data, works only with default ES port. The command may take a very long time to complete.
- `make help`: Shows info about available commands.

<!--- **************************************************** --->

#### File Structure
Expand All @@ -136,87 +137,91 @@ The binary executables are saved in the out directory.
#### Example Usage

<!--- GENERATED by ./scripts/add_descriptions_to_readme.sh --->

Builds binary executables for all OS (Win, Darwin, Linux):

make all

Runs the Go Exporter application:

make run

Builds a binary executable for Linux:

make build-linux

Builds a binary executable for Darwin:

make build-darwin

Builds a binary executable for Windows:

make build-windows

Builds a Docker image for the Go Exporter application:

make build-docker

Builds a multi-arch Docker image (`amd64` and `arm64`):

make build-docker-multi

Deletes all binary executables in the out directory:

make clean

Runs all tests:

make test

Displays test coverage report:

make test-coverage

Starts a Docker-compose configuration:

make compose

Starts a Docker-compose configuration until it's ready:

make wait-for-compose

Stops a Docker-compose configuration:

make compose-down

Verifies the metrics from the Go Exporter application:

make verify-metrics

Pulls the Docker image from the registry:

make pull

Shows logs from the Docker-compose configuration:

make logs

Minifies the binary executables:

make minify

Installs readme-generator-for-helm tool:

make install-helm-readme

Generates Helm chart README.md file:

make helm-readme


Cleans Elasticsearch data, works only with default ES port. The command may take a very long time to complete:

make clean-elasticsearch

Shows info about available commands:

make help

<!--- **************************************************** --->

## Helper Scripts
Expand Down