[JIRA] (JENKINS-31201) Job DSL support for ScriptApproval (was: Groovy postbuild ignores RUN_SCRIPTS permission)

2017-01-27 Thread nels4...@me.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeffrey Nelson commented on  JENKINS-31201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Job DSL support for ScriptApproval (was: Groovy postbuild ignores RUN_SCRIPTS permission)   
 

  
 
 
 
 

 
 Figured out a workaround. 1. Write a scriptler script that approves pending scripts with a given identifier (we used something simple like '// SCRIPTLER AUTO APPROVE'). Thanks to Sam Gleske for pointing me to the code to approve a script. – Select 'Permission' option (Allow execution by user with RunScripts permission) – Select 'Restriction' option (Script is always executed on Master) – Script parameter: "approvalPrefix" – Script: 

 
import jenkins.model.Jenkins

def scriptApproval = Jenkins.instance.getExtensionList('org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval')[0]
def hashesToApprove = scriptApproval.pendingScripts.findAll{ it.script.startsWith(approvalPrefix) }.collect{ it.getHash() }
hashesToApprove.each { 
  scriptApproval.approveScript(it)
} 

 2. use the configure UI to add another step to your DSL seed job to run this scriptler script created in step 1 3. add '// SCRIPTLER AUTO APPROVE' at the top of any groovy script you want approved If your DSL seed job is itself configured by DSL, complete steps 4-5 4. look at the config.xml generated by manually adding this step to your DSL seed job. You need to grab the value in the 'builderId' field 5. add the additional step to your DSL seed job to run this scriptler script created above in step 1. – dsl for adding the step:  

 
  def approvePrefixParam = {
name 'approvalPrefix'
value '// SCRIPTLER AUTO APPROVE'
  }
  
  configure { project ->
project / builders << 'org.jenkinsci.plugins.scriptler.builder.ScriptlerBuilder' {
  builderId()
  scriptId('approveGroovyScripts.groovy')
  propagateParams(false)
  parameters {
'org.jenkinsci.plugins.scriptler.config.Parameter' approvePrefixParam
  }
}
  } 

  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 

[JIRA] (JENKINS-31201) Job DSL support for ScriptApproval (was: Groovy postbuild ignores RUN_SCRIPTS permission)

2017-01-26 Thread nels4...@me.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeffrey Nelson commented on  JENKINS-31201  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Job DSL support for ScriptApproval (was: Groovy postbuild ignores RUN_SCRIPTS permission)   
 

  
 
 
 
 

 
 Any ideas when a solution for this issue could be worked on?  My project is now building many pipelines where the starting job uses the Active Choices Param plugin with complex groovy scripts. Without some solution to this problem, we are stuck manually approving all (60+) scripts that are all near identical.  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] (JENKINS-36456) Active Choices Reactive Parameter can't access Mask Passwords (Global name/password pairs)

2017-01-12 Thread nels4...@me.com (JIRA)
Title: Message Title


 
 
 
 

 
 
 

 
   
 Jeffrey Nelson commented on  JENKINS-36456  
 

  
 
 
 
 

 
 
  
 
 
 
 

 
  Re: Active Choices Reactive Parameter can't access Mask Passwords (Global name/password pairs)   
 

  
 
 
 
 

 
 Thanks Bruno - this also really helped me out!  
 

  
 
 
 
 

 
 
 

 
 
 Add Comment  
 

  
 

  
 
 
 
  
 

  
 
 
 
 

 
 This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)  
 
 

 
   
 

  
 

  
 

   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [mask-passwords-plugin] (JENKINS-34264) Mask Passwords does not enable variables in workflow/pipeline

2016-05-02 Thread nels4...@me.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Jeffrey Nelson edited a comment on  JENKINS-34264 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: Mask Passwords does not enable variables in workflow/pipeline  
 
 
 
 
 
 
 
 
 
 Furthermore, in freestyle jobs, the mask passwords plugin also enables global passwords for use. This is the main feature that I see is missing in the workflow/pipeline support.!maskPasswordsFreestyle.png|thumbnail! The 'withCredentials' support helps a little, but how do I access global passwords in a pipeline/workflow job? 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [mask-passwords-plugin] (JENKINS-34264) Mask Passwords does not enable variables in workflow/pipeline

2016-05-02 Thread nels4...@me.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Jeffrey Nelson updated an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-34264 
 
 
 
  Mask Passwords does not enable variables in workflow/pipeline  
 
 
 
 
 
 
 
 
 
 
Furthermore, in freestyle jobs, the mask passwords plugin also enables global passwords for use. This is the main feature that I see is missing in the workflow/pipeline support. 
 
 
 
 
 
 
 
 
 
 

Change By:
 
 Jeffrey Nelson 
 
 
 

Attachment:
 
 maskPasswordsFreestyle.png 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [mask-passwords-plugin] (JENKINS-34264) Mask Passwords does not enable variables in workflow/pipeline

