public virtual DeployUnitInfo GetUnitInfo()
        {
            var deployUnitInfo = new DeployUnitInfo
            {
                Name = Name,
                HasDeployParameters = HasDeployParameters
            };

            if (Version == null)
            {
                Version = VersionUtil.GetCurrentVersion(DataDirectory);
                if (Version.DeployFailed)
                {
                    DeployStatus = DeployStatus.DeployFailed;
                }
            }

            if (!Version.DeployFailed)
            {
                deployUnitInfo.LastDeployed = $"Deployed by {Version.UserName} {DateUtils.GetFriendlyAge(Version.DeployTimestamp)}";
            }

            deployUnitInfo.Version      = Version;
            deployUnitInfo.DeployStatus = DeployStatus;

            return(deployUnitInfo);
        }
示例#2
0
        public virtual DeployUnitInfo GetUnitInfo()
        {
            var deployUnitInfo = new DeployUnitInfo();

            deployUnitInfo.Name = Name;
            deployUnitInfo.HasDeployParameters = HasDeployParameters;

            if (Version == null)
            {
                Version = VersionUtil.GetCurrentVersion(DataDirectory);
                if (Version.DeployFailed)
                {
                    DeployStatus = DeployStatus.DeployFailed;
                }
            }

            if (!Version.DeployFailed)
            {
                deployUnitInfo.LastDeployed = string.Format("Deployed by {0} {1}", Version.UserName, DateUtils.GetFriendlyAge(Version.DeployTimestamp));
            }

            deployUnitInfo.Version      = Version;
            deployUnitInfo.DeployStatus = DeployStatus;

            return(deployUnitInfo);
        }
        public virtual DeployUnitInfo GetUnitInfo(bool refreshUnitStatus)
        {
            var deployUnitInfo = new DeployUnitInfo
            {
                Name  = Name,
                Group = Group,
                HasDeployParameters = HasDeployParameters
            };

            if (Version == null)
            {
                Version = VersionUtil.GetCurrentVersion(DataDirectory);
                if (Version.DeployFailed)
                {
                    DeployStatus = DeployStatus.DeployFailed;
                }
            }

            if (!Version.DeployFailed)
            {
                if (Version.DeployTimestamp == DateTime.MinValue)
                {
                    deployUnitInfo.LastDeployed = string.Empty;
                }
                else
                {
                    deployUnitInfo.LastDeployed = $"Deployed by {Version.UserName} {DateUtils.GetFriendlyAge(Version.DeployTimestamp)}";
                }
            }

            deployUnitInfo.Version      = Version;
            deployUnitInfo.DeployStatus = DeployStatus;

            if (refreshUnitStatus)
            {
                UpdateUnitStatus();
            }

            return(deployUnitInfo);
        }
        public void current_version_should_return_zero_when_no_verison_file_exists()
        {
            var version = VersionUtil.GetCurrentVersion(".");

            version.VersionNumber.ShouldBe("0.0.0.0");
        }