gitlab-zoekt
This repository includes three binaries:
gitlab-zoekt-indexer: Original indexer binary
gitlab-zoekt-webserver: Original webserver binary
gitlab-zoekt: New unified binary that can run in either indexer or webserver mode
Compiling the binaries
# Build the original indexer
$ make build
$ ./bin/gitlab-zoekt-indexer
2023/08/14 11:07:29 Usage: ./bin/gitlab-zoekt-indexer [ --version | --index_dir=<DIR> | --path_prefix=<PREFIX> | --listen=:<PORT> ]
# Build the original webserver
$ make build_web
# Build the unified binary
$ make build_unified
$ ./bin/gitlab-zoekt
Usage: ./bin/gitlab-zoekt <command> [options]
Commands:
indexer Run in indexer mode
webserver Run in webserver mode
version Print version information
For command specific help:
./bin/gitlab-zoekt <command> -help
Using the unified binary
The unified binary supports both indexer and webserver modes:
# Run in indexer mode
$ ./bin/gitlab-zoekt indexer -index_dir=/data/index -listen=:6060
# Run in webserver mode
$ ./bin/gitlab-zoekt webserver -index_dir=/data/index -listen=:6070
# Show help for a specific mode
$ ./bin/gitlab-zoekt indexer -help
$ ./bin/gitlab-zoekt webserver -help
# Show version information
$ ./bin/gitlab-zoekt version
Running indexer in GDK mode
Original binary
- Set
GDK_DIR env variable (for example, export GDK_DIR="$HOME/projects/gdk").
- Stop GDK indexer if you have it running via
gdk stop gitlab-zoekt-indexer-development.
- Execute
make gdk or make watch-gdk. The latter will restart indexer after every change (requires watchexec).
Unified binary
- Set
GDK_DIR env variable (for example, export GDK_DIR="$HOME/projects/gdk").
- Stop GDK indexer if you have it running via
gdk stop gitlab-zoekt-indexer-development.
- Execute
make gdk_unified. This will run the unified binary in indexer mode.
Running indexer with docker-compose
For trying out zoekt. Not an official installation method.
See example
Running tests
- Install a suitable docker client
- Add zoekt-webserver to your PATH. If you have zoekt enabled in your GDK you can do:
export GDK_DIR="$HOME/projects/gdk"
export PATH="$GDK_DIR/zoekt/bin:$PATH"
- Run the dependencies:
docker-compose up
- Run the tests:
# One time
make test
# On every change (requires https://github.com/watchexec/watchexec installed)
make watch-test