Pipeline Poll SCM triggering build without previous parameters

7 views
Skip to first unread message

Surya Prasad

unread,
Aug 16, 2018, 12:00:32 AM8/16/18
to Jenkins Users
parameters {
        string(name: 'stageName')
        string(name: 'functionName')
        string(defaultValue: 'sonarqube', name: 'toolName')
        string(name: 'gitCredentialsId')
        string(name: 'gitUrl')
        string(name: 'awsCredentialsId')
        string(defaultValue: 'us-west-2', name: 'awsRegion')
        string(defaultValue: 's3event.sh', name: 's3ShellScript')
        string(defaultValue: 'serverless-nodejs', name: 'nodejsInstallation')
        choice(name: 'Invoke_Parameters', choices:"Yes\nNo", description: "Do you whish to do a dry run to grab parameters?" )
        choice(name: 'SonarQube_Scanning', choices:"Yes\nNo")
    }
    triggers {
        pollSCM('*/2 * * * *')
    }

Parameters and triggers section of the pipeline

The pipeline goes through the stages fine when manually started by giving the parameters. But, on an SCM change, the build is triggered with null values except the parameters with defaultValues.
I assumed that a new build triggered by an SCM change would use the last known good parameters to build. 

Any help will be appreciated.

Thank you.
Reply all
Reply to author
Forward
0 new messages