| I'm trying to trigger a job configured to accept a file parameter named dist. Triggering this job works fine from the Jenkins web UI and curl (if I provide user:token credentials). POSTing to /buildByToken/buildWithParameters?token=... with the same form data triggers a build, but no matter what I try the file isn't passed on to the job. Works:
curl -X POST "https://.../job/.../build?token=..." \ --user user:api-token \ -F file0=@$(shell pwd)/dist.json \ -F json='{"parameter": [{"name": "dist", "file": "file0"}]}'
Doesn't work:
curl -X POST "https://.../buildByToken/buildWithParameters?job=job&token=..." \ -F file0=@$(shell pwd)/dist.json \ -F json='{"parameter": [{"name": "dist", "file": "file0"}]}'
The issue might be related to the fact that Jenkins seemed to ignore the file when I POSTed to /buildWithParameters, it only worked when posting to /build. Thanks in advance! |