Beispiel #1
0
 public Promote(IConfiguration configuration, IOctopusHelper octoHelper, IDeployer deployer, IUiLogger uilogger, IProgressBar progressBar, ILanguageProvider languageProvider) : base(octoHelper, languageProvider)
 {
     this.configuration = configuration;
     this.deployer      = deployer;
     this.uilogger      = uilogger;
     this.progressBar   = progressBar;
 }
#pragma warning restore 1591 // Xml Comments

        void ThrowIfDeployerIsNull(string deployerType, IDeployer deployer)
        {
            if (deployer == null)
            {
                throw new DeployerTypeDoesNotExist(deployerType);
            }
        }
        protected override void ProcessRecord()
        {
            _workingFolder = _workingFolder ?? CurrentProviderLocation("FileSystem").ProviderPath;

            var deployArguments = new DeployArguments(
                string.IsNullOrWhiteSpace(_workingFolder) ? null : _workingFolder,
                string.IsNullOrWhiteSpace(DeploymentFilePath) ? null : DeploymentFilePath,
                string.IsNullOrWhiteSpace(ServerInstance) ? null : ServerInstance,
                string.IsNullOrWhiteSpace(Catalog) ? null : Catalog,
                string.IsNullOrWhiteSpace(Folder) ? null : Folder,
                string.IsNullOrWhiteSpace(ProjectName) ? null : ProjectName,
                string.IsNullOrWhiteSpace(ProjectPassword) ? null : ProjectPassword,
                EraseSensitiveInfo,
                string.IsNullOrWhiteSpace(ServerInstanceUserID) ? null : ServerInstanceUserID,
                string.IsNullOrWhiteSpace(ServerInstancePassword) ? null : ServerInstancePassword
                );

            _deployer = _deployer ?? new Deployer();

            try
            {
                _deployer.Deploy(deployArguments);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }
Beispiel #4
0
 public PromptingDeployer(IDeployer inner, MessageComposer composer)
 {
     Deployer        = inner;
     MessageComposer = composer;
     StartPromptProgram();
     Pipe = new IPCPipe(true);
 }
        public void Publish(string WorkingFolder)
        {
            var deployArguments = new DeployArguments(
                WorkingFolder,
                string.IsNullOrWhiteSpace(DeploymentFilePath) ? null : DeploymentFilePath,
                string.IsNullOrWhiteSpace(ServerInstance) ? null : ServerInstance,
                string.IsNullOrWhiteSpace(Catalog) ? null : Catalog,
                string.IsNullOrWhiteSpace(Folder) ? null : Folder,
                string.IsNullOrWhiteSpace(ProjectName) ? null : ProjectName,
                string.IsNullOrWhiteSpace(ProjectPassword) ? null : ProjectPassword,
                EraseSensitiveInfo,
                string.IsNullOrWhiteSpace(ServerInstanceUserID) ? null : ServerInstanceUserID,
                string.IsNullOrWhiteSpace(ServerInstancePassword) ? null : ServerInstancePassword
                );

            _deployer = _deployer ?? new Deployer();

            try
            {
                _deployer.Deploy(deployArguments);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw;
            }
        }
 public DeploymentModule(IDeployHook hook, IDeployer deployer, string historyFile)
 {
     Hook                  = hook;
     Deployer              = deployer;
     History               = new VersionHistory(historyFile);
     Hook.DeploymentReady += OnAttemptDeploy;
     Hook.Initialize();
 }
Beispiel #7
0
 public ConsoleDoJob(IOctopusHelper helper, IDeployer deployer, IProgressBar progressBar, IConfiguration configuration, ILanguageProvider languageProvider)
 {
     this.helper           = helper;
     this.deployer         = deployer;
     this.progressBar      = progressBar;
     this.configuration    = configuration;
     this.languageProvider = languageProvider;
 }
 public void SetUp()
 {
     deployerMock        = new DynamicMock(typeof(IDeployer));
     deployerMock.Strict = false;
     deployer            = (IDeployer)deployerMock.Object;
     deployLocation      = new MyDeploy();
     deployManager       = new DeployManager(new DirectExecutor(), new NullSpringDeployer(), deployLocation, deployer);
 }
Beispiel #9
0
 public Deploy(IConsoleDoJob consoleDoJob, IConfiguration configuration, IOctopusHelper octoHelper, IDeployer deployer, IUiLogger uilogger, DeployWithProfile profile, DeployWithProfileDirectory profileDir, IProgressBar progressBar, ILanguageProvider languageProvider) : base(octoHelper, languageProvider)
 {
     this.consoleDoJob  = consoleDoJob;
     this.configuration = configuration;
     this.deployer      = deployer;
     this.uilogger      = uilogger;
     this.profile       = profile;
     this.profileDir    = profileDir;
     this.progressBar   = progressBar;
 }
        public DeviceBridge(string desiredDeviceName, string ipAddress, string localeTag, bool captureCodedUiLogs)
        {
            this.Culture = new CultureInfo(localeTag);

            this.deployer = DeployerFactory.DeployerForPackage(null, desiredDeviceName, false, this.Culture);

            this.GetIpAddress(ipAddress);

            this.captureCodedUiLogs = captureCodedUiLogs;
        }
        public DeviceBridge(string desiredDeviceName, string ipAddress, string localeTag, bool captureCodedUiLogs)
        {
            this.Culture = new CultureInfo(localeTag);

            this.deployer = DeployerFactory.DeployerForPackage(null, desiredDeviceName, false, this.Culture);

            this.GetIpAddress(ipAddress);

            this.captureCodedUiLogs = captureCodedUiLogs;
        }
        public void WhenRequiesBuildFalseCreatesBasicDeployer()
        {
            var environment = new Mock <IEnvironment>();

            environment.Setup(m => m.RequiresBuild).Returns(false);
            var deployerFactory = new DeployerFactory(environment.Object);

            IDeployer deployer = deployerFactory.CreateDeployer();

            Assert.IsType(typeof(BasicDeployer), deployer);
        }
        public void RequiesBuildCreatesMSBuildDeployer()
        {
            var environment = new Mock <IEnvironment>();

            environment.Setup(m => m.RequiresBuild).Returns(true);
            var deployerFactory = new DeployerFactory(environment.Object);

            IDeployer deployer = deployerFactory.CreateDeployer();

            Assert.IsType(typeof(MSBuildDeployer), deployer);
        }
Beispiel #14
0
        public void Import(string SharePointSiteUrl, string SharePointUserName, string SharePointPassword, string ImportConfigPath, string TemplateRootFolder)
        {
            IOC.Register();
            container = IOC.GetContainer();

            IJsonConverter converter = container.GetInstance <IJsonConverter>();
            var            mapped    = converter.GetConfiguration(ImportConfigPath);

            IDeployer deployer = container.GetInstance <IDeployer>();

            deployer.Deploy(mapped, TemplateRootFolder, SharePointSiteUrl, SharePointUserName, SharePointPassword);
        }
Beispiel #15
0
        public MainViewModel(IObservable <LogEvent> events, IDeployer <RaspberryPi> deployer, IPackageImporterFactory importerFactory, DiskService diskService,
                             UIServices uiServices, ISettingsService settingsService)
        {
            this.deployer               = deployer;
            this.importerFactory        = importerFactory;
            this.uiServices             = uiServices;
            this.settingsService        = settingsService;
            RefreshDisksCommmandWrapper = new CommandWrapper <Unit, ICollection <Disk> >(this,
                                                                                         ReactiveCommand.CreateFromTask(diskService.GetDisks), uiServices.DialogService);
            disksHelper = RefreshDisksCommmandWrapper.Command
                          .Select(x => x
                                  .Where(y => !y.IsBoot && !y.IsSystem && !y.IsOffline)
                                  .Select(disk => new DiskViewModel(disk)))
                          .ToProperty(this, x => x.Disks);

            ShowWarningCommand = ReactiveCommand.CreateFromTask(() => uiServices.DialogService.ShowAlert(this, Resources.TermsOfUseTitle,
                                                                                                         Resources.WarningNotice));

            ImportDriverPackageWrapper = new CommandWrapper <Unit, Unit>(this,
                                                                         ReactiveCommand.CreateFromTask(ImportDriverPackage), uiServices.DialogService);

            SetupPickWimCommand();

            var whenAnyValue = this.WhenAnyValue(x => x.SelectedDisk, (DiskViewModel disk) => disk != null);

            var canDeploy = this.WhenAnyObservable(x => x.WimMetadata.SelectedImageObs)
                            .Select(metadata => metadata != null)
                            .CombineLatest(whenAnyValue, (isWimSelected, isDiskSelected) => isDiskSelected && isWimSelected);

            FullInstallWrapper = new CommandWrapper <Unit, Unit>(this,
                                                                 ReactiveCommand.CreateFromTask(DeployUefiAndWindows, canDeploy), uiServices.DialogService);

            var isBusyObs = FullInstallWrapper.Command.IsExecuting;

            isBusyHelper = isBusyObs.ToProperty(this, model => model.IsBusy);

            progressHelper = progressSubject
                             .Where(d => !double.IsNaN(d))
                             .ObserveOn(SynchronizationContext.Current)
                             .ToProperty(this, model => model.Progress);

            isProgressVisibleHelper = progressSubject
                                      .Select(d => !double.IsNaN(d))
                                      .ToProperty(this, x => x.IsProgressVisible);

            SetupLogging(events);

            hasWimHelper = this.WhenAnyValue(model => model.WimMetadata, (WimMetadataViewModel x) => x != null)
                           .ToProperty(this, x => x.HasWim);

            DonateCommand = ReactiveCommand.Create(() => { Process.Start(DonationLink); });
        }
Beispiel #16
0
 internal static void MainInternal(IDeployer deployer, string[] args)
 {
     try
     {
         var deployArguments = ParseCommandLineArguments(args);
         deployer.Deploy(deployArguments);
     }
     catch (Exception e)
     {
         Console.WriteLine($"ERROR: {e.Message}");
         if (e is CommandLineParsingException || e is DeployArgumentsValidationException)
         {
             Usage();
         }
         throw;
     }
 }
Beispiel #17
0
 public TaxonomyCreator(IDeployer <SiteModelNode> siteDeployer, ClientContext context)
 {
     this.siteDeployer = siteDeployer;
     this.context      = context;
 }
Beispiel #18
0
        protected async Task <bool> ValidateDeployment(EnvironmentDeployment deployment, IDeployer deployer)
        {
            if (deployment == null)
            {
                return(true);
            }

            var result = await deployer.CheckDeployment(deployment);

            if (result.Success)
            {
                return(true);
            }
            else
            {
                System.Console.WriteLine(languageProvider.GetString(LanguageSection.UiStrings, "Error") + result.ErrorMessage);
            }

            return(false);
        }
 public void SetUp ()
 {
     deployerMock = new DynamicMock(typeof(IDeployer));
     deployerMock.Strict = false;
     deployer = (IDeployer) deployerMock.Object;
     deployLocation = new MyDeploy ();
     deployManager = new DeployManager (new DirectExecutor(), new NullSpringDeployer(), deployLocation, deployer);
 }
 public ConditionalDeployer(IDeployer deployer, DeploymentCondition condition)
 {
     Deployer  = deployer;
     Condition = condition;
 }
 public DeployServiceRunner(IDeployer deployer)
 {
     this.Deployer = deployer;
 }
 public ProjectListCreator(IDeployer <WebModelNode> webDeployer, ClientContext context)
 {
     this.webDeployer = webDeployer;
     this.context     = context;
 }
 public FullDeployer(IDeployer deployer, IProjectPublisher publisher)
 {
     this.deployer  = deployer;
     this.publisher = publisher;
 }
Beispiel #24
0
        public void Deploy(string id)
        {
            IDeployer deployer = _deployerFactory.CreateDeployer();

            deployer.Deploy(id);
        }
 internal void ProcessRecordInternal(IDeployer deployer, string workingFolder)
 {
     _deployer      = deployer;
     _workingFolder = workingFolder;
     ProcessRecord();
 }
Beispiel #26
0
 public ConsoleDoJob(IOctopusHelper helper, IDeployer deployer)
 {
     this._helper   = helper;
     this._deployer = deployer;
 }
 public DeployerItem(PhoneModel model, IDeployer <Phone> deployer)
 {
     Model    = model;
     Deployer = deployer;
 }
Beispiel #28
0
 public HookController(IDeployer deployer)
 {
     _deployer = deployer;
 }
Beispiel #29
0
 public DoJob(IDeployer deployer)
 {
     this.InitializeComponent();
     this._deployer = deployer;
 }