Mikhail
Mikhail

Reputation: 3746

Jenkins filter branches empty

I'm using Jenkins v 1.601 with git and gitlab plugin and gitLab as a repository manager. I want to trigger build only when push occurred to specific branch. I have enabled gitlab CI and added project url. In jenkins job configuration I want to select only specific branch in filter branches part, but that field is empty. How can I fix it?

As a side note that might be helpful, there is token field in gitlab CI service, but I can't find any way to use it in jenkins.

Upvotes: 1

Views: 3047

Answers (1)

Mikhail
Mikhail

Reputation: 3746

I found out the answer after checking out gitlab plugin docs. In order to have jenkins see project branches in the job configuration, you need to get your account token from gitlab and add it in jenkins configure system page gitlab plugin. After that, you have to add that account to the project in gitlab (even as guest will suffice) and then in jenkins job configuration you will be able to see branches from the repo.

As for the token field in gitlab project ci settings according to docs:

For Token put any random string (This is not yet functioning)

Upvotes: 1

Related Questions