Beispiel #1
0
 /// <summary>
 /// Folds travis log output.
 /// </summary>
 /// <param name="travisCIProvider">The Travis CI provider.</param>
 /// <param name="name">The name.</param>
 /// <returns>An <see cref="IDisposable"/>.</returns>
 public static IDisposable Fold(this ITravisCIProvider travisCIProvider, string name)
 {
     if (travisCIProvider == null)
     {
         throw new ArgumentNullException("travisCIProvider");
     }
     travisCIProvider.WriteStartFold(name);
     return(new TravisCIActionDisposable(travisCIProvider, tci => tci.WriteEndFold(name)));
 }
Beispiel #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildSystem" /> class.
        /// </summary>
        /// <param name="appVeyorProvider">The AppVeyor Provider.</param>
        /// <param name="teamCityProvider">The TeamCity Provider.</param>
        /// <param name="myGetProvider">The MyGet Provider.</param>
        /// <param name="bambooProvider">The Bamboo Provider.</param>
        /// <param name="continuaCIProvider">The Continua CI Provider.</param>
        /// <param name="jenkinsProvider">The Jenkins Provider.</param>
        /// <param name="bitriseProvider">The Bitrise Provider.</param>
        /// <param name="travisCIProvider">The Travis CI provider.</param>
        /// <param name="bitbucketPipelinesProvider">The Bitbucket Pipelines provider.</param>
        public BuildSystem(IAppVeyorProvider appVeyorProvider, ITeamCityProvider teamCityProvider, IMyGetProvider myGetProvider, IBambooProvider bambooProvider, IContinuaCIProvider continuaCIProvider, IJenkinsProvider jenkinsProvider, IBitriseProvider bitriseProvider, ITravisCIProvider travisCIProvider, IBitbucketPipelinesProvider bitbucketPipelinesProvider)
        {
            if (appVeyorProvider == null)
            {
                throw new ArgumentNullException("appVeyorProvider");
            }
            if (teamCityProvider == null)
            {
                throw new ArgumentNullException("teamCityProvider");
            }
            if (myGetProvider == null)
            {
                throw new ArgumentNullException("myGetProvider");
            }
            if (bambooProvider == null)
            {
                throw new ArgumentNullException("bambooProvider");
            }
            if (continuaCIProvider == null)
            {
                throw new ArgumentNullException("continuaCIProvider");
            }
            if (jenkinsProvider == null)
            {
                throw new ArgumentNullException("jenkinsProvider");
            }
            if (bitriseProvider == null)
            {
                throw new ArgumentNullException("bitriseProvider");
            }
            if (travisCIProvider == null)
            {
                throw new ArgumentNullException("travisCIProvider");
            }
            if (bitbucketPipelinesProvider == null)
            {
                throw new ArgumentNullException("bitbucketPipelinesProvider");
            }

            _appVeyorProvider           = appVeyorProvider;
            _teamCityProvider           = teamCityProvider;
            _myGetProvider              = myGetProvider;
            _bambooProvider             = bambooProvider;
            _continuaCIProvider         = continuaCIProvider;
            _jenkinsProvider            = jenkinsProvider;
            _bitriseProvider            = bitriseProvider;
            _travisCIProvider           = travisCIProvider;
            _bitbucketPipelinesProvider = bitbucketPipelinesProvider;
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildSystem" /> class.
        /// </summary>
        /// <param name="appVeyorProvider">The AppVeyor Provider.</param>
        /// <param name="teamCityProvider">The TeamCity Provider.</param>
        /// <param name="myGetProvider">The MyGet Provider.</param>
        /// <param name="bambooProvider">The Bamboo Provider.</param>
        /// <param name="continuaCIProvider">The Continua CI Provider.</param>
        /// <param name="jenkinsProvider">The Jenkins Provider.</param>
        /// <param name="bitriseProvider">The Bitrise Provider.</param>
        /// <param name="travisCIProvider">The Travis CI provider.</param>
        /// <param name="bitbucketPipelinesProvider">The Bitbucket Pipelines provider.</param>
        public BuildSystem(IAppVeyorProvider appVeyorProvider, ITeamCityProvider teamCityProvider, IMyGetProvider myGetProvider, IBambooProvider bambooProvider, IContinuaCIProvider continuaCIProvider, IJenkinsProvider jenkinsProvider, IBitriseProvider bitriseProvider, ITravisCIProvider travisCIProvider, IBitbucketPipelinesProvider bitbucketPipelinesProvider)
        {
            if (appVeyorProvider == null)
            {
                throw new ArgumentNullException(nameof(appVeyorProvider));
            }
            if (teamCityProvider == null)
            {
                throw new ArgumentNullException(nameof(teamCityProvider));
            }
            if (myGetProvider == null)
            {
                throw new ArgumentNullException(nameof(myGetProvider));
            }
            if (bambooProvider == null)
            {
                throw new ArgumentNullException(nameof(bambooProvider));
            }
            if (continuaCIProvider == null)
            {
                throw new ArgumentNullException(nameof(continuaCIProvider));
            }
            if (jenkinsProvider == null)
            {
                throw new ArgumentNullException(nameof(jenkinsProvider));
            }
            if (bitriseProvider == null)
            {
                throw new ArgumentNullException(nameof(bitriseProvider));
            }
            if (travisCIProvider == null)
            {
                throw new ArgumentNullException(nameof(travisCIProvider));
            }
            if (bitbucketPipelinesProvider == null)
            {
                throw new ArgumentNullException(nameof(bitbucketPipelinesProvider));
            }

            AppVeyor           = appVeyorProvider;
            TeamCity           = teamCityProvider;
            MyGet              = myGetProvider;
            Bamboo             = bambooProvider;
            ContinuaCI         = continuaCIProvider;
            Jenkins            = jenkinsProvider;
            Bitrise            = bitriseProvider;
            TravisCI           = travisCIProvider;
            BitbucketPipelines = bitbucketPipelinesProvider;
        }
Beispiel #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BuildSystem" /> class.
        /// </summary>
        /// <param name="appVeyorProvider">The AppVeyor Provider.</param>
        /// <param name="teamCityProvider">The TeamCity Provider.</param>
        /// <param name="myGetProvider">The MyGet Provider.</param>
        /// <param name="bambooProvider">The Bamboo Provider.</param>
        /// <param name="continuaCIProvider">The Continua CI Provider.</param>
        /// <param name="jenkinsProvider">The Jenkins Provider.</param>
        /// <param name="bitriseProvider">The Bitrise Provider.</param>
        /// <param name="travisCIProvider">The Travis CI provider.</param>
        /// <param name="bitbucketPipelinesProvider">The Bitbucket Pipelines provider.</param>
        /// <param name="goCDProvider">The Go.CD provider.</param>
        /// <param name="gitlabCIProvider">The GitLab CI provider.</param>
        /// <param name="tfBuildProvider">The TF Build provider.</param>
        public BuildSystem(
            IAppVeyorProvider appVeyorProvider,
            ITeamCityProvider teamCityProvider,
            IMyGetProvider myGetProvider,
            IBambooProvider bambooProvider,
            IContinuaCIProvider continuaCIProvider,
            IJenkinsProvider jenkinsProvider,
            IBitriseProvider bitriseProvider,
            ITravisCIProvider travisCIProvider,
            IBitbucketPipelinesProvider bitbucketPipelinesProvider,
            IGoCDProvider goCDProvider,
            IGitLabCIProvider gitlabCIProvider,
            ITFBuildProvider tfBuildProvider)
        {
            if (appVeyorProvider == null)
            {
                throw new ArgumentNullException(nameof(appVeyorProvider));
            }
            if (teamCityProvider == null)
            {
                throw new ArgumentNullException(nameof(teamCityProvider));
            }
            if (myGetProvider == null)
            {
                throw new ArgumentNullException(nameof(myGetProvider));
            }
            if (bambooProvider == null)
            {
                throw new ArgumentNullException(nameof(bambooProvider));
            }
            if (continuaCIProvider == null)
            {
                throw new ArgumentNullException(nameof(continuaCIProvider));
            }
            if (jenkinsProvider == null)
            {
                throw new ArgumentNullException(nameof(jenkinsProvider));
            }
            if (bitriseProvider == null)
            {
                throw new ArgumentNullException(nameof(bitriseProvider));
            }
            if (travisCIProvider == null)
            {
                throw new ArgumentNullException(nameof(travisCIProvider));
            }
            if (bitbucketPipelinesProvider == null)
            {
                throw new ArgumentNullException(nameof(bitbucketPipelinesProvider));
            }
            if (goCDProvider == null)
            {
                throw new ArgumentNullException(nameof(goCDProvider));
            }
            if (gitlabCIProvider == null)
            {
                throw new ArgumentNullException(nameof(gitlabCIProvider));
            }
            if (tfBuildProvider == null)
            {
                throw new ArgumentNullException(nameof(tfBuildProvider));
            }

            AppVeyor           = appVeyorProvider;
            TeamCity           = teamCityProvider;
            MyGet              = myGetProvider;
            Bamboo             = bambooProvider;
            ContinuaCI         = continuaCIProvider;
            Jenkins            = jenkinsProvider;
            Bitrise            = bitriseProvider;
            TravisCI           = travisCIProvider;
            BitbucketPipelines = bitbucketPipelinesProvider;
            GoCD     = goCDProvider;
            GitLabCI = gitlabCIProvider;
            TFBuild  = tfBuildProvider;

            Provider = (AppVeyor.IsRunningOnAppVeyor ? BuildProvider.AppVeyor : BuildProvider.Local)
                       | (TeamCity.IsRunningOnTeamCity ? BuildProvider.TeamCity : BuildProvider.Local)
                       | (MyGet.IsRunningOnMyGet ? BuildProvider.MyGet : BuildProvider.Local)
                       | (Bamboo.IsRunningOnBamboo ? BuildProvider.Bamboo : BuildProvider.Local)
                       | (ContinuaCI.IsRunningOnContinuaCI ? BuildProvider.ContinuaCI : BuildProvider.Local)
                       | (Jenkins.IsRunningOnJenkins ? BuildProvider.Jenkins : BuildProvider.Local)
                       | (Bitrise.IsRunningOnBitrise ? BuildProvider.Bitrise : BuildProvider.Local)
                       | (TravisCI.IsRunningOnTravisCI ? BuildProvider.TravisCI : BuildProvider.Local)
                       | (BitbucketPipelines.IsRunningOnBitbucketPipelines ? BuildProvider.BitbucketPipelines : BuildProvider.Local)
                       | (GoCD.IsRunningOnGoCD ? BuildProvider.GoCD : BuildProvider.Local)
                       | (GitLabCI.IsRunningOnGitLabCI ? BuildProvider.GitLabCI : BuildProvider.Local)
                       | (TFBuild.IsRunningOnAzurePipelines ? BuildProvider.AzurePipelines : BuildProvider.Local)
                       | (TFBuild.IsRunningOnAzurePipelinesHosted ? BuildProvider.AzurePipelinesHosted : BuildProvider.Local);

            IsLocalBuild = Provider == BuildProvider.Local;

            IsPullRequest = ((Provider & BuildProvider.AppVeyor) != 0 && AppVeyor.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & BuildProvider.TeamCity) != 0 && TeamCity.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & BuildProvider.Bitrise) != 0 && Bitrise.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & BuildProvider.TravisCI) != 0 && TravisCI.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & BuildProvider.BitbucketPipelines) != 0 && BitbucketPipelines.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & BuildProvider.GitLabCI) != 0 && GitLabCI.Environment.PullRequest.IsPullRequest) ||
                            ((Provider & (BuildProvider.AzurePipelines | BuildProvider.AzurePipelinesHosted)) != 0 && TFBuild.Environment.PullRequest.IsPullRequest);
        }
Beispiel #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TravisCIActionDisposable"/> class.
 /// </summary>
 /// <param name="travisCiProvider">The Travis CI provider.</param>
 /// <param name="disposeAction">The dispose action.</param>
 public TravisCIActionDisposable(ITravisCIProvider travisCiProvider, Action <ITravisCIProvider> disposeAction)
 {
     _travisCiProvider = travisCiProvider;
     _disposeAction    = disposeAction;
 }