コード例 #1
0
        public Task TestLegacyWarDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestLegacyWarDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                // Incremental deployment - NOT supported, will be ignored
                {
                    var files1 = DeploymentTestHelper.CreateRandomFilesForZip(10);
                    await DeployZippedArtifact(appManager, appManager.OneDeployManager, files1, "war", "webapps/ROOT", isAsync, isClean: false);

                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "ROOT", "ROOT2" }, "site/wwwroot/webapps");
                    var expectedFiles1 = files1.Select(file => file.Filename).ToList();
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, expectedFiles1.ToArray(), "site/wwwroot/webapps/ROOT");
                }

                // Default deployment - clean
                {
                    var files1 = DeploymentTestHelper.CreateRandomFilesForZip(10);
                    await DeployZippedArtifact(appManager, appManager.OneDeployManager, files1, "war", "webapps/ROOT2", isAsync);

                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "ROOT", "ROOT2" }, "site/wwwroot/webapps");
                    var expectedFiles1 = files1.Select(file => file.Filename).ToList();
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, expectedFiles1.ToArray(), "site/wwwroot/webapps/ROOT2");
                }
            }));
        }
コード例 #2
0
        public Task TestLibDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestLibDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                // Default deployment - incremental
                {
                    await DeployNonZippedArtifact(appManager, "lib", "library1.jar", isAsync, null, "site/libs/library1.jar");
                    await DeployNonZippedArtifact(appManager, "lib", "library2.jar", isAsync, null, "site/libs/library2.jar");
                    await DeployNonZippedArtifact(appManager, "lib", "dir1/dir2/library3.jar", isAsync, null, "site/libs/dir1/dir2/library3.jar");
                    await DeployNonZippedArtifact(appManager, "lib", "dir1/dir2/library4.jar", isAsync, null, "site/libs/dir1/dir2/library4.jar");

                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "library1.jar", "library2.jar", "dir1" }, "site/libs");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "library3.jar", "library4.jar" }, "site/libs/dir1/dir2");
                }

                // Clean deployment
                {
                    await DeployNonZippedArtifact(appManager, "lib", "dir/library.jar", isAsync, true, "site/libs/dir/library.jar");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "dir" }, "site/libs");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "library.jar" }, "site/libs/dir");

                    await DeployNonZippedArtifact(appManager, "lib", "library.jar", isAsync, true, "site/libs/library.jar");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "library.jar" }, "site/libs");
                }
            }));
        }
コード例 #3
0
        public Task TestStaticFileDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestStaticFileDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                // Default deployment - incremental
                {
                    await DeployNonZippedArtifact(appManager, "static", "a.txt", isAsync, false, "site/wwwroot/a.txt");
                    await DeployNonZippedArtifact(appManager, "static", "b.txt", isAsync, false, "site/wwwroot/b.txt");
                    await DeployNonZippedArtifact(appManager, "static", "dir1/dir1a.txt", isAsync, false, "site/wwwroot/dir1/dir1a.txt");
                    await DeployNonZippedArtifact(appManager, "static", "dir1/dir1b.txt", isAsync, false, "site/wwwroot/dir1/dir1b.txt");

                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "webapps", "a.txt", "b.txt", "dir1", "hostingstart.html" }, "site/wwwroot");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "dir1a.txt", "dir1b.txt" }, "site/wwwroot/dir1");
                }

                // Clean deployment
                {
                    await DeployNonZippedArtifact(appManager, "static", "dir2/dir2a.txt", isAsync, true, "site/wwwroot/dir2/dir2a.txt");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "dir2" }, "site/wwwroot");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "dir2a.txt" }, "site/wwwroot/dir2");

                    await DeployNonZippedArtifact(appManager, "static", "c.txt", isAsync, true, "site/wwwroot/c.txt");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "c.txt", }, "site/wwwroot");
                }
            }));
        }
