Search code examples
gitlabgitlab-cigitlab-ci-runner

GitLab Dynamically run jobs in parallel


I have a project which generate go main files in folders which follow certain convention. The problem is I need to build those projects parallelly in Gitlab CI pipeline when there is a code push and I cant hardcode them in .gitlab-ci.yml as they are generated on fly. I need to build those go projects in parallel and need to pass build stage if all the individual project builds are succeeded. Can someone please let me know if it is possible in Gitlab.


Solution

  • Unfortunately gitlab CI doesn't support this it seems as per https://gitlab.com/gitlab-org/gitlab-ce/issues/23455. As mentioned in this issue and @Jakub, I am looking for something like this(Some glob or template sort of solution) so that I could parallelize jobs on fly:

    build_%:
      image: dnd
      stage: build
      glob: microservices/*/Dockerfile
      context: microservices/{1}
      script:
        - docker build  {1}
     parallel: true
    

    So I have decided to use go templates for now until Gitlab CI comes with one solution.