Gitlab lets you run any step with a different docker base image. How about instead of bash scripting in the yaml, you just put scripts, in any language, in a docket file, and simply use bash to call those scripts. The gitlab yaml is not designed for you to code in, bash is just a standard interface for calling into other things.