Example #1
0
 /// <summary>
 /// Gets the console output from a Jenkins Job Build.
 /// </summary>
 /// <param name="jobName">The name of the Job.</param>
 /// <param name="buildNumber">The number of the build.</param>
 /// <param name="start">The character position to begin reading from.</param>
 /// <exception cref="JenkinsNetException"></exception>
 public JenkinsProgressiveHtmlResponse GetProgressiveHtml(string jobName, string buildNumber, int start)
 {
     try {
         var cmd = new BuildProgressiveHtmlCommand(context, jobName, buildNumber, start);
         cmd.Run();
         return(cmd.Result);
     }
     catch (Exception error) {
         throw new JenkinsNetException($"Failed to retrieve progressive HTML from build #{buildNumber} of Jenkins Job '{jobName}'!", error);
     }
 }
Example #2
0
        /// <summary>
        /// Gets the console output from a Jenkins Job Build asynchronously.
        /// </summary>
        /// <param name="jobName">The name of the Job.</param>
        /// <param name="buildNumber">The number of the build.</param>
        /// <param name="start">The character position to begin reading from.</param>
        /// <param name="token">An optional token for aborting the request.</param>
        /// <exception cref="JenkinsNetException"></exception>
        public async Task <JenkinsProgressiveHtmlResponse> GetProgressiveHtmlAsync(string jobName, string buildNumber, int start, CancellationToken token = default(CancellationToken))
        {
            try {
                var cmd = new BuildProgressiveHtmlCommand(context, jobName, buildNumber, start);
                await cmd.RunAsync(token);

                return(cmd.Result);
            }
            catch (Exception error) {
                throw new JenkinsNetException($"Failed to retrieve progressive HTML from build #{buildNumber} of Jenkins Job '{jobName}'!", error);
            }
        }