GitLab Docs monthly release process
The following Dockerfiles are used.
||Contains all the dependencies that are needed to build the website. If the gems are updated and
||Base image to build the docs website. It uses
||Base image to use for building documentation archives. It uses
||Contains all the versions of the website in one archive. It copies all generated HTML files from every version in one location.|
How to build the images
Although build images are built automatically via GitLab CI/CD, you can build and tag all tooling images locally:
Make sure you have Docker installed.
Make sure you're on the
dockerfiles/directory of the
Build the images:
docker build -t registry.gitlab.com/gitlab-org/gitlab-docs:bootstrap -f Dockerfile.bootstrap ../ docker build -t registry.gitlab.com/gitlab-org/gitlab-docs:builder-onbuild -f Dockerfile.builder.onbuild ../ docker build -t registry.gitlab.com/gitlab-org/gitlab-docs:nginx-onbuild -f Dockerfile.nginx.onbuild ../
For each image, there's a manual job under the
images stage in
.gitlab-ci.yml which can be invoked at will.
Monthly release process
When a new GitLab version is released on the 22nd, we need to create the respective single Docker image, and update some files so that the dropdown works correctly.
1. Add the chart version
Since the charts use a different version number than all the other GitLab products, we need to add a version mapping:
- Check that there is a stable branch created
for the new chart version. If you're unsure or can't find it, drop a line in
- Make sure you're on the root path of the
content/_data/chart_versions.yamland add the new stable branch version using the version mapping. Note that only the
major.minorversion is needed.
- Create a new merge request and merge it.
TIP: Tip: It can be handy to create the future mappings since they are pretty much known. In that case, when a new GitLab version is released, you don't have to repeat this first step.
2. Create an image for a single version
The single docs version must be created before the release merge request, but this needs to happen when the stable branches for all products have been created.
Make sure you're on the root path of the
Make sure your
git pull origin master
Run the raketask to create the single version:
Dockerfile.12.0should have been created and committed to a new branch.
.gitlab-ci.ymland replace the
BRANCH_variables with their respective upstream stable branch. For example, 12.6 would look like:
variables: BRANCH_EE: '12-6-stable-ee' BRANCH_OMNIBUS: '12-6-stable' BRANCH_RUNNER: '12-6-stable' BRANCH_CHARTS: '2-6-stable'
Push the newly created branch, but don't create a merge request. Once you push, the
image:docker-singejob will create a new Docker image tagged with the branch name you created in the first step. In the end, the image will be uploaded in the Container Registry and it will be listed under the
Optionally, you can test locally by building the image and running it:
docker build -t docs:12.0 -f Dockerfile.12.0 . docker run -it --rm -p 4000:4000 docs:12.0
http://localhost:4000/12.0/ to see if everything works correctly.
3. Create the release merge request
Now it's time to create the monthly release merge request that adds the new version and rotates the old one:
Make sure you're on the root path of the
Create a branch
git checkout master git checkout -b release-12-0
Rotate the online and offline versions:
At any given time, there are 4 browsable online versions: one pulled from the upstream master branches (docs for GitLab.com) and the three latest stable versions.
content/_data/versions.yamland rotate the versions to reflect the new changes:
online: The 3 latest stable versions.
offline: All the previous versions offered as an offline archive.
Add the new offline version in the 404 page redirect script:
Since we're deprecating the oldest version each month, we need to redirect those URLs in order not to create 404 entries. There's a temporary hack for now:
content/404.html, making sure all offline versions under
The following two Dockerfiles need to be updated:
dockerfiles/Dockerfile.archives- Add the latest version at the top of the list.
Dockerfile.master- Rotate the versions (oldest gets removed and latest is added at the top of the list).
In the end, there should be four files in total that have changed. Commit and push to create the merge request using the "Release" template:
git add content/ Dockerfile.master dockerfiles/Dockerfile.archives git commit -m "Release 12.0" git push origin release-12-0
4. Update the dropdown for all online versions
The versions dropdown is in a way "hardcoded". When the site is built, it looks
at the contents of
content/_data/versions.yaml and based on that, the dropdown
is populated. So, older branches will have different content, which means the
dropdown will list one or more releases behind. Remember that the new changes of
the dropdown are included in the unmerged
The content of
content/_data/versions.yaml needs to change for all online
Run the raketask that will create all the respective merge requests needed to update the dropdowns and will be set to automatically be merged when their pipelines succeed. The
release-X-Ybranch needs to be present locally, otherwise the raketask will fail:
Visit the merge requests page to check that their pipelines pass, and once all are merged, proceed to the following and final step.
TIP: Tip: In case a pipeline fails, see troubleshooting.
5. Merge the release merge request
The dropdown merge requests should have now been merged into their respective version (stable branch), which will trigger another pipeline. At this point, you need to only babysit the pipelines and make sure they don't fail:
- Check the pipelines page and make sure all stable branches have green pipelines.
- After all the pipelines of the online versions succeed, merge the release merge request.
- Finally, run the Build docker images weekly
pipeline that will build the
Once the scheduled pipeline succeeds, the docs site will be deployed with all new versions online.
Update an old Docker image with new upstream docs content
If there are any changes to any of the stable branches of the products that are not included in the single Docker image, just rerun the pipeline for the version in question.
Porting new website changes to old versions
CAUTION: Warning: Porting changes to older branches can have unintended effects as we're constantly changing the backend of the website. Use only when you know what you're doing and make sure to test locally.
The website will keep changing and being improved. In order to consolidate those changes to the stable branches, we'd need to pick certain changes from time to time.
If this is not possible or there are many changes, merge master into them:
git branch 12.0 git fetch origin master git merge origin/master
Releasing a new version is a long process that involves many moving parts.
test_internal_links_and_anchors failing on dropdown merge requests
We now pin versions in the
.gitlab-ci.yml of the respective branch,
so the steps below are deprecated.
When updating the dropdown for the stable versions, there may be cases where some links might fail. The process of how the dropdown MRs are created have a caveat, and that is that the tests run by pulling the master branches of all products, instead of the respective stable ones.
This happened because there has been a rename of a product (
and the old name was still referenced in the 12.2 docs. If the respective stable
branches for 12.2 were used, this wouldn't have failed, but as we can see from
master branches were pulled.
To fix this, re-run the pipeline
update-12-2-for-release-12-4 branch, by including the following environment variables:
This should make the MR pass.