I have setup a parametrized job for self-service deployments in Jenkins.
Users can select a version of the application and the environment to deploy to.
The available environments displayed to the user is currently just a static list of strings (
choice parameter).
Now i want to restrict deployments to some environments based on the LDAP-groups of the current user.My user-page in jenkins displays something like:
Jenkins User Id: maku
Groups:
adm_proj_a
nexus_admin
ROLE_ADM_PROJ_XY
ROLE_BH_KK
How do i get these groups within a groovy-script?I tried to use
dynamic choice parameter (scriptler) and get the LDAP-groups using a groovy-script but did not find my way through the Jenkins-API.
Any hints welcome
PS: Question also posted here:
http://stackoverflow.com/questions/24279864/jenkins-how-to-get-a-users-ldap-groups-in-groovy-script