Re: Views on Folders

2021-06-21 Thread James Nord
I fixed this recently, what version of Jenkins are you using ?

https://github.com/jenkinsci/jenkins/pull/5377   jenkins-2.288
 and higher

/James

On Thu, 17 Jun 2021 at 16:43, Anderson Cruz <
anderson.siqueira.c...@gmail.com> wrote:

> Hello,
>
> I have a Jenkins running properly with security roles for Teams in
> Folders. Teams are able to control everything inside their own folder and
> works fine.
>
> My problem starts with View plugin because it generates a View on Root of
> Jenkins and permissions could not be applied to it. breaking my Team model
> permissions.
>
> Is there a way to create Views inside folders only? use another plugin
> that allows me to do it or show jobs in a good way for wall display ?
>
> Thanks
> Anderson Cruz
>
> --
> 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/CAAJ3s8uoqJB-1tTack9AQVrcGRvPOLq4Yhyu2eLNv%3DTZAZqV7Q%40mail.gmail.com
> 
> .
>

-- 
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/CAPzq3pdymyVw64zxnuEGAH-WC9jQTbrvxP_59Ftf4CetGwXJoA%40mail.gmail.com.


Is it possible to update a variable in a dynamically created stage?

2021-06-21 Thread 'Eric Boehm' via Jenkins Users
I am having a problem updating a variable based on the result of a shell
script when I create stages dynamically. I think that this is because the
dynamically created stage is a closure and its view of the variable is as
of the time of the closure.

Is there a way to solve this problem?

Here's the sample Jenkinsfile if the stages are run sequentially and not
created dynamically.
It behaves as expected.

node {
label 'master'
def needsBuild = []
myexit = 0
myscript = """
echo "Desired exit $myexit"
exit $myexit
"""
stage("Status $myexit") {
status = sh script: myscript, returnStatus: true
if (status) {
echo "Changes needed"
needsBuild.add(myexit)
}
}
myexit = 1
myscript = """
echo "Desired exit $myexit"
exit $myexit
"""
stage("Status $myexit") {
status = sh script: myscript, returnStatus: true
if (status) {
echo "Changes needed"
needsBuild.add(myexit)
}
}
}

This Jenkinsfile has a traceback when it tries 'needsBuild.add(myexit)

  def createStage(mystatus) {
def myexit = mystatus
def myscript = """
echo "Desired exit $myexit"
exit $myexit
"""
return {
stage("job $myexit") {
status = sh script: myscript, returnStatus: true
if (status) {
echo "Changes needed"
needsBuild.add(myexit)
}
}
}
}
node {
label 'master'
def needsBuild = []
def stages = [:]
for (index in [0, 1]) {
stages["Exit value $index"] = createStage(index)
}
parallel stages
}


Here's the traceback:


+ exit 1[Pipeline] echo
Changes
needed[Pipeline] }[Pipeline] // stage[Pipeline] }[Pipeline] //
node[Pipeline] End of Pipelinegroovy.lang.MissingPropertyException: No
such property: needsBuild for class: groovy.lang.Binding
at groovy.lang.Binding.getVariable(Binding.java:63)
at 
org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onGetProperty(SandboxInterceptor.java:271)


Any suggestions or guidance on what I am missing would be appreciated.

--
Eric Boehm

-- 
This electronic communication and the information and any files transmitted 
with it, or attached to it, are confidential and are intended solely for 
the use of the individual or entity to whom it is addressed and may contain 
information that is confidential, legally privileged, protected by privacy 
laws, or otherwise restricted from disclosure to anyone else. If you are 
not the intended recipient or the person responsible for delivering the 
e-mail to the intended recipient, you are hereby notified that any use, 
copying, distributing, dissemination, forwarding, printing, or copying of 
this e-mail is strictly prohibited. If you received this e-mail in error, 
please return the e-mail to the sender, delete it from your computer, and 
destroy any printed copy of 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/CACL45fj-JkhhiU87WEhHnaEgcBm2Ca0%3Dn4uq8JrGhA5PnKe-Yg%40mail.gmail.com.


smime.p7s
Description: S/MIME Cryptographic Signature