+ Start a Discussion
Adelchi PelizzoAdelchi Pelizzo 

sfdx force:create:org output null

No output returned after scratch org has been created using Jenkinsfile:
 
stage('Create Scratch Org') {
            rmsg = bat returnStdout: true, script: "${toolbelt} sfdx force:org:create --definitionfile config/project-scratch-def.json --json --setdefaultusername"
           // rmsg is: null
            println("Returned>>" + printf(rmsg))
           // log : Returned >> null
            printf rmsg
            def jsonSlurper = new JsonSlurperClassic()
            def robj = jsonSlurper.parseText(rmsg)
            if (robj.status != "ok") { error 'org creation failed: ' + robj.message }
            SFDC_USERNAME=robj.result.username
            robj = null

        }

The scratch org is created ok.

Thank you for any comment.
Adelchi
Adelchi PelizzoAdelchi Pelizzo
I actually get the message output in the shell 
C:\Users\Adelchi\.jenkins\workspace\testPipeDx>sfdx force:org:create --definitionfile config/project-scratch-def.json --json --setdefaultusername
{"status":0,"result":{"orgId":"00D0E0000001VzGUAU","username":"test-if0nitjgobdn@example.com"}}
Oct 25, 2018 4:17:06 PM org.jenkinsci.plugins.workflow.job.WorkflowRun finish

... but I need it during the jenkins process to retrieve username.