Beispiel #1
0
        public BuildData StartNewBuild()
        {
            uint buildNumber;

            lock (buildNumberLock) {
                if (LastBuild == null)
                {
                    LastBuild = new ProjectLastBuild();
                }

                LastBuild.Number++;
                LastBuild.Time = DateTime.Now;

                buildNumber = LastBuild.Number;
            }

            try {
                Save();
            }
            catch (Exception error) {
                Log.Error("Failed to update ProjectData index file!", error);
            }

            return(Builds.New(buildNumber));
        }
Beispiel #2
0
        public uint StartNewDeployment()
        {
            uint deployNumber;

            lock (deployNumberLock) {
                if (LastDeployment == null)
                {
                    LastDeployment = new ProjectLastBuild();
                }

                LastDeployment.Number++;
                LastDeployment.Time = DateTime.Now;

                deployNumber = LastDeployment.Number;
            }

            var deployPath = Path.Combine(DataPath, "Deployments", deployNumber.ToString());

            PathEx.CreatePath(deployPath);

            try {
                Save();
            }
            catch (Exception error) {
                Log.Error("Failed to update ProjectData index file!", error);
            }

            return(deployNumber);
        }
Beispiel #3
0
        public async Task <BuildData> StartNewBuild()
        {
            if (!isLoaded)
            {
                await loadTask.Task;
            }

            uint buildNumber;

            lock (buildNumberLock) {
                if (LastBuild == null)
                {
                    LastBuild = new ProjectLastBuild();
                }

                LastBuild.Number++;
                LastBuild.Time = DateTime.Now;

                buildNumber = LastBuild.Number;
            }

            try {
                SaveLastBuild();
            }
            catch (Exception error) {
                Log.Error("Failed to update project lastBuild file!", error);
            }

            var newBuild = Builds.New(buildNumber);

            if (Description.MaxBuilds.HasValue)
            {
                try {
                    Builds.Cleanup((int)Description.MaxBuilds.Value);
                }
                catch {}
            }

            return(newBuild);
        }