コード例 #1
0
ファイル: Aliases.cs プロジェクト: vankooch/Cake.AppVeyor
        public static AppVeyorProjectHistory AppVeyorProjectHistory(this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug, int recordsPerPage, int?startBuildId = null, string branch = null)
        {
            var appVeyor = AppVeyorClient.Create(settings.ApiToken);

            return(appVeyor.GetProjectHistory(accountName, projectSlug, recordsPerPage, startBuildId, branch).Result);
        }
コード例 #2
0
ファイル: Aliases.cs プロジェクト: vankooch/Cake.AppVeyor
        public static void AppVeyorClearCache(this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug)
        {
            var appVeyor = AppVeyorClient.Create(settings.ApiToken);

            appVeyor.ClearCache(accountName, projectSlug).Wait();
        }
コード例 #3
0
ファイル: Aliases.cs プロジェクト: vankooch/Cake.AppVeyor
        public static List <AppVeyorProject> AppVeyorProjects(this ICakeContext context, AppVeyorSettings settings)
        {
            var appVeyor = AppVeyorClient.Create(settings.ApiToken);

            return(appVeyor.GetProjects().Result);
        }
コード例 #4
0
ファイル: Aliases.cs プロジェクト: vankooch/Cake.AppVeyor
        public static AppVeyorProjectBuild AppVeyorProjectLastBuild(this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug)
        {
            var appVeyor = AppVeyorClient.Create(settings.ApiToken);

            return(appVeyor.GetProjectLastBuild(accountName, projectSlug).Result);
        }
コード例 #5
0
ファイル: Aliases.cs プロジェクト: vankooch/Cake.AppVeyor
        public static AppVeyorProjectBuild AppVeyorProjectLastSuccessfulBuild(this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug, string branch = null, int?beforeBuildId = null)
        {
            var appVeyor = AppVeyorClient.Create(settings.ApiToken);

            AppVeyorProjectBuild lastSuccess = null;
            int?startBuildId = beforeBuildId;

            while (lastSuccess == null)
            {
                var history = appVeyor.GetProjectHistory(accountName, projectSlug, 2, startBuildId: startBuildId).Result;

                if (history == null || history.Builds == null || history.Builds.Count <= 0)
                {
                    break;
                }

                foreach (var build in history.Builds)
                {
                    if (build.Status.Equals("success", StringComparison.OrdinalIgnoreCase))
                    {
                        lastSuccess = new AppVeyorProjectBuild {
                            Project = history.Project,
                            Build   = build,
                        };
                        break;
                    }
                }

                startBuildId = history.Builds.Last().BuildId;
            }

            return(lastSuccess);
        }
コード例 #6
0
ファイル: Aliases.cs プロジェクト: Redth/Cake.AppVeyor
 public static AppVeyorProjectHistory AppVeyorProjectHistory (this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug, int recordsPerPage, int? startBuildId = null, string branch = null)
 {
     var appVeyor = AppVeyorClient.Create (settings.ApiToken);
     return appVeyor.GetProjectHistory (accountName, projectSlug, recordsPerPage, startBuildId, branch).Result;
 }
コード例 #7
0
ファイル: Aliases.cs プロジェクト: Redth/Cake.AppVeyor
 public static List<AppVeyorProject> AppVeyorProjects (this ICakeContext context, AppVeyorSettings settings)
 {
     var appVeyor = AppVeyorClient.Create (settings.ApiToken);
     return appVeyor.GetProjects ().Result;
 }
コード例 #8
0
ファイル: Aliases.cs プロジェクト: Redth/Cake.AppVeyor
 public static void AppVeyorClearCache(this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug)
 {
     var appVeyor = AppVeyorClient.Create(settings.ApiToken);
     appVeyor.ClearCache (accountName, projectSlug).Wait();
 }
コード例 #9
0
ファイル: Aliases.cs プロジェクト: Redth/Cake.AppVeyor
        public static AppVeyorProjectBuild AppVeyorProjectLastSuccessfulBuild (this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug, string branch = null, int? beforeBuildId = null)
        {
            var appVeyor = AppVeyorClient.Create (settings.ApiToken);

            AppVeyorProjectBuild lastSuccess = null;
            int? startBuildId = beforeBuildId;

            while (lastSuccess == null) {
                var history = appVeyor.GetProjectHistory (accountName, projectSlug, 2, startBuildId: startBuildId).Result;

                if (history == null || history.Builds == null || history.Builds.Count <= 0)
                    break;

                foreach (var build in history.Builds) {
                    if (build.Status.Equals ("success", StringComparison.InvariantCultureIgnoreCase)) {
                        lastSuccess = new AppVeyorProjectBuild {
                            Project = history.Project,
                            Build = build,
                        };
                        break;
                    }
                }

                startBuildId = history.Builds.Last ().BuildId;
            }

            return lastSuccess;
        }
コード例 #10
0
ファイル: Aliases.cs プロジェクト: Redth/Cake.AppVeyor
 public static AppVeyorProjectBuild AppVeyorProjectLastBuild (this ICakeContext context, AppVeyorSettings settings, string accountName, string projectSlug)
 {
     var appVeyor = AppVeyorClient.Create (settings.ApiToken);
     return appVeyor.GetProjectLastBuild (accountName, projectSlug).Result;
 }