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

39 views
Skip to first unread message

seva.p...@gmail.com

unread,
Nov 12, 2017, 6:28:41 AM11/12/17
to Jenkins Users
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.

Daniel Beck

unread,
Nov 12, 2017, 9:03:12 AM11/12/17
to jenkins...@googlegroups.com

> On 12. Nov 2017, at 11:59, seva.p...@gmail.com wrote:
>
> Jenkins 2.7.4

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

Reply all
Reply to author
Forward
0 new messages