I am at
Jenkins ver 2.46.2
My test case was:
-Pipeline job that checked out single Jenkinsfile
-"Poll SCM" was checked, but schedule was empty
-"Triggered builds remotely (eg from scripts)" and I set a Authentication token
-Gitlab has this trigger for my job: http://myserver:8080/job/test.infinite.loop/build?token=mytoken
-Tried the exclude logic from the job config in UI, as well as from in Jenkinsfile using "checkout scm".
-My Jenkinsfile calls these maven commands to simulate a release: versions:set, versions:commit, scm:add and scm:checkin, which just updates the pom.xml file with the next version.
I tested every combination I could think of.
Setting different user.name at checkout time using additional behaviour, changing displayname as defined in /etc/passwd, adding multiple users to exclude list, trying logic at job level, and in pipeline using 'checkout SCM'.
Something to note is Jenkins reports the job was triggered by the user 'jenkins' as that is the user Jenkins is running as, but the user that checks into GIT is what is defined as the display name from /etc/passwd file. So I am not exactly sure what user it SHOULD be expecting to try to exclude, but I have tried to exclude all the different users, individually as well as in a multiple list.
This is from the "Changes" link in a particular build and shows that 'jenkins' did it, as 'jenkins' is the unix user that Jenkins is running under.
*Commit f3b85jh3jh4k3j4h5kj3h45kj2k3j2bfc9c99727c566ba718c2 by *jenkins [ci-skip] updating pom to 2017.08.427
But in GITLAB, the checkin comment shows the user that is defined as the display name in the /etc/passwd file for the user. I have also tried changing that displayname to match the actual username, so it is the same value on both sides, to no avail.
[ci-skip] updating pom to 2017.08.427
CMJenkins committed 2 minutes ago
In my pom i use these GIT connection urls, so I have an SSH key setup between the user jenkins is running as, and the user we are connecting to GIT with, which is a different user, (and I've tried to exclude that one too)
It doesn't mean much, but I have a similar setup using 1.X Jenkins interacting with GitHub and things work as they should.
Thanks for everything.