json - Jenkins job adding new line only when run via jenkins pipeline not stand alone -


i have jenkins pipeline builds job uses powershell make json based requests. when run job through pipeline script adds various line breaks throughout json. when run job hitting 'rebuild' script runs without issue.

output of request via jenkins pipeline:

invoke-restmethod -uri http://api.newrelic.com/v2/applications/17303495/deployments.json -method 'post' -headers system.collections.hashtable -contenttype 'application/json' -body {     "deployment": {         "revision": "deployment of e0ca4b7 ",         "changelog": "see release email notes",         "description": "beginning deployment of e0ca4b7 ",         "user": "pcort"     } } 

output of request via 'rebuild' or manual:

invoke-restmethod -uri http://api.newrelic.com/v2/applications/17303495/deployments.json -method 'post' -headers system.collections.hashtable -contenttype 'application/json' -body {     "deployment": {         "revision": "deployment of e0ca4b7",         "changelog": "see release email notes",         "description": "beginning deployment of e0ca4b7",         "user": "pcort"     } } 

help! weird , breaks code :) ideas great!

jenkins running ver. 2.46.2 , plugins date.

the issue getting build label. i'm not entirely sure how works, maybe more knowledge can inform me, getting short git commit git rev-parse --short head leaving space or new line character @ end of variable (i returning via powershell). adding .trim() cleared up.


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -