Search code examples
gitlabdevopsgitlab-cigitblit

Gitlab take other version control source


In my team we have GitBlit like version control system, and we are interested by GitLab CICD plugins.

If convinced, in the future we could import alls projects but for the moment i would like to use GitlabCI keeping GitBlit like source control.

Is it possible ?

I try the "import project" functionnality but it create a new repository in Gitlab and cut the relation with GitBlit. Thanks in advance


Solution

  • Your CI definition (.gitlab-ci.yml) is located in a Gitlab repository and is executed when you commit / push to that repository, so in order to really test and experience the full potential of, in my opinion, the awesome CI abilities of Gitlab you should just migrate a repo.

    On the other hand I do understand that is not always so easy, so I also have an alternative for you (this is however, advanced usage):

    • Create a Gitlab repo with only a .gitlab-ci.yml file to define the build-steps you want to execute
    • Add a git clone <your GitBlit repo url> . command to your .gitlab-ci.yml's before_script to get your GitBlit code in a Gitlab CI job
    • Use triggers to run the pipeline when something is pushed to GitBlit by adding a hook in GitBlit that sends a POST request to Gitlab

    EDIT based on comment:

    A POST-request will look like this:

    curl --request POST \
         --form token=TOKEN \
         --form ref=master \
         https://myGitlab/api/v4/projects/1/trigger/pipeline