Fix GitLab CI for v9_11
This MR attempts to fix GitLab CI for the v9_11 branch.
Something bad happened to !2438 (merged) - it was intended to be a v9_11 backport of !2423 (merged), but it ended up as a MR which does not change anything. This MR contains the actual changes from !2423 (merged) and thus attempts to correct !2438 (merged).
Subsequently, there was another attempt to fix the problem, in the form of !2444 (merged). This MR reverts the change introduced by that MR in an attempt to keep .gitlab-ci.yml
differences between master and v9_11 minimal.