public DeployPackage ( string package ) : void | ||
package | string | |
Résultat | void |
public void Deploy_XCopy_Package_Test() { System.Environment.CurrentDirectory = "samples".MapVcsRoot(); MsBuild("PowerDeploy.Sample.XCopy\\PowerDeploy.Sample.XCopy.csproj /t:clean,build /p:RunOctoPack=true /p:OctoPackPackageVersion=1.3.3.7 /p:Configuration=Release /v:m"); var environmentMock = new Mock <IEnvironmentProvider>(); environmentMock.Setup(prov => prov.GetEnvironment(It.IsAny <string>())).Returns(GetUnitEnvironment); var outputPath = FileSystem.CreateTempWorkingDir(); var target = new PackageManager(environmentMock.Object); target.ConfigurePackageByEnvironment(@"PowerDeploy.Sample.XCopy\obj\octopacked\PowerDeploy.Sample.XCopy.1.3.3.7.nupkg", "Unit", outputPath); target.DeployPackage(Path.Combine(outputPath, "PowerDeploy.Sample.XCopy_v1.3.3.7_UNIT.nupkg")); }
public TriggerDeploymentResponse Post(TriggerDeployment request) { using (var session = DocumentStore.OpenSession()) { var environment = session.Query<Environment>().FirstOrDefault(e => e.Name == request.Environment); if (environment == null) { throw HttpError.NotFound("Environment {0} not found.".Fmt(request.Environment)); } var deploymentInfo = new Deployment() { EnvironmentId = "environments/" + environment.Id, RequestedAt = DateTime.UtcNow, }; var packageInfo = session.Load<Package>("packages/{0}/{1}".Fmt(request.PackageId, request.Version)); deploymentInfo.Package = packageInfo; deploymentInfo.Status = DeployStatus.Deploying; session.Store(deploymentInfo); session.SaveChanges(); using (var workspace = new Workspace(FileSystem, ServerSettings)) { var neutralPackagePath = PackageDownloader.Downloaad(request.PackageId, request.Version, workspace.TempWorkDir); workspace.UpdateSources(); var packageManager = new PackageManager(workspace.EnviornmentPath); var configuredPackage = packageManager.ConfigurePackageByEnvironment(neutralPackagePath, request.Environment, workspace.TempWorkDir); packageManager.DeployPackage(configuredPackage); deploymentInfo.FinishedAt = DateTime.UtcNow; deploymentInfo.Status = DeployStatus.Successful; session.SaveChanges(); return new TriggerDeploymentResponse(); } } }
public void Deploy_XCopy_Package_Test() { System.Environment.CurrentDirectory = "samples".MapVcsRoot(); MsBuild("PowerDeploy.Sample.XCopy\\PowerDeploy.Sample.XCopy.csproj /t:clean,build /p:RunOctoPack=true /p:OctoPackPackageVersion=1.3.3.7 /p:Configuration=Release /v:m"); var environmentMock = new Mock<IEnvironmentProvider>(); environmentMock.Setup(prov => prov.GetEnvironment(It.IsAny<string>())).Returns(GetUnitEnvironment); var outputPath = FileSystem.CreateTempWorkingDir(); var target = new PackageManager(environmentMock.Object); target.ConfigurePackageByEnvironment(@"PowerDeploy.Sample.XCopy\obj\octopacked\PowerDeploy.Sample.XCopy.1.3.3.7.nupkg", "Unit", outputPath); target.DeployPackage(Path.Combine(outputPath, "PowerDeploy.Sample.XCopy_v1.3.3.7_UNIT.nupkg")); }