public bool Exists(string?awsAccountId, string?awsRegion, string?projectName)
        {
            if (string.IsNullOrEmpty(AWSAccountId) ||
                string.IsNullOrEmpty(AWSRegion) ||
                string.IsNullOrEmpty(ProjectName))
            {
                return(false);
            }

            if (string.IsNullOrEmpty(awsAccountId) ||
                string.IsNullOrEmpty(awsRegion) ||
                string.IsNullOrEmpty(projectName))
            {
                return(false);
            }

            if (AWSAccountId.Equals(awsAccountId) &&
                AWSRegion.Equals(awsRegion) &&
                ProjectName.Equals(projectName))
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public override bool Equals(object obj)
        {
            Project other = obj as Project;

            if (other != null)
            {
                return(ProjectName.Equals(other.ProjectName, StringComparison.OrdinalIgnoreCase));
            }
            return(false);
        }
Example #3
0
 public bool Equals(ProjectData other)
 {
     if (other is null)
     {
         return(false);
     }
     if (Object.ReferenceEquals(this, other))
     {
         return(true);
     }
     return(ProjectName.Equals(other.ProjectName) && Description.Equals(other.Description));
 }
Example #4
0
        private string ExcuteDeploy(FormHandler.FormItem fileItem)
        {
            var re = DeployExcutor(fileItem);

            try
            {
                if (_formHandler == null)
                {
                    return(re);
                }

                if (!string.IsNullOrEmpty(re))
                {
                    return(re);
                }

                if (string.IsNullOrEmpty(ProjectPublishFolder) || !Directory.Exists(ProjectPublishFolder))
                {
                    return(re);
                }

                //保存参数
                var formArgs = _formHandler.FormItems.Where(r => r.FileBody == null || r.FileBody.Length < 1).ToList();
                if (formArgs.Any())
                {
                    var path    = Path.Combine(ProjectPublishFolder, "antdeploy_args.json");
                    var content = JsonConvert.SerializeObject(formArgs);
                    File.WriteAllText(path, content, Encoding.UTF8);
                }

                SaveCurrentVersion(ProjectPublishFolder);
            }
            catch (Exception)
            {
                //ignore
            }

            var projectRootPath = new DirectoryInfo(ProjectPublishFolder).Parent;

            if (projectRootPath == null || !projectRootPath.Exists)
            {
                return(re);
            }
            //每次发布完成后清理老的发布历史记录 只清理自己项目的
            //防止别的项目正在回滚到某个版本,你这边发现这个版本已经过时了就删除了
            Setting.ClearOldFolders(ProviderName.Equals("iis") || ProjectName.Equals("linux"), projectRootPath.Name, Log);
            return(re);
        }
Example #5
0
        /// <summary>
        /// Returns true if ReleaseInfo instances are equal
        /// </summary>
        /// <param name="other">Instance of ReleaseInfo to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ReleaseInfo other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProjectName == other.ProjectName ||
                     ProjectName != null &&
                     ProjectName.Equals(other.ProjectName)
                     ) &&
                 (
                     Environments == other.Environments ||
                     Environments != null &&
                     Environments.SequenceEqual(other.Environments)
                 ));
        }
        /// <summary>
        /// Returns true if RentalRequestSearchResultViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of RentalRequestSearchResultViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(RentalRequestSearchResultViewModel other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     LocalArea == other.LocalArea ||
                     LocalArea != null &&
                     LocalArea.Equals(other.LocalArea)
                 ) &&
                 (
                     EquipmentCount == other.EquipmentCount ||
                     EquipmentCount != null &&
                     EquipmentCount.Equals(other.EquipmentCount)
                 ) &&
                 (
                     EquipmentTypeName == other.EquipmentTypeName ||
                     EquipmentTypeName != null &&
                     EquipmentTypeName.Equals(other.EquipmentTypeName)
                 ) &&
                 (
                     ProjectName == other.ProjectName ||
                     ProjectName != null &&
                     ProjectName.Equals(other.ProjectName)
                 ) &&
                 (
                     PrimaryContact == other.PrimaryContact ||
                     PrimaryContact != null &&
                     PrimaryContact.Equals(other.PrimaryContact)
                 ) &&
                 (
                     Status == other.Status ||
                     Status != null &&
                     Status.Equals(other.Status)
                 ) &&
                 (
                     ProjectId == other.ProjectId ||
                     ProjectId != null &&
                     ProjectId.Equals(other.ProjectId)
                 ) &&
                 (
                     ExpectedStartDate == other.ExpectedStartDate ||
                     ExpectedStartDate != null &&
                     ExpectedStartDate.Equals(other.ExpectedStartDate)
                 ) &&
                 (
                     ExpectedEndDate == other.ExpectedEndDate ||
                     ExpectedEndDate != null &&
                     ExpectedEndDate.Equals(other.ExpectedEndDate)
                 ));
        }