Re: Using multiple AD servers

2019-09-17 Thread Pavel Novák
Hi, 
we were using setup with multiple domains, and it worked, 
recently we reconfigured setup to use kind of global AD catalog, (which is 
wrapping all domains) 

What will happen with jenkins users once you will configure multiple ADs 
and there will be same ID on both domains I am quite not sure, 
I think its readon only ldapID and group membership if its configured, I am 
worrying it will do not read any other parameter, but maybe 


Dne pondělí 16. září 2019 11:09:33 UTC+2 Mike Bayliss napsal(a):
>
> Does anybody have experience with using multiple Active Directory servers?
>
> Specifically, we're looking a case where our users will gradually migrate 
> from one AD domain to another, using a SIDhistory attribute in the new AD 
> to match against the objectSID in the old AD. Is that supported by Jenkins 
> (current LTS server on Linux), or am I going to end up with two distinct 
> user populations?
>
> THanks,
>
> Mike
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/acc45e1f-59ee-4e91-973c-43b796776950%40googlegroups.com.


Re: Configure Linux and Windows slave node

2018-10-08 Thread Pavel Novák
Hi,
there is a link with which describes step by step, how to add the agent , 
new node 
https://linuxacademy.com/blog/devops/adding-a-jenkins-agent-node/

It seems to be possible add it via pipeline as well
https://support.cloudbees.com/hc/en-us/articles/218154667-Create-a-Permanent-Agent-from-Groovy-Console

launch methods are:
- via ssh
- via webstart
- via execution command on master
- control windows slave as windows service

I have linux slaves made by ssh access and windows via webstart, eg. 

Dne čtvrtek 4. října 2018 15:35:53 UTC+2 gotvi...@gmail.com napsal(a):
>
> What are the methods to configure a Linux and Windows slave node?
>
> Is there a runbook for it?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/4b7a213c-1a59-4555-9d2e-f5b02cb76091%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Jenkins global metrics

2018-10-01 Thread Pavel Novák
Hi, for that probably the best fits custom pipeline script
I have the similar
- reading total number of builds and the builds in the given period

Feel free to customize it or use as starting point if interested) - in 
attachment 

Dne středa 26. září 2018 21:29:23 UTC+2 gotvi...@gmail.com napsal(a):
>
> I'm looking to generate a report, as a job, which will provide the global 
> metrics of my Jenkins instance.  I need details in the report like (1) How 
> many jobs ran? (2) # of failed and successful jobs and every possible 
> metrics possible in one report.  I need to send this report every week to 
> my management, so would like to know if it's possible to schedule a job to 
> run this report every Friday and send the metrics by email to my managers?  
> I found these two plugins - '*Global Build Status*' and '*Build Metrics*'.  
> But not able to use these as part of a job, download the report or email a 
> link to the report or nothing of that sort.  Please help.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6bd6b942-9f06-4960-8dd2-d3efb82a50a4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


build stat.txt.groovy
Description: Binary data


Re: Get folder's permission

2018-09-17 Thread Pavel Novák
I found nice repository from cloudbees 
https://github.com/cloudbees/jenkins-scripts


and there is a script existing already 
https://github.com/cloudbees/jenkins-scripts/blob/master/auth-project-report.groovy

So I have take inspiration and did my script regarding the followup from 
the links above
- reading folders
- reads permissions
- if there is a user with "external" in the fullName, then store it, and if 
there are found at least 1 externals, it got printed out in pseudo-csv like 
*folderName;URL;userID;userFullName;mailAddres*

See below





*//taken @ 
https://github.com/cloudbees/jenkins-scripts/blob/master/auth-project-report.groovy//https://javadoc.jenkins.io/plugin/matrix-auth/com/cloudbees/hudson/plugins/folder/properties/AuthorizationMatrixProperty.html//https://javadoc.jenkins.io/plugin/cloudbees-folder/com/cloudbees/hudson/plugins/folder/AbstractFolder.html//https://javadoc.jenkins.io/hudson/security/Permission.htmldef
 
folderdef URLList adminUserList=new ArrayList() //get 
itemsfor (item in Jenkins.instance.allItems) {  //find folders  if 
(item.class.canonicalName == "com.cloudbees.hudson.plugins.folder.Folder") 
{ folder = item.fullName URL = item.getAbsoluteUrl() //iterate 
over properties and find permissions item.properties.each { p ->
if(p.class.canonicalName == 
"com.cloudbees.hudson.plugins.folder.properties.AuthorizationMatrixProperty") 
{   //permissions found, get them   
Map> gp = p.getGrantedPermissions() 
  //interested only in admins of folder- permission to 
modify the given folder 
 gp.get(hudson.security.Permission.fromId("hudson.model.Item.Configure")).each{ 
   //getUserList User usr = 
User.getById(it,false) //println usr.fullNameif(usr != 
null && usr.fullName.contains("external")) {def usrMail = 
usr.getProperty(hudson.tasks.Mailer.UserProperty.class).getAddress();   
 adminUserList.add(it + ";" + usr.fullName +";" + usrMail)   } 
} } }}if(adminUserList.size() > 0) {   
adminUserList.each{user ->   println folder + ";" + URL + ";"+ user   }  }  
adminUserList=new ArrayList()   } *




