示例#1
0
        /// <summary>
        /// Call from the RoleEntryPoint.OnStart() method.
        /// </summary>
        /// <returns>true; throws exception is there is an error</returns>
        public bool OnStart()
        {
            if (_purgesites)
            {
                IisEnvironment.PurgeAllSites();
            }

            _octopusDeploy.ConfigureTentacle();
            _octopusDeploy.DeployAllCurrentReleasesToThisMachine();

            return(true);
        }
示例#2
0
        /// <summary>
        /// Call from the RoleEntryPoint.Run() method.
        /// Note: This method is an infinite loop; call from a Thread/Task if you want to run other code alongside.
        /// </summary>
        public void Run()
        {
            // Don't want to configure IIS if we are emulating; just sleep forever
            if (RoleEnvironment.IsEmulated)
            {
                Thread.Sleep(-1);
            }

            while (true)
            {
                try
                {
                    IisEnvironment.ActivateAppInitialisationModuleForAllSites();
                }
                catch (Exception e)
                {
                    Log.Warning(e, "Failure to configure IIS");
                }

                Thread.Sleep(TimeSpan.FromMinutes(10));
            }
            // ReSharper disable FunctionNeverReturns
        }
示例#3
0
        // ReSharper restore FunctionNeverReturns

        /// <summary>
        /// Call from RoleEntryPoint.OnStop().
        /// </summary>
        public void OnStop()
        {
            _octopusDeploy.DeleteMachine();
            IisEnvironment.WaitForAllHttpRequestsToEnd();
        }