This project indexes Git repositories into Elasticsearch for GitLab. See the homepage for more information.
This project relies on ICU for text encoding;
ensure the development packages for your platform are installed before running
make
:
# apt install libicu-dev
$ brew install icu4c
$ export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
make
sudo make install
gitlab-elasticsearch-indexer
will be installed to /usr/local/bin
You can change the installation path with the PREFIX
env variable. Please remember to pass the -E
flag to sudo if you do so.
Example:
PREFIX=/usr sudo -E make install
Test suite expects Gitaly and Elasticsearch to be run. You can run it with docker:
docker run -p 8075:8075 registry.gitlab.com/gitlab-org/build/cng/gitaly:latest
and Elasticsearch:
docker run -itd -p 9200:9200 elasticsearch:6.1
Before running tests, set configuration variables`
export GITALY_CONNECTION_INFO='{"address": "tcp://localhost:8075", "storage": "default"}'
export ELASTIC_CONNECTION_INFO='{"url":["http://localhost:9200"], "index_name":"gitlab-test"}'
Note: If using a socket, please pass your URI in the form unix://FULL_PATH_WITH_LEADING_SLASH
Example:
export GITALY_CONNECTION_INFO='{"address": "unix:///gitlab/gdk/gitaly.socket", "storage": "default"}'
to run some specific test, run
go test -v gitlab.com/gitlab-org/gitlab-elasticsearch-indexer -run TestIndexingGitlabTest
to run the whole test suite
make test
Please see the contribution guidelines