Пример #1
0
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var repo = deployitServer.RepositoryService;
            var deploymentService = deployitServer.DeploymentService;

            string environmentId = string.Format("/Environments/{0}", EnvironmentName);
            string deploymentId  = string.Format("/Environments/{0}/{1}", EnvironmentName, ApplicationName);

            Deployment d;
            var        deployedExists = repo.Exists(deploymentId);

            if (!deployedExists)
            {
                d = deploymentService.PrepareInitial(VersionId, environmentId);
                d = deploymentService.GenerateAllDeployed(d);
            }
            else
            {
                d = deploymentService.PrepareUpdate(VersionId, deploymentId);
            }

            d = deploymentService.Validate(d);


            string taskId = deploymentService.GenerateDeploymentTask(d);

            TaskId = taskId;

            return(true);
        }
Пример #2
0
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var taskService = deployitServer.TaskService;

            switch (Action.ToLowerInvariant())
            {
            case "start":
                taskService.Start(TaskId);
                break;

            case "stop":
                taskService.Stop(TaskId);
                break;

            case "abort":
                taskService.Stop(TaskId);
                break;

            case "cancel":
                taskService.Cancel(TaskId);
                break;

            case "archive":
                taskService.Archive(TaskId);
                break;

            default:
                Log.LogError("unknown task action: {0}", Action);
                return(false);
            }
            return(true);
        }
Пример #3
0
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var taskService = deployitServer.TaskService;

            switch (Action.ToLowerInvariant())
            {
                case "start":
                    taskService.Start(TaskId);
                    break;
                case "stop":
                    taskService.Stop(TaskId);
                    break;
                case "abort":
                    taskService.Stop(TaskId);
                    break;
                case "cancel":
                    taskService.Cancel(TaskId);
                    break;
                case "archive":
                    taskService.Archive(TaskId);
                    break;
                default:
                    Log.LogError("unknown task action: {0}", Action);
                    return false;

            }
            return true;
        }
Пример #4
0
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var id = deployitServer.PackageService.Upload(PackagePath, Path.GetFileName(PackagePath));

            PackageId = id;
            return(true);
        }
        public override bool Execute()
        {
            string errorMessage;
            var    server           = new DeployitServer();
            var    connectionStatus = server.Connect(new Uri(DeployitURL), new NetworkCredential(Username, Password), out errorMessage, CheckConnection);

            if (connectionStatus != ConnectionStatus.Connected)
            {
                Log.LogError("Connection failed to DeployIt: {0}", errorMessage);
                return(false);
            }
            try
            {
                return(ExecuteCore(server));
            }
            catch (Exception ex)
            {
                Log.LogErrorFromException(ex);
                return(false);
            }
            finally
            {
                server.Disconnect();
            }
        }
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var repo = deployitServer.RepositoryService;
            var deploymentService = deployitServer.DeploymentService;

            string environmentId = string.Format("/Environments/{0}", EnvironmentName);
            string deploymentId = string.Format("/Environments/{0}/{1}", EnvironmentName, ApplicationName);

            Deployment d;
            var deployedExists = repo.Exists(deploymentId);

            if (!deployedExists)
            {
                d = deploymentService.PrepareInitial(VersionId, environmentId);
                d = deploymentService.GenerateAllDeployed(d);
            }
            else
            {
                d = deploymentService.PrepareUpdate(VersionId, deploymentId);
            }

            d = deploymentService.Validate(d);

            string taskId = deploymentService.GenerateDeploymentTask(d);

            TaskId = taskId;

            return true;
        }
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var deploymentService = deployitServer.DeploymentService;

            string rollbackTaskId = deploymentService.GenerateRollbackTask(DeploymentTaskId);

            RollbackTaskId = rollbackTaskId;

            return(true);
        }
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var deploymentService = deployitServer.DeploymentService;

            string rollbackTaskId = deploymentService.GenerateRollbackTask(DeploymentTaskId);

            RollbackTaskId = rollbackTaskId;

            return true;
        }
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var    taskServer = deployitServer.TaskService;
            string taskState;

            do
            {
                Thread.Sleep(RefreshIntervalInSeconds * 1000);
                var info = taskServer.GetTaskInfo(TaskId);
                taskState = info.State;
                Log.LogMessage("Task '{0}' state: '{1}'", TaskId, taskState);
            }while (taskState == "QUEUED" || taskState == "EXECUTING");

            FinalState = taskState;
            return(true);
        }
Пример #10
0
        protected override bool ExecuteCore(DeployitServer deployitServer)
        {
            var taskServer = deployitServer.TaskService;
            string taskState;
            do
            {
                Thread.Sleep(RefreshIntervalInSeconds * 1000);
                var info = taskServer.GetTaskInfo(TaskId);
                taskState = info.State;
                Log.LogMessage("Task '{0}' state: '{1}'", TaskId, taskState);

            }
            while (taskState == "QUEUED" || taskState == "EXECUTING");

            FinalState = taskState;
            return true;
        }
 public override bool Execute()
 {
     string errorMessage;
     var server = new DeployitServer();
     var connectionStatus = server.Connect(new Uri(DeployitURL), new NetworkCredential(Username, Password), out errorMessage, CheckConnection);
     if (connectionStatus != ConnectionStatus.Connected)
     {
         Log.LogError("Connection failed to DeployIt: {0}", errorMessage);
         return false;
     }
     try
     {
         return ExecuteCore(server);
     }
     catch (Exception ex)
     {
         Log.LogErrorFromException(ex);
         return false;
     }
     finally
     {
         server.Disconnect();
     }
 }
 protected abstract bool ExecuteCore(DeployitServer deployitServer);
 public TaskService(DeployitServer server)
     : base(server,"task")
 {
 }
 public PackageService(DeployitServer server)
     : base(server,"package")
 {
 }
 protected abstract bool ExecuteCore(DeployitServer deployitServer);
 public DeploymentService(DeployitServer server)
     : base(server, "deployment")
 {
 }
 public MetadataService(DeployitServer server) : base(server, "metadata")
 {
 }
		public RepositoryService(DeployitServer server)
			: base(server,"repository")
		{
		}