/// <summary> /// Enqueues a Job with parameters to be built. /// </summary> /// <param name="jobName">The name of the Job.</param> /// <param name="jobParameters">The collection of parameters for building the job.</param> /// <param name="token">An optional token for aborting the request.</param> /// <exception cref="JenkinsJobBuildException"></exception> public async Task<JenkinsBuildResult> BuildWithParametersAsync(string jobName, IDictionary<string, string> jobParameters, CancellationToken token = default(CancellationToken)) { try { var cmd = new JobBuildWithParametersCommand(context, jobName, jobParameters); await cmd.RunAsync(token); return cmd.Result; } catch (Exception error) { throw new JenkinsJobBuildException($"Failed to build Jenkins Job '{jobName}'!", error); } }
/// <summary> /// Enqueues a Job with parameters to be built. /// </summary> /// <param name="jobName">The name of the Job.</param> /// <param name="jobParameters">The collection of parameters for building the job.</param> /// <exception cref="JenkinsJobBuildException"></exception> public JenkinsBuildResult BuildWithParameters(string jobName, IDictionary<string, string> jobParameters) { try { var cmd = new JobBuildWithParametersCommand(context, jobName, jobParameters); cmd.Run(); return cmd.Result; } catch (Exception error) { throw new JenkinsJobBuildException($"Failed to build Jenkins Job '{jobName}'!", error); } }