Build a Docker image with lunr.js enabled
Addresses #1255 (closed).
-
Updates the .gitlab-ci.yml
file to add one more job and test to build the archived version pushed to a new registry folder (registry.gitlab.com/gitlab-org/gitlab-docs/archives:$VER
). -
Find out how to make use of the index script make build-lunr-index
.
-
Test that lunr is enabled with SEARCH_ALGOLIA=false
: A small test is run to verify that thejs-lunr-form
class is enabled (source).- https://gitlab.com/gitlab-org/gitlab-docs/-/jobs/3198404287 - single image test with lunr enabled. The test passed.
- https://gitlab.com/gitlab-org/gitlab-docs/-/jobs/3198404286 - single image test with Algolia enabled. I added this test to verify that it would fail, and it did.
How to verify locally
Build the site with ALGOLIA_SEARCH="false"
set, and then build the index:
ALGOLIA_SEARCH="false" bundle exec nanoc compile
make build-lunr-index
make check-lunr-index
To emulate the CI environment:
docker build --build-arg NANOC_ENV=test --build-arg VER=15.4 --build-arg ALGOLIA_SEARCH="false" -t 15.4:lunrjs -f dockerfiles/single.Dockerfile .
CI=true IMAGE_NAME=15.4:lunrjs GITLAB_VERSION=15.4 make check-lunr-index