Jenkins pipeline with permissions inside and poll SCM scedule - how to?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Jenkins pipeline with permissions inside and poll SCM scedule - how to?

seva.post.64
After a googling and trying to use internal snippet generator for pipeline script-configuration in Jenkins 2.7.4 I'm failed to obtain the code.

Instead of auth matrix with permissions declaratiuon and SCM poll scedule it produces useless:
properties([<object of type hudson.security.AuthorizationMatrixProperty>, pipelineTriggers([<object of type hudson.triggers.SCMTrigger>])])


How should the code for auth matrix and SCM polling schedule looks like?


Valid syntax is ( not SCMPoll method from documentation), but what the second arg should I provide?
    triggers {
       scm
(['* * * * *'])

   
}

Also I tried to use triggers and scm('* * * * *') or/and SCMPoll too, but the documentation is speaking about an unexistent things for 2.7.4 (described SCMPoll is not implemnted and is not recognized by Jenkins, occasionally I found supported scm method in error messages, but it should have second argument, not documented at all everywhere) - where actual documentation can be found!!!???


Here is my Jenkins file:

pipeline {
    parameters {
        booleanParam(defaultValue: false, description: 'Be verbose with output.', name: 'is_verbose')
    }

    options {
        disableConcurrentBuilds()
    }

   triggers {
       scm(['* * * * *'])
   }

    stages {
        stage('Preparation') {
            steps {
                deleteDir()
                dir ('conf') {
                    git url:        'git@gitrepo:conf/prj',
                    branch:         '1.0.0',
                    credentialsId:  'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
                    poll: false;
                }
                dir ('obj') {
                    git url:        'git@gitrepo:obj/prj',
                    branch:         '1.0.0',
                    credentialsId:  'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
                    poll: true;
                }
            }
        }
        stage('Build') {
            steps {
                echo "BUILD START"
            }
        }
    }
}





P.S. It seems to be a bug. Internal methods to be called by the generator are producing object's singnature instead of valuable expected string.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/d7131762-0943-40aa-9282-04d2dc845b23%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Jenkins pipeline with permissions inside and poll SCM scedule - how to?

Daniel Beck

> On 12. Nov 2017, at 11:59, [hidden email] wrote:
>
> Jenkins 2.7.4

This release is long obsolete. Does the same issue occur on 2.73.x or newer?

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/89242356-489C-461C-ABCC-727A9E214DA7%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.