public void it_modify_artifact_dependencies()
        {
            const string depend            = "TeamcityDashboardScenario_Test_TestWithCheckout";
            const string newDepend         = "TeamcityDashboardScenario_Test_TestWithCheckoutWithDependencies";
            var          buildLocatorFinal = new BuildTypeLocator();

            try
            {
                var buildConfig = m_client.BuildConfigs.CreateConfigurationByProjectId(m_goodProjectId, "testNewConfig");
                buildLocatorFinal = BuildTypeLocator.WithId(buildConfig.Id);
                var artifactDependencies = new ArtifactDependencies
                {
                    ArtifactDependency = new List <ArtifactDependency>
                    {
                        new ArtifactDependency
                        {
                            Id              = "TTTT_100",
                            Type            = "artifact_dependency",
                            SourceBuildType = new BuildConfig {
                                Id = depend
                            },
                            Properties = new Properties
                            {
                                Property = new List <Property>
                                {
                                    new Property {
                                        Name = "cleanDestinationDirectory", Value = "false"
                                    },
                                    new Property {
                                        Name = "pathRules", Value = "step1.txt"
                                    },
                                    new Property {
                                        Name = "revisionName", Value = "lastSuccessful"
                                    },
                                    new Property {
                                        Name = "revisionValue", Value = "latest.lastSuccessful"
                                    }
                                }
                            }
                        }
                    }
                };

                m_client.BuildConfigs.SetArtifactDependency(buildLocatorFinal, artifactDependencies.ArtifactDependency[0]);

                m_client.BuildConfigs.ModifArtifactDependencies(buildConfig.Id, depend, newDepend);
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
            finally
            {
                //Cleanup
                m_client.BuildConfigs.DeleteConfiguration(buildLocatorFinal);
            }
        }
Esempio n. 2
0
        //TODO: features
        //TODO: agent-requirements
        //TODO: builds


        public bool HasFixedArtifactDependency()
        {
            if (ArtifactDependencies != null)
            {
                return
                    (ArtifactDependencies.Any(
                         ad => ad.Properties.Property.Any(p => p.Name == "revisionName" && p.Value == "buildNumber")));
            }
            return(false);
        }