コード例 #1
0
        private void LaunchServer()
        {
            using (ConsoleEventHandler handler = new ConsoleEventHandler())
            {
                handler.OnConsoleEvent += new EventHandler(HandleControlEvent);

                using (server = serverFactory.Create(args.UseRemoting, args.ConfigFile))
                {
                    if (args.Project == null)
                    {
                        server.Start();
                        server.WaitForExit();
                    }
                    else
                    {
                        // Force the build
                        ValidateResponse(
                            server.ForceBuild(
                                new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project)));

                        // Tell the server to stop as soon as the build has finished and then wait for it
                        ValidateResponse(
                            server.Stop(
                                new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project)));
                        server.WaitForExit(
                            new ProjectRequest(SecurityOverride.SessionIdentifier, args.Project));
                    }
                }
            }
        }
コード例 #2
0
ファイル: ConsoleRunner.cs プロジェクト: vardars/ci-factory
        private void LaunchServer()
        {
            using (ConsoleEventHandler handler = new ConsoleEventHandler())
            {
                handler.OnConsoleEvent += new EventHandler(HandleControlEvent);

                using (server = _serverFactory.Create(_parser.UseRemoting, _parser.ConfigFile))
                {
                    if (_parser.Project == null)
                    {
                        server.Start();
                        server.WaitForExit();
                    }
                    else
                    {
                        server.ForceBuild(_parser.Project, null);
                        server.WaitForExit(_parser.Project);
                    }
                }
            }
        }
コード例 #3
0
        private void LaunchServer()
        {
            using (ConsoleEventHandler handler = new ConsoleEventHandler())
            {
                handler.OnConsoleEvent += new EventHandler(HandleControlEvent);

                using (server = _serverFactory.Create(_parser.UseRemoting, _parser.ConfigFile))
                {
                    if (_parser.Project == null)
                    {
                        server.Start();
                        server.WaitForExit();
                    }
                    else
                    {
                        server.ForceBuild(_parser.Project, null);
                        server.WaitForExit(_parser.Project);
                    }
                }
            }
        }
コード例 #4
0
        public void Stop(string reason)
        {
            // Since there may be a race condition around stopping the runner, check if it should be stopped
            // within a lock statement
            bool stopRunner = false;

            lock (lockObject)
            {
                if (!isStopping)
                {
                    stopRunner = true;
                    isStopping = true;
                }
            }
            if (stopRunner)
            {
                // Perform the actual stop
                Log.Info("Stopping service: " + reason);
                server.Stop();
                server.WaitForExit();
                Log.Debug("Service has been stopped");
            }
        }
コード例 #5
0
 public void WaitForExit(string project)
 {
     cruiseServer.WaitForExit(project);
 }
コード例 #6
0
 public void WaitForExit()
 {
     _server.WaitForExit();
 }
コード例 #7
0
 /// <summary>
 /// Stops this instance.
 /// </summary>
 /// <remarks></remarks>
 public void Stop()
 {
     server.Stop();
     server.WaitForExit();
 }
コード例 #8
0
 /// <summary>
 /// Wait for CruiseControl server to finish executing
 /// </summary>
 public virtual void WaitForExit()
 {
     server.WaitForExit();
 }
コード例 #9
0
        private void LaunchServer()
        {
            using (ConsoleEventHandler handler = new ConsoleEventHandler())
            {
                handler.OnConsoleEvent += new EventHandler(HandleControlEvent);

                using (server = serverFactory.Create(args.UseRemoting, args.ConfigFile))
                {
                    if (args.Project == null)
                    {
                        server.Start();
                        server.WaitForExit();
                    }
                    else
                    {
                        // Force the build
                        ValidateResponse(
                            server.ForceBuild(
                                new ProjectRequest(null, args.Project)));

                        // Tell the server to stop as soon as the build has finished and then wait for it
                        ValidateResponse(
                            server.Stop(
                                new ProjectRequest(null, args.Project)));
                        server.WaitForExit(
                            new ProjectRequest(null, args.Project));
                    }
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// Waits for exit.
        /// </summary>
        /// <param name="projectName">Name of the project.</param>
        /// <remarks></remarks>
        public void WaitForExit(string projectName)
        {
            Response resp = cruiseServer.WaitForExit(GenerateProjectRequest(projectName));

            ValidateResponse(resp);
        }