Beispiel #1
0
        public TaskResult RunTask(DeploymentContext deploymentContext)
        {
            string profileFile = deploymentContext.TaskParameters.GetValue <PublishProjectToFolder>("projectFile");

            string projectFilePath    = Path.Combine(deploymentContext.GitDirectory, profileFile);
            string buildConfiguration = deploymentContext.TaskParameters.GetValue <PublishProjectToFolder>("buildConfiguration");

            MsBuildRunner msBuildRunner = new MsBuildRunner(deploymentContext.CurrentLogger);

            const string task    = "Build;PipelinePreDeployCopyAllFilesToOneFolder";
            bool         success = msBuildRunner.StartMsDeployProcess(projectFilePath, task, "Configuration=" + buildConfiguration);

            if (!success)
            {
                return(TaskResult.CreateTotalFailureResult("Cannot publish to folder."));
            }


            string containingFolder = Path.GetDirectoryName(projectFilePath);
            string packageFolder    = Path.Combine(containingFolder, "obj", buildConfiguration, @"Package\PackageTmp");

            deploymentContext.DeploymentArtifacts.AddArtifact("DeployPackageFolder", packageFolder);

            return(TaskResult.CreateSuccessfulResult());
        }
        public TaskResult RunTask(DeploymentContext deploymentContext)
        {
            string configValue = "configuration=\"" + deploymentContext.Branch + "\"";
            string wwwDir      = "WWWPath=\"" + deploymentContext.GitDirectory + @"\www""";

            MsBuildRunner msBuildRunner = new MsBuildRunner(deploymentContext.CurrentLogger);
            bool          success       = msBuildRunner.StartMsDeployProcess("TransformWebConfig.build", "TransformWebConfig", configValue, wwwDir);

            if (!success)
            {
                return(TaskResult.CreateErrorResult("msbuild did not complete successfully."));
            }

            return(TaskResult.CreateSuccessfulResult());
        }
        public TaskResult RunTask(DeploymentContext deploymentContext)
        {
            string solutionFile = deploymentContext.TaskParameters.GetValue <RunPublishProfile>("solutionFile");
            string solutionPath = Path.Combine(deploymentContext.GitDirectory, solutionFile);

            string publishProfile = deploymentContext.TaskParameters.GetValue <RunPublishProfile>("publishProfile");

            MsBuildRunner msBuildRunner = new MsBuildRunner(deploymentContext.CurrentLogger);
            bool          success       = msBuildRunner.StartMsDeployProcess(solutionPath, null, "DeployOnBuild=true", "PublishProfile=" + publishProfile);

            if (!success)
            {
                return(TaskResult.CreateTotalFailureResult("Cannot build publish profile."));
            }

            string packageFile = deploymentContext.TaskParameters.GetValue <RunPublishProfile>("packageFile");
            string packagePath = Path.Combine(deploymentContext.GitDirectory, packageFile);

            deploymentContext.DeploymentArtifacts.AddArtifact("DeployPackage", packagePath);

            return(TaskResult.CreateSuccessfulResult());
        }