Ejemplo n.º 1
0
 /// <summary>
 /// Gets the progressive text 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 JenkinsProgressiveTextResponse GetProgressiveText(string jobName, string buildNumber, int start)
 {
     try {
         var cmd = new BuildProgressiveTextCommand(context, jobName, buildNumber, start);
         cmd.Run();
         return(cmd.Result);
     }
     catch (Exception error) {
         throw new JenkinsNetException($"Failed to retrieve progressive text from build #{buildNumber} of Jenkins Job '{jobName}'!", error);
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the progressive text 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 <JenkinsProgressiveTextResponse> GetProgressiveTextAsync(string jobName, string buildNumber, int start, CancellationToken token = default(CancellationToken))
        {
            try {
                var cmd = new BuildProgressiveTextCommand(context, jobName, buildNumber, start);
                await cmd.RunAsync(token);

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