[JIRA] (JENKINS-38658) File parameters are ignored

2 views
Skip to first unread message

victor@hallberg.cc (JIRA)

unread,
Oct 3, 2016, 6:59:01 AM10/3/16
to jenkinsc...@googlegroups.com
Victor Hallberg created an issue
 
Jenkins / Bug JENKINS-38658
File parameters are ignored
Issue Type: Bug Bug
Assignee: Unassigned
Components: build-token-root-plugin
Created: 2016/Oct/03 10:58 AM
Environment: Jenkins ver. 1.625.3
build-token-root v1.4
Priority: Minor Minor
Reporter: Victor Hallberg

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!

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

victor@hallberg.cc (JIRA)

unread,
Oct 3, 2016, 7:07:06 AM10/3/16
to jenkinsc...@googlegroups.com
Victor Hallberg commented on Bug JENKINS-38658
 
Re: File parameters are ignored

It looks like /buildWithParameters doesn't support files:

I haven't looked at the plugin source code, but this might be solved by simply allowing parameters to be passed to /buildByToken/build, enabling the following:

curl -X POST "http://.../buildByToken/build?job=job&token=token" \
-F file0=@/dist.json \
-F json='{"parameter": [{"name": "dist", "file": "file0"}]}' \
-F delay=0sec
java.lang.Exception: Use /buildByToken/buildWithParameters for this job since it takes parameters

victor@hallberg.cc (JIRA)

unread,
Oct 3, 2016, 7:08:01 AM10/3/16
to jenkinsc...@googlegroups.com
Victor Hallberg edited a comment on Bug JENKINS-38658
It looks like /buildWithParameters doesn't support files:
I haven't looked at the plugin source code, but this might be solved by simply allowing parameters to be passed to /buildByToken/build, enabling the following:
{quote}curl -X POST "http://.../buildByToken/build?job=job&token=token" \

  -F file0=@/dist.json \
  -F json='\{"parameter": \[\{"name": "dist", "file": "file0"\}\]\}' \
  -F delay=0sec
java.lang.Exception: Use /buildByToken/buildWithParameters for this job since it takes parameters {quote}

pieter@pietervogelaar.nl (JIRA)

unread,
May 17, 2019, 11:02:02 AM5/17/19
to jenkinsc...@googlegroups.com

The build root token plugin is great. But it's really unfortunate that is doesn't support file parameters.

This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages