Ejemplo n.º 1
0
        public QuickDeploy(DeploymentTarget target, DeploymentTargetPortal targetPortal, UIWorkItem workItem)
        {
            _workItem = workItem;
            _target = target;
            _targetPortal = targetPortal;

            var projectContext = ApplicationContext.Current.Services.Get<IProjectContextService>(true);
            var portalModel = projectContext.ActiveProject.Models.Get<PortalModel>();
            Guid portalId = new Guid(_targetPortal.InstanceId);
            _portal = portalModel.PortalApplications.FirstOrDefault(portal => portal.Id == portalId);
            if (_portal == null)
                throw new Exception(string.Format("Could not find portal application by Id: {0}", portalId));

            _worker = new BackgroundWorker();
            _worker.WorkerReportsProgress = true;
            _worker.DoWork += (sender, e) => InternalDeploy();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Configures the deployment 
        /// </summary>
        /// <param name="deployment"></param>
        /// <param name="portalInstanceId"></param>
        private void InitializeDeployment(Sage.Platform.Deployment.Deployment deployment, string portalInstanceId)
        {
            // Configure the portal
            var portal = new DeploymentTargetPortal
            {
                PortalName = Manifest.PortalName,
                IsActive = true,
                InstanceId = portalInstanceId
            };

            // Configure the target
            var target = new Sage.Platform.Deployment.DeploymentTarget("FS")
            {
                IsActive = true
            };

            target.ExtendedProperties.SetValue(DeploymentTargetConstants.DeploymentPath, Manifest.DeploymentPath);
            target.Portals.Add(portal);
            deployment.Targets.Add(target);
        }