How do I trigger a build in Jenkins, with Git push to SCM-manager, when Jenkins does not allow anonymous user?

1.9k views Asked by At

Our buildserver at work is a Windows server 2012 r2. We have Jenkins installed as a Windows service on localhost:8081. We have Scm-Manager installed as a service on localhost:8082. (https://www.scm-manager.org/) We use Git as our version control.

Now we do not want anonymous user to have overall read (due to confidential stuff).

Before we removed the anonymous access we had configured the Jenkins project to trigger build remotely with a token "build". In SCM-Manager we used the Jenkins plugin to send the token "build" and only the master branch.

This doesn't work anymore.

I am looking at the plugin called Webhooks in Scm-manager. To do a http POST. Is this the solution? If so, how? I am doing something wrong. Other solutions?

2

There are 2 answers

0
madbys On BEST ANSWER

I made it work, but not as suggested. I configured my local git repositories in scm-manager with: Jenkins-URL: e.g http://localhost:8082/, Jenkins-project name: e.g. "testProj", token e.g. "build", a Jenkins user name and the Jenkins user API-token. In my Jenkins project config: Project name: "testProj", Checked: Trigger build remotely, with token "build", and needed credential, a user name with password, with a user i scm-manager that had All repository read permission.

2
sdorra On

You could use the global configuration of the scm-jenkins-plugin. The global configuration method uses push notifications from the jenkins git-plugin. SCM-Manager will send the url of a changed repository after each successful push, jenkins will build each repository which this scm url and enabled polling. Please have a look at the "Global configuration" section of this wiki page. This method will work with and without enabled authentication.