I have a following Jenkins Job definition:
- scm:
name: some-project
scm:
- git:
url: git@gitlab.****/some-project.git
credentials-id: some-ssh-username-with-private-key
branches:
- origin/master
- project:
name: some-project
jobs:
- '{name}':
triggers:
gitlab:
trigger-push: true
trigger-merge-request: false
trigger-open-merge-request-push: never
Now this job can be uploaded to Jenkins without error but if I go to Configure
page of some-project
in Jenkins Web UI, I can see that Build when a change is pushed to GitLab
in Triggers section is not enabled. GitLab repo gets configured correctly - Source Code Management section of this job has git@gitlab.****/some-project.git
with some-ssh-username-with-private-key
credentials and branch origin/master
configured. But without working triggers this is useless.
What am I doing wrong?
Please note that I'm not asking how to configure GitLab WebHooks to trigger Jenkins job. I can do this manually and it works fine. But we want to manage our Jenkins jobs with Jenkins Job builder to avoid error prone process of configuring them via Web UI and to keep track of changes in job configuration - we are creating git repository with Jenkins job definitions.