コード例 #4
0
        public Task TestScriptDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestScriptDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                // Default deployment - incremental
                {
                    await DeployNonZippedArtifact(appManager, "script", "script1.txt", isAsync, null, "site/scripts/script1.txt");
                    await DeployNonZippedArtifact(appManager, "script", "dir1/script2.txt", isAsync, null, "site/scripts/dir1/script2.txt");

                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "dir1", "script1.txt" }, "site/scripts");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "script2.txt" }, "site/scripts/dir1");
                }

                // Clean deployment
                {
                    await DeployNonZippedArtifact(appManager, "script", "dir/script2.txt", isAsync, true, "site/scripts/dir/script2.txt");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "dir" }, "site/scripts");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "script2.txt" }, "site/scripts/dir");

                    await DeployNonZippedArtifact(appManager, "script", "script2.txt", isAsync, true, "site/scripts/script2.txt");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "script2.txt" }, "site/scripts");
                }
            }));
        }
コード例 #5
0
        public Task TestAppDotEarDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestAppDotEarDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                // Default deployment mode - overwrite app.ear
                {
                    await DeployNonZippedArtifact(appManager, "ear", null, isAsync, null, "site/wwwroot/app.ear");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { initialFileName, "webapps", "hostingstart.html", "app.ear" }, "site/wwwroot");
                }

                // Clean Deployment
                {
                    await DeployNonZippedArtifact(appManager, "ear", null, isAsync, true, "site/wwwroot/app.ear");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { "app.ear" }, "site/wwwroot");
                }
            }));
        }
コード例 #6
0
        public Task TestStartupFileDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestStartupFileDeployment", async appManager =>
            {
                var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);
                var startupFileName = KuduUtils.RunningAgainstLinuxKudu ? "startup.sh" : "startup.cmd";

                // Default deployment mode - overwrite previous startup file
                {
                    await DeployNonZippedArtifact(appManager, "startup", "invalid/path/to/test/that/it/is/ignored", isAsync, true, $"site/scripts/{startupFileName}");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { startupFileName }, "site/scripts");
                }

                // Clean deployment
                {
                    await DeployNonZippedArtifact(appManager, "startup", "invalid/path/to/test/that/it/is/ignored", isAsync, true, $"site/scripts/{startupFileName}");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string[] { startupFileName }, "site/scripts");
                }
            }));
        }
コード例 #7
0
        public Task TestZipDeployment(bool isAsync)
        {
            return(ApplicationManager.RunAsync("TestZipDeployment", async appManager =>
            {
                // Incremental deployment - not the default mode
                {
                    var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                    var files1 = DeploymentTestHelper.CreateRandomFilesForZip(10);
                    await DeployZippedArtifact(appManager, appManager.OneDeployManager, files1, "zip", null, isAsync, isClean: false);
                    var expectedFiles1 = files1.Select(f => f.Filename).ToList();
                    expectedFiles1.Add(initialFileName);
                    expectedFiles1.Add("webapps");
                    expectedFiles1.Add("hostingstart.html");
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, expectedFiles1.ToArray(), "site/wwwroot");
                }

                // Default deployment - clean
                {
                    var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                    var files1 = DeploymentTestHelper.CreateRandomFilesForZip(10);
                    await DeployZippedArtifact(appManager, appManager.OneDeployManager, files1, "zip", null, isAsync);
                    var expectedFiles1 = files1.Select(f => f.Filename).ToList();
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, expectedFiles1.ToArray(), "site/wwwroot");
                }

                // Custom path
                {
                    var initialFileName = DeploymentTestHelper.DeployRandomFilesEverywhere(appManager);

                    var files1 = DeploymentTestHelper.CreateRandomFilesForZip(10);
                    await DeployZippedArtifact(appManager, appManager.OneDeployManager, files1, "zip", "dir1/dir2", isAsync);
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, new string [] { "dir1" }, "site/wwwroot");
                    var expectedFiles1 = files1.Select(f => f.Filename).ToList();
                    await DeploymentTestHelper.AssertSuccessfulDeploymentByFilenames(appManager, expectedFiles1.ToArray(), "site/wwwroot/dir1/dir2");
                }
            }));
        }