Pass GOOGLE_SEARCH_KEY as a build argument
What does this MR do and why?
We need to pass the GOOGLE_SEARCH_KEY
as a build argument when building
the stable images, otherwise it will be empty.
In !3869 (merged), we added the variable in the Dockerfile, but forgot to pass it as an argument at build time.
How to set up and validate locally
-
Check that the variable is empty for the already built image:
$ docker run --rm registry.gitlab.com/gitlab-org/gitlab-docs:16.0 grep GOOGLE_SEARCH_KEY "/usr/share/nginx/html/16.0/index.html" <script>const GOOGLE_SEARCH_KEY=""</script>
-
Build the 16.0 image and pass the variable:
docker build --build-arg NANOC_ENV=production --build-arg VER=16.0 --build-arg SEARCH_BACKEND="google" --build-arg GOOGLE_SEARCH_KEY="12344" --tag docs:16.0 -f dockerfiles/single.Dockerfile .
-
Check that the variable is there:
$ docker run --rm docs:16.0 grep GOOGLE_SEARCH_KEY "/usr/share/nginx/html/16.0/index.html" <script>const GOOGLE_SEARCH_KEY="1234"</script>
Edited by Achilleas Pipinellis