I want to queue a build via the NodeJS VSTS API (azure-devops-node-api)
So i use the getDefinition to get my build definition, then queueBuild with the returned result:
connection.getBuildApi().then((vstsBuild) => {
vstsBuild.getDefinition(buildPublishToNexus, project).then((buildDefinition) => {
vstsBuild.queueBuild(buildDefinition, project).then((defs) => {
console.info('build', defs);
}).catch(err => console.error('catch 1', err));
}).catch(err => console.error('catch 2', err));
});
I get my build with all its reference but it keeps telling my this error:
{ '$id': '1',
innerException: null,
message: 'Value cannot be null.\r\nParameter name: build.Definition',
typeName: 'System.ArgumentNullException, mscorlib',
typeKey: 'ArgumentNullException',
errorCode: 0,
eventId: 0 } }
Does someone have any information on how to get the build.Definition? The documentation is really poor.