Beispiel #1
0
        public SourceInfo[] GetSources(int appId)
        {
            BuildService.CheckClient();
            List <SourceInfo> list = new List <SourceInfo> ();

            using (UserModel m = UserModel.GetAdmin(appId)) {
                foreach (Project p in m.GetProjects())
                {
                    foreach (VcsSource s in m.GetSources(p.Id))
                    {
                        if (s.IsUploadSource)
                        {
                            continue;
                        }
                        List <SourceTagInfo> tags = new List <SourceTagInfo> ();
                        foreach (SourceTag st in m.GetVcsSourceTags(s.Id))
                        {
                            tags.Add(new SourceTagInfo(st));
                        }
                        list.Add(new SourceInfo(p, s, tags.ToArray()));
                    }
                }
                return(list.ToArray());
            }
        }
Beispiel #2
0
 public void SetPublished(int appId, int releaseId)
 {
     BuildService.CheckClient();
     using (UserModel m = UserModel.GetAdmin(appId)) {
         m.SetPublished(m.GetRelease(releaseId));
     }
 }
Beispiel #3
0
 public void UpdateSourceTags(int appId, int sourceId, DateTime fetchTime, SourceTagInfo[] sourceTags)
 {
     BuildService.CheckClient();
     using (UserModel m = UserModel.GetAdmin(appId)) {
         VcsSource s = m.GetSource(sourceId);
         s.LastFetchTime = fetchTime;
         m.UpdateSource(s, false);
         IEnumerable <SourceTag> currentTags = m.GetVcsSourceTags(sourceId);
         foreach (SourceTagInfo stInfo in sourceTags)
         {
             SourceTag st = currentTags.FirstOrDefault(t => t.Url == stInfo.Url);
             if (st != null)
             {
                 stInfo.MergeTo(st);
                 m.UpdateSourceTag(st);
             }
             else
             {
                 st           = new SourceTag();
                 st.SourceId  = s.Id;
                 st.ProjectId = s.ProjectId;
                 stInfo.MergeTo(st);
                 m.CreateSourceTag(st);
             }
         }
         foreach (SourceTag st in currentTags)
         {
             if (!sourceTags.Any(t => t.Url == st.Url))
             {
                 m.DeleteSourceTag(st);
             }
         }
     }
 }
Beispiel #4
0
 public void SetSourceStatus(int appId, int sourceId, string status, string errorMessage)
 {
     BuildService.CheckClient();
     using (UserModel m = UserModel.GetAdmin(appId)) {
         m.SetSourceStatus(sourceId, status, errorMessage);
     }
 }
Beispiel #5
0
 public void SetSourceTagStatus(int appId, int sourceId, string status)
 {
     BuildService.CheckClient();
     using (UserModel m = UserModel.GetAdmin(appId)) {
         SourceTag stag = m.GetSourceTag(sourceId);
         m.SetSourceTagStatus(stag, status);
     }
 }
Beispiel #6
0
        public AppReleaseInfo[] GetAppReleases(int appId)
        {
            BuildService.CheckClient();
            List <AppReleaseInfo> list = new List <AppReleaseInfo> ();

            using (UserModel m = UserModel.GetAdmin(appId)) {
                foreach (AppRelease r in m.GetAppReleases())
                {
                    list.Add(new AppReleaseInfo(m, r));
                }
                return(list.ToArray());
            }
        }
Beispiel #7
0
 public void SetSourceTagBuilt(int appId, int sourceTagId)
 {
     BuildService.CheckClient();
     using (UserModel m = UserModel.GetAdmin(appId)) {
         SourceTag st = m.GetSourceTag(sourceTagId);
         m.SetSourceTagStatus(st, SourceTagStatus.Ready);
         VcsSource vcs = m.GetVcsSource(st.SourceId);
         if (vcs.AutoPublish)
         {
             Builder.BuildService.PublishRelease(m, st, false);
         }
     }
 }
Beispiel #8
0
        public ReleaseInfo[] GetReleases(int appId)
        {
            BuildService.CheckClient();
            using (UserModel m = UserModel.GetAdmin(appId)) {
                List <ReleaseInfo> list = new List <ReleaseInfo> ();

                foreach (Project p in m.GetProjects())
                {
                    foreach (Release rel in m.GetProjectReleases(p.Id))
                    {
                        list.Add(new ReleaseInfo(rel));
                    }
                }
                return(list.ToArray());
            }
        }
Beispiel #9
0
        public void SetSourceTagBuildData(int appId, int stagId, SourceTagAddinInfo[] addins)
        {
            BuildService.CheckClient();
            SourceTagAddinInfo addin = addins [0];

            using (UserModel m = UserModel.GetAdmin(appId)) {
                SourceTag st = m.GetSourceTag(stagId);
                st.AddinVersion     = addin.AddinVersion;
                st.AddinId          = addin.AddinId;
                st.TargetAppVersion = addin.AppVersion;
                st.Platforms        = addin.Platforms;        // string.Join (" ", addin.Platforms);
                st.Status           = SourceTagStatus.Built;
                st.BuildDate        = DateTime.Now;
                m.UpdateSourceTag(st);
            }
        }
Beispiel #10
0
        public SettingsInfo GetSettings()
        {
            BuildService.CheckClient();
            SettingsInfo settings = new SettingsInfo();

            using (ServiceModel sm = ServiceModel.GetCurrent()) {
                List <ApplicationInfo> apps = new List <ApplicationInfo> ();
                foreach (Application app in sm.GetApplications())
                {
                    apps.Add(new ApplicationInfo()
                    {
                        Id = app.Id, Name = app.Name, Platforms = app.Platforms
                    });
                }
                settings.Applications = apps.ToArray();
            }
            return(settings);
        }
Beispiel #11
0
 public void Log(LogSeverity severity, string message)
 {
     BuildService.CheckClient();
     BuildService.Log(severity, message);
 }
Beispiel #12
0
 public void SetBuildServiceStatus(string status)
 {
     BuildService.CheckClient();
     BuildService.Status = status;
 }
Beispiel #13
0
 public void DisconnectBuildService()
 {
     BuildService.CheckClient();
     BuildService.Disconnect();
 }