Beispiel #1
0
        // called when the compilation ended
        private void OnCompilationEnd(DeploymentHandler proDeployment)
        {
            Task.Factory.StartNew(() => {
                this.SafeInvoke(page => {
                    // get rid of the timer
                    if (_progressTimer != null)
                    {
                        _progressTimer.Stop();
                        _progressTimer.Dispose();
                        _progressTimer = null;
                    }
                    ResetScreen();
                    UpdateReport(_proDeployment.FormatDeploymentReport());
                    btReport.Visible = true;

                    // notify the user
                    if (!_proDeployment.HasBeenCancelled)
                    {
                        UserCommunication.NotifyUnique("ReportAvailable", "The requested deployment is over,<br>please check the generated report to see the result :<br><br><a href= '#'>Click here to see the report</a>", MessageImg.MsgInfo, "Deploy your application", "Report available", args => {
                            Appli.GoToPage(PageNames.MassCompiler);
                            UserCommunication.CloseUniqueNotif("ReportAvailable");
                        }, Appli.IsFocused() ? 10 : 0);
                    }
                });
            });
        }
Beispiel #2
0
        /// <summary>
        /// Start the deployment!
        /// </summary>
        private void BtStartOnButtonPressed(object sender, EventArgs eventArgs)
        {
            bool isTest = sender == null;

            SetDataFromFields();
            SaveProfilesList();

            if (string.IsNullOrEmpty(DeploymentProfile.Current.SourceDirectory) || !Directory.Exists(DeploymentProfile.Current.SourceDirectory))
            {
                BlinkTextBox(fl_directory, ThemeManager.Current.GenericErrorColor);
                return;
            }

            // init screen
            btStart.Visible      = false;
            btTest.Visible       = false;
            btReset.Visible      = false;
            progressBar.Visible  = true;
            progressBar.Progress = 0;
            progressBar.Text     = @"Please wait, the deployment is starting...";
            btReport.Visible     = false;
            lbl_report.Visible   = false;
            _reportExportPath    = null;

            // start the deployment
            Task.Factory.StartNew(() => {
                _proDeployment = new DeploymentHandler(ProEnvironment.Current, DeploymentProfile.Current)
                {
                    IsTestMode     = isTest,
                    OnExecutionEnd = OnCompilationEnd,
                    IsAnalysisMode = false
                };

                UpdateProgressBar();
                btCancel.SafeInvoke(button => button.Visible = true);

                if (_proDeployment.Start())
                {
                    this.SafeInvoke(page => {
                        // start a recurrent event (every second) to update the progression of the compilation
                        _progressTimer          = new Timer();
                        _progressTimer.Interval = 500;
                        _progressTimer.Tick    += (o, args) => UpdateProgressBar();
                        _progressTimer.Start();
                    });
                }
                else
                {
                    // nothing started
                    ResetScreen();
                }
            });
        }
Beispiel #3
0
 public HealthChecksController(
     IKubernetes client,
     DeploymentHandler deploymentHandler,
     ServiceHandler serviceHandler,
     SecretHandler secretHandler,
     ILogger <K8sOperator> logger)
 {
     _client            = client ?? throw new ArgumentNullException(nameof(client));
     _deploymentHandler = deploymentHandler ?? throw new ArgumentNullException(nameof(deploymentHandler));
     _serviceHandler    = serviceHandler ?? throw new ArgumentNullException(nameof(serviceHandler));
     _secretHandler     = secretHandler ?? throw new ArgumentNullException(nameof(secretHandler));
     _logger            = logger ?? throw new ArgumentNullException(nameof(logger));
 }