I am building a Jenkins job via the REST API and need to pass a huge JSON payload to the build - above 2MB
Currently, with less than 2MB JSON payload and using Multi-line input Parameters, I can successfully pass the JSON to the job.
My current usage looks like this
curl -sg -X POST "http://[xxxx:xxxx:xx:xxxx::a]:9090/job/Planner/buildWithParameters" --user admin:xxxxxxcbd73258xxxxxxxxxxx --data INPUT_LINE=$MY_JSON -H 'Accept: application/json'
But anything above 2MB, I get the following error
"error=7, Argument list too long
at java.base"
which corresponds to getconf ARG_MAX -> 2,097,152 on my machine
I am currently looking for a workaround. it seems the ENV variables have a max value which Jenkins is using as build parameters
The solutions given here seems to be also using BuildParameters which wil end up as ENV variables, hence not suitable for setting huge payloads What is the format of the JSON for a Jenkins REST buildWithParameters to override the default parameters values