Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jenkins: job.build: trigger job with upload parameter #92

Open
emulexoar opened this issue Mar 26, 2020 · 0 comments
Open

jenkins: job.build: trigger job with upload parameter #92

emulexoar opened this issue Mar 26, 2020 · 0 comments

Comments

@emulexoar
Copy link

emulexoar commented Mar 26, 2020

Hi;

I was trying to trigger a jenkins job with an upload file parameter. using the jenkins.job.build below. I was able to trigger the job but the file is not being upload. please advise what I have done wrong thanks.

const jenkins = require('jenkins')({ baseUrl: 'http://usertoken:token@localhost:8080', crumbIssuer: true, formData: require('form-data') });

jenkins.job.build({ name: 'MyJenkinsJobName', parameters: { "name": 'MyJenkinsJobName', "file": fs.createReadStream('demo2.txt') }}, function (err, formData) {
console.log("called inside build")
if (err) throw err;

@emulexoar emulexoar changed the title jenkins: job.build: formData must be defined when client initalized to use file upload jenkins: job.build: trigger job with upload parameter Mar 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant