コード例 #1
0
        public bool ShouldRunBuild(IIntegrationResult result)
        {
            Log.Info(string.Format("{0}.{1}:Begin", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name));
            this.Result = result;
            bool IsRunnable;

            IsRunnable = this.CheckIfRunnable(this.Allowed, true);
            Log.Info(string.Format("{0}.{1}:IsRunnable={1}", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name, IsRunnable.ToString()));
            if (!IsRunnable)
            {
                return(false);
            }

            IsRunnable = this.CheckIfRunnable(this.Blocked, false);
            Log.Info(string.Format("{0}.{1}:IsRunnable={1}", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name, IsRunnable.ToString()));
            if (!IsRunnable)
            {
                return(false);
            }

            Log.Info(string.Format("{0}.{1}:IsRunnable={1}", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name, IsRunnable.ToString()));
            return(true);
        }
コード例 #2
0
        public bool ShouldRunBuild(IIntegrationResult result)
        {
            Log.Info(string.Format("{0}:Begin", System.Reflection.MethodBase.GetCurrentMethod().Name));
            this.Result = result;
            bool IsRunnable;

            if (result.BuildCondition != BuildCondition.ForceBuild)
            {
                Log.Info(string.Format("{0}:'result.BuildCondition != BuildCondition.ForceBuild'", System.Reflection.MethodBase.GetCurrentMethod().Name));

                IsRunnable = this.CheckIfRunnable(this.Triggered);
                Log.Info(string.Format("{0}.{1}:IsRunnable={1}", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name, IsRunnable.ToString()));
                if (!IsRunnable)
                {
                    Log.Info("Trigger blocked by integration filter.");
                    return(false);
                }
            }

            if (result.BuildCondition == BuildCondition.ForceBuild)
            {
                IsRunnable = this.CheckIfRunnable(this.Forced);
                Log.Info(string.Format("{0}.{1}:IsRunnable={1}", System.Reflection.MethodBase.GetCurrentMethod().ReflectedType.Name, System.Reflection.MethodBase.GetCurrentMethod().Name, IsRunnable.ToString()));
                if (!IsRunnable)
                {
                    Log.Info("Force blocked by integration filter.");
                    return(false);
                }
            }

            return(true);
        }