예제 #1
0
        public bool Deploy(DeployUserSelection deployUserSelection)
        {
            _logInfo(deployUserSelection.DeployProject.Name + "...");
            var gitProjectInfo = _userOptions.GetProjectInfo(deployUserSelection.DeployProject.WorkingDirectory);
            if (gitProjectInfo != null)
            {
                var gitProject = CurrentGitProjectList.GetOrAddProject(gitProjectInfo, _userOptions);
                if (gitProject == null) return false;

                if (deployUserSelection.SwitchToBranch)
                {
                    _logInfo(deployUserSelection.DeployProject.Name + ": switching to " + deployUserSelection.BranchName + "...");
                    gitProject.SmartSwitch(deployUserSelection.BranchName, deployUserSelection.UpdateSubmodules);
                }
            }

            var deployArguments = deployUserSelection.GetDeployArguments();
            var deployer = new Deployer(deployArguments);
            _logInfo("Deploying " + deployArguments.WorkingDirectory + " to server " + deployArguments.ServerName + "...");
            _logInfo(deployUserSelection.DeployProject.Name + " deployment...");
            deployer.Deploy();
            return deployer.DeployResult;
        }