public void SetUp() { _client = new TeamCityClient("londbcnab01"); _client.Connect("demo", "demo"); //_client = new TeamCityClient("teamcity.codebetter.com"); //_client.Connect("teamcitysharpuser", "qwerty"); }
private readonly ITeamCityClient _teamCityClient; // TODO IMM HI: abstract away? #endregion Fields #region Constructors public AgentService( IDeploymentPipeline deploymentPipeline, IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, ITeamCityClient teamCityClient, IDeploymentRequestRepository deploymentRequestRepository, IDiagnosticMessagesLogger diagnosticMessagesLogger, IProjectMetadataExplorer projectMetadataExplorer, IDirPathParamsResolver dirPathParamsResolver) { Guard.NotNull(deploymentPipeline, "deploymentPipeline"); Guard.NotNull(projectInfoRepository, "projectInfoRepository"); Guard.NotNull(environmentInfoRepository, "environmentInfoRepository"); Guard.NotNull(teamCityClient, "teamCityClient"); Guard.NotNull(deploymentRequestRepository, "deploymentRequestRepository"); Guard.NotNull(diagnosticMessagesLogger, "diagnosticMessagesLogger"); Guard.NotNull(dirPathParamsResolver, "dirPathParamsResolver"); _projectInfoRepository = projectInfoRepository; _environmentInfoRepository = environmentInfoRepository; _teamCityClient = teamCityClient; _deploymentPipeline = deploymentPipeline; _deploymentRequestRepository = deploymentRequestRepository; _diagnosticMessagesLogger = diagnosticMessagesLogger; _projectMetadataExplorer = projectMetadataExplorer; _dirPathParamsResolver = dirPathParamsResolver; }
public TeamCityArtifactsRepository(ITeamCityClient teamCityClient) { if (teamCityClient == null) { throw new ArgumentNullException("teamCityClient"); } _teamCityClient = teamCityClient; }
private readonly ITeamCityClient _teamCityClient; // TODO IMM HI: abstract away? #endregion Fields #region Constructors public AgentService(IDeploymentPipeline deploymentPipeline, IProjectInfoRepository projectInfoRepository, IEnvironmentInfoRepository environmentInfoRepository, ITeamCityClient teamCityClient, IDeploymentRequestRepository deploymentRequestRepository, IDiagnosticMessagesLogger diagnosticMessagesLogger) { if (deploymentPipeline == null) { throw new ArgumentNullException("deploymentPipeline"); } if (projectInfoRepository == null) { throw new ArgumentNullException("projectInfoRepository"); } if (environmentInfoRepository == null) { throw new ArgumentNullException("environmentInfoRepository"); } if (teamCityClient == null) { throw new ArgumentNullException("teamCityClient"); } if (deploymentRequestRepository == null) { throw new ArgumentNullException("deploymentRequestRepository"); } if (diagnosticMessagesLogger == null) { throw new ArgumentNullException("diagnosticMessagesLogger"); } _projectInfoRepository = projectInfoRepository; _environmentInfoRepository = environmentInfoRepository; _teamCityClient = teamCityClient; _deploymentPipeline = deploymentPipeline; _deploymentRequestRepository = deploymentRequestRepository; _diagnosticMessagesLogger = diagnosticMessagesLogger; }
public void SetUp() { _client = new TeamCityClient("localhost:81"); _client.Connect("admin", "qwerty"); }
public void SetUp() { _client = new TeamCityClient("teamcity.codebetter.com"); _client.Connect("guest", "qwerty", true); }
public void SetUp() { _client = new TeamCityClient("localhost:8111"); }
public void SetUp() { _client = new TeamCityClient("localhost:8111"); _client.Connect("teamcitysharpuser", "qwerty"); }
public void SetUp() { m_client = new TeamCityClient(m_server, m_useSsl); m_client.Connect(m_username, m_password); }
public PropagateVersionUseCase(ITeamCityClient client) { _client = client; }
public DataProvider(ITeamCityClient client, IWorker worker = null) { this.client = client; this.worker = worker ?? new Worker { IsAsync = true }; }
public DependencyChain(ITeamCityClient client, BuildConfig rootBuildConfig) { _client = client; _buildChainId = rootBuildConfig.Parameters[ParameterName.BuildConfigChainId].Value; InitGraph(rootBuildConfig); }
public override int Run(string[] args) { if (args.Length != 3 && args.Length != 4) { DisplayCommandUsage(); return(1); } IProjectInfoRepository projectInfoRepository = ObjectFactory.Instance.CreateProjectInfoRepository(); string projectName = args[0]; string projectConfigurationName = args[1]; string targetEnvironmentName = args[2]; bool isSimulation = (args.Length >= 4 ? string.Equals(args[3], "simulate", StringComparison.OrdinalIgnoreCase) : false); ProjectInfo projectInfo = projectInfoRepository.FindByName(projectName); if (projectInfo == null) { OutputWriter.WriteLine("Project named '{0}' doesn't exist.", projectName); return(1); } ITeamCityClient teamCityClient = ObjectFactory.Instance.CreateTeamCityClient(); Project project = teamCityClient.GetProjectByName(projectInfo.ArtifactsRepositoryName); ProjectDetails projectDetails = teamCityClient.GetProjectDetails(project); ProjectConfiguration projectConfiguration = projectDetails.ConfigurationsList .Configurations .SingleOrDefault(pc => pc.Name == projectConfigurationName); if (projectConfiguration == null) { OutputWriter.WriteLine( "Project configuration named '{0}' doesn't exist for project '{1}'.", projectConfigurationName, projectName); return(0); } ProjectConfigurationDetails projectConfigurationDetails = teamCityClient.GetProjectConfigurationDetails(projectConfiguration); ProjectConfigurationBuild projectConfigurationBuild = teamCityClient.GetProjectConfigurationBuilds(projectConfigurationDetails, 0, 1) .Builds .FirstOrDefault(); if (projectConfigurationBuild == null) { throw new InvalidOperationException( string.Format( "Project configuration '{0}' of project '{1}' doesn't have any builds yet.", projectConfigurationName, projectName)); } if (projectConfigurationBuild.Status != BuildStatus.Success) { throw new InvalidOperationException( string.Format( "Couldn't deploy latest build of project configuration '{0}' of project '{1}' because it was not successfull.", projectConfigurationName, projectName)); } string projectConfigurationBuildId = projectConfigurationBuild.Id; try { DeploymentTask deploymentTask = projectInfo.CreateDeploymentTask(ObjectFactory.Instance); Guid deploymentId = Guid.NewGuid(); var deploymentInfo = new DeploymentInfo( deploymentId, isSimulation, projectName, projectConfigurationName, projectConfigurationBuildId, targetEnvironmentName, projectInfo.CreateEmptyInputParams()); IDeploymentPipeline deploymentPipeline = ObjectFactory.Instance.CreateDeploymentPipeline(); deploymentPipeline.DiagnosticMessagePosted += (eventSender, tmpArgs) => LogMessage(tmpArgs.Message, tmpArgs.MessageType); var deploymentContext = new DeploymentContext(RequesterIdentity); deploymentPipeline.StartDeployment(deploymentInfo, deploymentTask, deploymentContext, false); return(0); } catch (Exception exc) { LogMessage("Error: " + exc, DiagnosticMessageType.Error); return(1); } }
public void SetUp() { _client = new TeamCityClient("teamcity.codebetter.com"); _client.Connect("teamcitysharpuser", "qwerty"); }
public BuildConfigurationDataService(ITeamCityClient teamCityClient, IBuildConfigurationMapper buildConfigurationMapper) { _teamCityClient = teamCityClient ?? throw new ArgumentNullException(nameof(teamCityClient)); _buildConfigurationMapper = buildConfigurationMapper ?? throw new ArgumentNullException(nameof(buildConfigurationMapper)); }