Use the API to fetch the remote default branch
A simpler and quicker way to fetch the default branch of a remote Git URL.
- Based on #1035 (comment 602953289).
- A more solid solution of !1885 (closed).
- Fixes #1037 (closed).
Test locally
- Check that building the
latest
image fails:docker build --build-arg NANOC_ENV=production --build-arg=CI_COMMIT_REF_NAME=main -t docs:latest -f Dockerfile.main .
- Build the
base
image that includesjq
!1886 (merged)docker build -t registry.gitlab.com/gitlab-org/gitlab-docs:base -f dockerfiles/Dockerfile.gitlab-docs-base .
- Build the
bootstrap
image:docker build -t registry.gitlab.com/gitlab-org/gitlab-docs:bootstrap -f dockerfiles/Dockerfile.bootstrap .
- Build the
latest
image and see it succeeding:docker build --build-arg NANOC_ENV=production --build-arg=CI_COMMIT_REF_NAME=main -t docs:latest -f Dockerfile.main .
After this is merged
-
Find the latest scheduled pipeline in https://gitlab.com/gitlab-org/gitlab-docs/-/pipelines and run the image:docs-latest
job manually. -
Verify that the issue #1035 (closed) is fixed and close it.
Edited by Achilleas Pipinellis