2016-04-14 Thread nels4...@me.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Jeffrey Nelson created an issue 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 Jenkins /  JENKINS-34264 
 
 
 
  Mask Passwords does not enable variables in workflow/pipeline  
 
 
 
 
 
 
 
 
 

Issue Type:
 
  Bug 
 
 
 

Assignee:
 
 Oleg Nenashev 
 
 
 

Components:
 

 mask-passwords-plugin, workflow-plugin 
 
 
 

Created:
 

 2016/Apr/14 10:13 PM 
 
 
 

Priority:
 
  Critical 
 
 
 

Reporter:
 
 Jeffrey Nelson 
 
 
 
 
 
 
 
 
 
 
The mask-passwords-plugin does not enable global or even locally defined variables within the block when used in a pipeline/workflow job. I have configured a global password variable "MARATHON_PASSWORD". You'll see that I've tried referencing variables in two ways (echo and sh) 
Example job config: 

 
node {
stage 'Test Mask Passwords in Pipeline'

wrap([$class: 'MaskPasswordsBuildWrapper', varPasswordPairs: [[password: 'thePassword', var: 'MY_PASSWORD']]]) {
echo "retrive MY_PASSWORD by var = ${env.MY_PASSWORD}"
sh 'echo retrieve MY_PASSWORD by var = $MY_PASSWORD'
echo "retrieve MARATHON_PASSWORD by var = ${env.MARATHON_PASSWORD}"
sh 'echo retrieve MARATHON_PASSWORD by var = $MARATHON_PASSWORD'

echo "masking MY_PASSWORD value works = thePassword"
sh 'echo masking MY_PASSWORD value works = thePassword'
}
} 

 
Output from running job: 

 
[Pipeline] Allocate node : Start
Running 

[JIRA] [workflow-plugin] (JENKINS-27392) API to decorate console output

2016-04-14 Thread nels4...@me.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Jeffrey Nelson edited a comment on  JENKINS-27392 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: API to decorate console output  
 
 
 
 
 
 
 
 
 
 I am trying to use this wrapper with the cloudbees workflow/pipeline plugin. Refer to the following code snippet: {code}node {stage 'Test It'wrap([$class: 'MaskPasswordsBuildWrapper']) {sh '''if [ "$MARATHON_PASSWORD" -eq "theMarathonPassword" ]; then  echo it works!   fi'''}}{code}I have a global password setup named :  MARATHON_PASSWORD  with value: theMarathonPassword . However, running this pipeline job results in output:{code}Entering stage Test ItProceeding[Pipeline] stage (Test It)[Pipeline] General Build Wrapper : Start[Pipeline] wrap {[Pipeline] sh[AAA-TestPipeline] Running shell script+ '[' '' -eq  ']'/apps/jenkins/slave1/workspace/CWL/AAA-TestPipeline/.jenkins-4173bdf1/script.sh: line 2: [: : integer _expression_ expected[Pipeline] } //wrap[Pipeline] General Build Wrapper : End[Pipeline] } //node[Pipeline] Allocate node : End[Pipeline] End of PipelineFinished: SUCCESS{code}In other words, the masking part is working, but accessing the global passwords is not. Am I missing something, or is this a bug? 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [workflow-plugin] (JENKINS-27392) API to decorate console output

2016-04-14 Thread nels4...@me.com (JIRA)
Title: Message Title
 
 
 
 
 
 
 
 
 
 
  
 
 Jeffrey Nelson commented on  JENKINS-27392 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
  Re: API to decorate console output  
 
 
 
 
 
 
 
 
 
 
I am trying to use this wrapper with the cloudbees workflow/pipeline plugin. Refer to the following code snippet:  

 
node {
stage 'Test It'

wrap([$class: 'MaskPasswordsBuildWrapper']) {
sh '''if [ "$MARATHON_PASSWORD" -eq "theMarathonPassword" ]; then
  echo it works!
   fi'''
}
} 

 
I have a global password setup named MARATHON_PASSWORD. However, running this pipeline job results in output: 

 
Entering stage Test It
Proceeding
[Pipeline] stage (Test It)
[Pipeline] General Build Wrapper : Start
[Pipeline] wrap {
[Pipeline] sh
[AAA-TestPipeline] Running shell script
+ '[' '' -eq  ']'
/apps/jenkins/slave1/workspace/CWL/AAA-TestPipeline/.jenkins-4173bdf1/script.sh: line 2: [: : integer _expression_ expected
[Pipeline] } //wrap
[Pipeline] General Build Wrapper : End
[Pipeline] } //node
[Pipeline] Allocate node : End
[Pipeline] End of Pipeline
Finished: SUCCESS 

 
In other words, the masking part is working, but accessing the global passwords is not. Am I missing something, or is this a bug? 
 
 
 
 
 
 
 
 
 
 
 
 

 
 Add Comment 
 
 
 
 
 
 
 
 
 
 

 
 
 
 
 
 
 
 
 
 

 This message was sent by Atlassian JIRA (v6.4.2#64017-sha1:e244265) 
 
 
 
 
  
 
 
 
 
 
 
 
 
   





-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.