<ol>
<li>yes, it will need access to Gitlab API to report back Jenkins build status.</li>
<li>You can create a service account in LDAP such as Jenkins which can be used to generate Gitlab API tokens and use it to preconfigure Jenkins.</li>
<li>Same as point #2</li>
</ol>

<p>For more info - <a href="https://docs.gitlab.com/ee/integration/jenkins.html" rel="nofollow noreferrer">https://docs.gitlab.com/ee/integration/jenkins.html</a></p>

CC BY-SA 3.0
2018-04-30T20:13:44.613Z
2018-04-30T20:13:44.613Z
prashant tyagi
<p>I have Jenkins users authenticated by OpenLDAP and also gitlab CE instance authenticated by the same OpenLDAP.</p>

<p>And all the three are running in three different docker containers in the same network.</p>

<p>I am trying to pre configure Jenkins and Gitlab so that they can be resolved globally in the container world.</p>

<p>I have Jenkins Gitlab plugin pre configured in Jenkins. To add Gitlab in the global configuration, a Gitlab API token is required to be added in Gitlab section along with the server URL for accessing all the resources of the Gitlab instance.</p>

<p>I am trying to do a curl operation from a Jenkins container to Gitlab using a user name and password to Gitlab requesting for Authorization code and a Private token for each a user as to be created in Gitlab. All the user authentication is happening using the OpenLDAP. For Gitlab to generate an Authorization code the user has to be created in Gitlab, which would not be happening if the users are authenticated using OpenLDAP.</p>

<p>My questions are:</p>

<ol>
<li><p>Is it necessary to configure Jenkins with Gitlab globally to have Jenkins complete access at Gitlab resources, since we would require to authenticate once again from each job on a project level?</p></li>
<li><p>How to preconfigure a private token or personal access token in Gitlab from a docker container perspective to be persistent and to be shared with Jenkins when the container spins up for the first time?</p></li>
<li><p>When Gitlab is authenticated using OpenLDAP, without the user previously signing in into Gitlab, is a user not created in Gitlab? How to generate 
an authorization code for a user in this case?</p></li>
</ol>

CC BY-SA 3.0
2017-11-24T23:14:54.770Z
Why do you use both jenkins and gitlab?
030
<docker><jenkins><gitlab>
Globally configuring Gitlab with Jenkins in docker container environment
user3610750
# Globally configuring Gitlab with Jenkins in docker container environment

(Asked by: username_0 on 2017-11-12)

I have Jenkins users authenticated by OpenLDAP and also gitlab CE instance authenticated by the same OpenLDAP.

And all the three are running in three different docker containers in the same network.

I am trying to pre configure Jenkins and Gitlab so that they can be resolved globally in the container world.

I have Jenkins Gitlab plugin pre configured in Jenkins. To add Gitlab in the global configuration, a Gitlab API token is required to be added in Gitlab section along with the server URL for accessing all the resources of the Gitlab instance.

I am trying to do a curl operation from a Jenkins container to Gitlab using a user name and password to Gitlab requesting for Authorization code and a Private token for each a user as to be created in Gitlab. All the user authentication is happening using the OpenLDAP. For Gitlab to generate an Authorization code the user has to be created in Gitlab, which would not be happening if the users are authenticated using OpenLDAP.

My questions are:

1. Is it necessary to configure Jenkins with Gitlab globally to have Jenkins complete access at Gitlab resources, since we would require to authenticate once again from each job on a project level?
2. How to preconfigure a private token or personal access token in Gitlab from a docker container perspective to be persistent and to be shared with Jenkins when the container spins up for the first time?
3. When Gitlab is authenticated using OpenLDAP, without the user previously signing in into Gitlab, is a user not created in Gitlab? How to generate
   an authorization code for a user in this case?

**Tags:** docker, jenkins, gitlab

> **Comments:**
> **username_1**: Why do you use both jenkins and gitlab?  

---

## 1 answers

### Answer by username_2 on 2018-04-30. Score: 1

1. yes, it will need access to Gitlab API to report back Jenkins build status.
2. You can create a service account in LDAP such as Jenkins which can be used to generate Gitlab API tokens and use it to preconfigure Jenkins.
3. Same as point #2

For more info - <https://docs.gitlab.com/ee/integration/jenkins.html>


---

