Esempio n. 1
0
        static void EnqueueBuildsInBamboo(Config config, List <string> branchesToIntegrate)
        {
            if (branchesToIntegrate.Count == 0)
            {
                return;
            }

            BambooBuildEnqueuer enqueuer = new BambooBuildEnqueuer(config);

            foreach (string branch in branchesToIntegrate)
            {
                string planKey = enqueuer.GetBranchPlanKey(branch);
                if (string.IsNullOrEmpty(planKey))
                {
                    mLog.WarnFormat(
                        "Couldn't find a build plan for branch {0}", branch);
                    continue;
                }

                if (EnqueueBuild(enqueuer, planKey, branch))
                {
                    SetStatusToTesting(branch, config);
                }
            }
        }
Esempio n. 2
0
 static bool EnqueueBuild(
     BambooBuildEnqueuer enqueuer, string planKey, string branch)
 {
     mLog.DebugFormat(
         "Plan key {0} found for branch {1}. Enqueuing build.", planKey, branch);
     try
     {
         enqueuer.EnqueueBuild(planKey);
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(
             "Unable to enqueue a build for branch {0}, plan {1} in "
             + "Bamboo. See log for further details.", branch, planKey);
         mLog.ErrorFormat(
             "Error enqueuing branch {0} plan build {1}: {2}",
             planKey,
             branch,
             e.Message);
         mLog.DebugFormat("Stack trace:{0}{1}", Environment.NewLine, e.StackTrace);
         return(false);
     }
 }