예제 #1
0
        public JenkinsArtifactImporter(IJenkinsConnectionInfo connectionInfo, ILogSink logger, IOperationExecutionContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            var shim = new BuildMasterContextShim(context);

            if (shim.ApplicationId == null)
            {
                throw new InvalidOperationException("context requires a valid application ID");
            }

            this.ConnectionInfo = connectionInfo ?? throw new ArgumentNullException(nameof(connectionInfo));
            this.Logger         = logger ?? throw new ArgumentNullException(nameof(logger));
            this.Context        = shim;
        }
예제 #2
0
        public JenkinsArtifactImporter(IJenkinsConnectionInfo connectionInfo, ILogger logger, IGenericBuildMasterContext context)
        {
            if (connectionInfo == null)
            {
                throw new ArgumentNullException(nameof(connectionInfo));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            if (context.ApplicationId == null)
            {
                throw new InvalidOperationException("context requires a valid application ID");
            }

            this.ConnectionInfo = connectionInfo;
            this.Logger         = logger;
            this.Context        = context;
        }
예제 #3
0
 public static string GetApiUrl(this IJenkinsConnectionInfo connectionInfo) => GetApiUrl(connectionInfo.ServerUrl);
예제 #4
0
 public JenkinsClient(IJenkinsConnectionInfo config, ILogSink logger = null)
 {
     this.config = config;
     this.logger = logger;
 }
예제 #5
0
 public static string GetApiUrl(this IJenkinsConnectionInfo connectionInfo)
 {
     return(connectionInfo.ServerUrl?.TrimEnd('/') ?? "");
 }