示例#1
0
        public static void RouteToController(ResourceCache resourceCache, InstallationTicket ticket)
        {
            var installer = resourceCache.Controller as IInstallationController;

            if (installer != null)
            {
                var message = string.Format("Installing from PackageAddress: {0}  to Resource: {1}, to Node: {2}, ticketId: {3}",
                                            ticket.StorageAddress, resourceCache.Resource.ResourceName, ticket.NodeName, ticket.Id);
                Common.Utility.LogInfo(message);

                var installationManager = InstallationFactory.GetInstance().GetInstallationManager();
                installationManager.InstallByTicket(resourceCache.Resource, ticket, installer);
                return;
            }

            throw new InvalidDataException(string.Format("ResourceController for Resource: {0} doesn't support installation. TicketId: {1}", resourceCache.Resource.ResourceName, ticket.Id));
        }
示例#2
0
        public void InstallByTicket(InstallationTicket ticket, ResourceNode node, string localAddress)
        {
            var fileName = Path.GetFileName(localAddress);
                   var fileNameWithoutExtension = Path.GetFileNameWithoutExtension(localAddress);
                   var remotePath = Path.Combine(ticket.FolderToInstall, fileName).Replace('\\','/');
                   this.UploadFile(node, remotePath, localAddress);

                   string result = SshExec(node,
                       string.Format(SshInstallationCommand.InstallUploadedPackage, remotePath, ticket.FolderToInstall, fileNameWithoutExtension));
        }
        public void InstallPackage(InstallationTicket ticket)
        {
            Common.Utility.ExceptionablePlaceWrapper(() =>
            {
                var resource = ResourceCache.GetByName(ticket.ResourceName);

                InstallationUtility.RouteToController(resource, ticket);

            }, "Error at installation start. TicketId: " + ticket.Id,"Installation start was successful. TicketId: " + ticket.Id);
        }
 public void InstallByTicket(InstallationTicket ticket, ResourceNode node, string localAddress)
 {
     var installer = new WindowsInstallerImpl(this.UploadFile);
     installer.InstallByTicket(ticket, node, localAddress);
 }
示例#5
0
 public void InstallByTicket(InstallationTicket ticket, ResourceNode node, string localAddress)
 {
     //var installer = new WindowsInstallerImpl();
 }