Dne pondělí 17. září 2018 13:51:34 UTC+2 Pavel Novák napsal(a):
>
> Hi, 
> regarding https://issues.jenkins-ci.org/browse/JENKINS-53581  
> <https://issues.jenkins-ci.org/browse/JENKINS-53581>
>
> I would like to get permissions setup for the folders in the Jenkins by 
> *groovy 
> script *used in the jenkins script console 
>
> Environment:
> Jenkins ver. 2.121.2 
>  + Folders plugin 6.5.1 
>  + Matrix Authorization Strategy 2.3 
>
> Jenkins ver. 2.107.3 
>  + Folders plugin 6.4 
>  + Matrix Authorization Strategy 2.2
>
> I am using similar scripts for kind of reporting, e.g. number of folders, 
> folders with recent builds (in given period, etc.)
>
> I tried, with the clues over the internet, following 
>
> import com.cloudbees.hudson.plugins.folder.*import 
> groovyjarjarasm.asm.Itemimport jenkins.model.Jenkinsimport 
> hudson.security.*import hudson.model.*//AbstractProject proj = 
> Hudson.instance.getItem("YourJob")//AuthorizationMatrixProperty authProperty 
> = proj.getProperty(AuthorizationMatrixProperty.class)
>  def items=Jenkins.instance.getAllItems();//load all items in jenkins  
> items.each{
>   //get folders only  if(it instanceof Folder){
>   // println it //print for debug AbstractProject proj = 
> Hudson.instance.getItem(it.fullName)
>  AuthorizationMatrixProperty authProperty =  
> proj.getProperties(AuthorizationMatrixProperty.class)
>  }
>  }
>
>
> But that fails because casting error 
>
> org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
> object 'com.cloudbees.hudson.plugins.folder.Folder@4c019d3f[foldername]' with 
> class 'com.cloudbees.hudson.plugins.folder.Folder' to class 
> 'hudson.model.AbstractProject'
>
>
>
>
> In the link above I got an advise as to use abstract folder, etc. now I am in 
> the state I am getting error about getting property 
>
> groovy.lang.MissingMethodException: No signature of method: 
> com.cloudbees.hudson.plugins.folder.Folder.getProperties() is applicable for 
> argument types: (java.lang.Class) values: [class 
> hudson.security.AuthorizationMatrixProperty]
> Possible solutions: getProperties(), getProperties()
>
>
> Do you have any idea, how to obtain the permissions on the folder 
> - in fact, 1st level like "job root" should be enough, I dont need to go 
> deeper
> - in ideal case I would like to get all the granted permissions
> - at least, I need users, which are having any permissions on the folder 
> (Ex

Get folder's permission

2018-09-17 Thread Pavel Novák
Hi, 
regarding https://issues.jenkins-ci.org/browse/JENKINS-53581  


I would like to get permissions setup for the folders in the Jenkins by *groovy 
script *used in the jenkins script console 

Environment:
Jenkins ver. 2.121.2 
 + Folders plugin 6.5.1 
 + Matrix Authorization Strategy 2.3 

Jenkins ver. 2.107.3 
 + Folders plugin 6.4 
 + Matrix Authorization Strategy 2.2

I am using similar scripts for kind of reporting, e.g. number of folders, 
folders with recent builds (in given period, etc.)

I tried, with the clues over the internet, following 

import com.cloudbees.hudson.plugins.folder.*import 
groovyjarjarasm.asm.Itemimport jenkins.model.Jenkinsimport 
hudson.security.*import hudson.model.*//AbstractProject proj = 
Hudson.instance.getItem("YourJob")//AuthorizationMatrixProperty authProperty = 
proj.getProperty(AuthorizationMatrixProperty.class)
 def items=Jenkins.instance.getAllItems();//load all items in jenkins  
items.each{
  //get folders only  if(it instanceof Folder){
  // println it //print for debug AbstractProject proj = 
Hudson.instance.getItem(it.fullName)
 AuthorizationMatrixProperty authProperty =  
proj.getProperties(AuthorizationMatrixProperty.class)
 }
 }


But that fails because casting error 

org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast 
object 'com.cloudbees.hudson.plugins.folder.Folder@4c019d3f[foldername]' with 
class 'com.cloudbees.hudson.plugins.folder.Folder' to class 
'hudson.model.AbstractProject'




In the link above I got an advise as to use abstract folder, etc. now I am in 
the state I am getting error about getting property 

groovy.lang.MissingMethodException: No signature of method: 
com.cloudbees.hudson.plugins.folder.Folder.getProperties() is applicable for 
argument types: (java.lang.Class) values: [class 
hudson.security.AuthorizationMatrixProperty]
Possible solutions: getProperties(), getProperties()


Do you have any idea, how to obtain the permissions on the folder 
- in fact, 1st level like "job root" should be enough, I dont need to go deeper
- in ideal case I would like to get all the granted permissions
- at least, I need users, which are having any permissions on the folder (Excl. 
jenkins admins, ofc.)

note- I am jenkins admin, so I have the full permissions

Thanks in advance for any advise.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/05145b85-3688-4937-9fce-7f318f38e2c1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.