Skip to content

Commit

Permalink
Add new env variable LDAP_IS_MODIFIABLE. Which allows us to interact …
Browse files Browse the repository at this point in the history
…with LDAP configuration through jenkins, Allowed values true (default) and false.
  • Loading branch information
marisbahtins committed Nov 15, 2017
1 parent 8fa44d8 commit 229bd4c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ENV GERRIT_PORT 8080
ENV GERRIT_SSH_PORT 29418
ENV GERRIT_PROFILE="ADOP Gerrit" GERRIT_JENKINS_USERNAME="" GERRIT_JENKINS_PASSWORD=""


# Copy in configuration files
COPY resources/plugins.txt /usr/share/jenkins/ref/
COPY resources/init.groovy.d/ /usr/share/jenkins/ref/init.groovy.d/
Expand All @@ -25,7 +24,7 @@ RUN chmod +x -R /usr/share/jenkins/ref/adop_scripts/ && chmod +x /entrypoint.sh
# USER jenkins

# Environment variables
ENV ADOP_LDAP_ENABLED=true ADOP_ACL_ENABLED=true ADOP_SONAR_ENABLED=true ADOP_ANT_ENABLED=true ADOP_MAVEN_ENABLED=true ADOP_NODEJS_ENABLED=true ADOP_GERRIT_ENABLED=true
ENV ADOP_LDAP_ENABLED=true LDAP_IS_MODIFIABLE=true ADOP_ACL_ENABLED=true ADOP_SONAR_ENABLED=true ADOP_ANT_ENABLED=true ADOP_MAVEN_ENABLED=true ADOP_NODEJS_ENABLED=true ADOP_GERRIT_ENABLED=true
ENV LDAP_GROUP_NAME_ADMIN=""
ENV JENKINS_OPTS="--prefix=/jenkins -Djenkins.install.runSetupWizard=false"
ENV PLUGGABLE_SCM_PROVIDER_PROPERTIES_PATH="/var/jenkins_home/userContent/datastore/pluggable/scm"
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Additional environment variables that allow fine tune Jenkins runtime configurat
* DOCKER_CERT_PATH, Docker CLI variable to declare the path to the certificate
* DOCKER_NETWORK_NAME, the Docker custom network to launch containers on
* GROOVY_VERSION, a comma delimited list of Groovy installation profiles to install (e.g. 2.4.8, 2.4.3).
* LDAP_IS_MODIFIABLE, allows us to interact with LDAP configuration through jenkins, Allowed values true (default) and false. If set to true, LDAP can be modified and jenkins will be able to create necessary users/groups in LDAP. If set to false, LDAP can not be modified and jenkins need be configured to use existing users/groups in LDAP. This variable will be used when ADOP_LDAP_ENABLED is set to true.

## Run adop-jenkins with OpenLDAP
The following assumes that MySQL and OpenLDAP are running.
Expand Down
5 changes: 5 additions & 0 deletions resources/init.groovy.d/adop_general.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def scmProviderPropertiesPath = env['PLUGGABLE_SCM_PROVIDER_PROPERTIES_PATH']
def scmProviderPluggablePath = env['PLUGGABLE_SCM_PROVIDER_PATH']
def adopLdapEnabled = env['ADOP_LDAP_ENABLED']
def adopAclEnabled = env['ADOP_ACL_ENABLED']
def ldapIsModifiable = env['LDAP_IS_MODIFIABLE']

def cartridgeSources = env['CARTRIDGE_SOURCES']

Expand Down Expand Up @@ -122,6 +123,10 @@ Thread.start {
envVars.put("ADOP_ACL_ENABLED", adopAclEnabled)
}

if (ldapIsModifiable != null ) {
envVars.put("LDAP_IS_MODIFIABLE", ldapIsModifiable)
}

// Jenkins SSH Credentials
println "--> Registering SSH Credentials"
def system_credentials_provider = SystemCredentialsProvider.getInstance()
Expand Down

0 comments on commit 229bd4c

Please sign in to comment.