Exemplo n.º 1
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var buildVersion = context.CreateTarget("buildVersion")
                               .SetAsHidden()
                               .SetDescription("Fetches flubu version from FlubuCore.ProjectVersion.txt file.")
                               .AddTask(x => x.FetchBuildVersionFromFileTask());

            var compile = context.CreateTarget("Compile")
                          .AddCoreTask(x => x.UpdateNetCoreVersionTask("FlubuCore.Diff/FlubuCore.Diff.csproj"))
                          .AddCoreTask(x => x.Build())
                          .DependsOn(buildVersion);

            var publishNuget = context.CreateTarget("Publish.Nuget")
                               .AddCoreTask(x => x.Pack()
                                            .Project("FlubuCore.Diff/FlubuCore.Diff.csproj")
                                            .IncludeSource()
                                            .NoBuild())
                               .AddCoreTask(x => x.NugetPush("FlubuCore.Diff/bin/release/FlubuCore.Diff.1.0.1.Nupkg")
                                            .WithArguments("-s", "https://www.nuget.org/api/v2/package")
                                            .WithArguments("-k", NugetKey)
                                            .DoNotFailOnError());

            context.CreateTarget("Rebuild")
            .SetAsDefault()
            .DependsOn(compile, publishNuget);
        }
Exemplo n.º 2
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var clean = context.CreateTarget("Clean")
                        .SetDescription("Clean's the solution")
                        .AddCoreTask(x => x.Clean());

            var restore = context.CreateTarget("Restore")
                          .SetDescription("Restore's the solution")
                          .DependsOn(clean)
                          .AddCoreTask(x => x.Restore());

            var build = context.CreateTarget("Build")
                        .SetDescription("Build's the solution")
                        .DependsOn(restore)
                        .AddCoreTask(x => x.Build());

            var projectsToPack = context.GetFiles(SourceDir, "*/*.csproj");

            var pack = context.CreateTarget("Pack")
                       .SetDescription("Packs and publishes nuget package.")
                       .DependsOn(build)
                       .ForEach(projectsToPack, (project, target) =>
            {
                target.AddCoreTask(x => x.Pack()
                                   .Project(project)
                                   .NoBuild()
                                   .OutputDirectory(OutputDir));
            });


            context.CreateTarget("Default")
            .SetDescription("Runs all targets.")
            .SetAsDefault()
            .DependsOn(clean, restore, build, pack);
        }
Exemplo n.º 3
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var buildVersion = context.CreateTarget("buildVersion")
                               .SetAsHidden()
                               .SetDescription("Fetches flubu version from FlubuCore.Gitter.ProjectVersion.txt file.")
                               .AddTask(x => x.FetchBuildVersionFromFileTask());

            var compile = context.CreateTarget("Compile")
                          .AddCoreTask(x => x.Clean())
                          .AddCoreTask(x => x.UpdateNetCoreVersionTask("FlubuCore.Gitter/FlubuCore.Gitter.csproj"))
                          .AddCoreTask(x => x.Build())
                          .DependsOn(buildVersion);

            var nugetPublish = context.CreateTarget("Nuget.Publish")
                               .DependsOn(compile)
                               .AddCoreTask(x => x.Pack().Project("FlubuCore.Gitter")
                                            .NoBuild()
                                            .IncludeSymbols()
                                            .OutputDirectory("../output"))
                               .Do(PublishNuGetPackage);

            context.CreateTarget("Rebuild")
            .SetAsDefault()
            .DependsOn(compile, nugetPublish);
        }
Exemplo n.º 4
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            session.CreateTarget("deploy.local").AddTasks(Deploy, "c:\\ExamplaApp").SetAsDefault();

            session.CreateTarget("deploy.test").AddTasks(Deploy, "d:\\ExamplaApp");

            session.CreateTarget("deploy.prod").AddTasks(Deploy, "e:\\ExamplaApp");
        }
Exemplo n.º 5
0
        /// <summary>
        /// Before you can deploy you have to run 'Rebuild' target in BuildScript.cs first so that the deployment package is created.
        /// </summary>
        /// <param name="context"></param>
        protected override void ConfigureTargets(ITaskContext context)
        {
            context.CreateTarget("deployTest")
            .AddTasks(Deploy, @"C:\WindowsService\Service", $"C:\\WindowsService\\Backup\\WindowsService_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip");

            context.CreateTarget("deployProduction")
            .AddTasks(Deploy, @"D:\WindowsService\Service", $"D:\\WindowsService\\Backup\\WindowsService_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip");
        }
Exemplo n.º 6
0
    protected override void ConfigureTargets(ITaskContext context)
    {
        context.CreateTarget("FlubuPlugin.Example")
        .SetAsDefault()
        .Do(DoPluginExample);

        context.CreateTarget("FlubuPlugin.Example2")
        .AddTask(x => x.ExampleFlubuPluginTask());
    }
Exemplo n.º 7
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var clean = context.CreateTarget("Clean").AddCoreTask(x => x.Clean());

            context.CreateTarget("Build")
            .SetAsDefault()
            .AddCoreTask(x => x.Build())
            .DependsOn(clean);
        }
        protected override void ConfigureTargets(ITaskContext context)
        {
            var buildVersion = context.CreateTarget("build.version")
                               .SetAsHidden()
                               .AddTask(x => x.FetchBuildVersionFromFileTask());

            var nuget = context.CreateTarget("nuget.restore")
                        .SetDescription("ReInstall Nuget Packages")
                        .AddCoreTask(x => x.Restore().Force());

            var clean = context.CreateTarget("clean")
                        .SetDescription("Clean Solution")
                        .DependsOn(buildVersion)
                        .AddCoreTask(x => x.Clean())
                        .AddTask(x => x.DeleteDirectoryTask(PackagesFolder, false));

            var debugBuild = context.CreateTarget("build.debug")
                             .SetDescription("Initiate a Debug Build")
                             .DependsOn(buildVersion)
                             .AddCoreTask(x => x.Build(SolutionFile).Configuration("Debug"));

            var releaseBuild = context.CreateTarget("build.release")
                               .SetDescription("Initiate a Release Build")
                               .DependsOn(buildVersion)
                               .AddCoreTask(x =>
                                            x.UpdateNetCoreVersionTask(
                                                "src/LoanStreet.LoanServicing/LoanStreet.LoanServicing.csproj")) //// Task get's version from context.Properties.Get<Version>(BuildProps.BuildVersion) and updates version in csproj
                               .AddCoreTask(x => x.Restore())
                               .AddCoreTask(x => x.Build(SolutionFile).Configuration("Release"));


            var package = context.CreateTarget("nuget.package")
                          .SetDescription("Assemble Nuget Package")
                          .DependsOn(releaseBuild)
                          .AddCoreTask(x => x
                                       .Pack()
                                       .Project(ClientProject)
                                       .Configuration("Release")
                                       .OutputDirectory(PackagesFolder)
                                       );


            var nugetPush = context.CreateTarget("nuget.publish")
                            .SetDescription("Publishes nuget package.")
                            .Do(NugetPublish)
                            .DependsOn(package);

            var generatedTests = context.CreateTarget("run.tests")
                                 .SetDescription("Execute Generated Unit Tests")
                                 .DependsOn(debugBuild)
                                 .AddCoreTask(x => x.Test().Project(TestProject));

            var exampleTests = context.CreateTarget("run.examples")
                               .SetDescription("Execute the Example Tests")
                               .DependsOn(debugBuild)
                               .AddCoreTask(x => x.Test().Project(ExamplesProject));
        }
Exemplo n.º 9
0
    protected override void ConfigureTargets(ITaskContext context)
    {
        context.CreateTarget("Fetch.FlubuCore.Version")
        .Do(UpdateFlubuCoreNugetPackageToLatest);

        var compile = context
                      .CreateTarget("compile")
                      .SetDescription("Compiles the VS solution")
                      .AddCoreTask(x => x.ExecuteDotnetTask("restore").WithArguments("FlubuExample.sln"))
                      .AddCoreTask(x => x.Build().Version(BuildVersion.Version.ToString(4)));

        var package = context
                      .CreateTarget("Package")
                      .AddCoreTask(x => x.Publish("FlubuExample"))
                      .AddCoreTask(x => x.CreateZipPackageFromProjects("FlubuExample", "netstandard2.0", "FlubuExample"));

        //// Can be used instead of CreateZipPackageFromProject. See MVC_NET4.61 project for full example of PackageTask
        //// context.CreateTarget("Package2").AddTask(x => x.PackageTask("FlubuExample"));

        var test = context.CreateTarget("test")
                   .AddCoreTaskAsync(x => x.Test().Project("FlubuExample.Tests"))
                   .AddCoreTaskAsync(x => x.Test().Project("FlubuExample.Tests2"));

        var doExample  = context.CreateTarget("DoExample").Do(DoExample);
        var doExample2 = context.CreateTarget("DoExample2").Do(DoExample2);

        context.CreateTarget("iis.install").Do(IisInstall);

        //// todo include package into rebuild.
        context.CreateTarget("Rebuild")
        .SetAsDefault()
        .DependsOnAsync(doExample, doExample2)
        .DependsOn(compile, test, package);
    }
Exemplo n.º 10
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            ITarget test = session.CreateTarget("test")
                           .AddTask(s => s.CopyFileTask("t1", "t2", false));

            ITarget test1 = session.CreateTarget("test1")
                            .DependsOn(test);

            var restore = session
                          .CreateTarget("restore")
                          .AddCoreTask(s => s.Restore());

            var init = session
                       .CreateTarget("init")
                       .AddTask(s => s.FetchBuildVersionFromFileTask())
                       .AddTask(s => s.FetchVersionFromExternalSourceTask())
                       .AddCoreTask(s => s.UpdateNetCoreVersionTask("a"));

            var package = session
                          .CreateTarget("package")
                          .DependsOn(init, restore);

            session.CreateTarget("Linux")
            .AddCoreTask(x => x.LinuxTasks().SystemCtlTask("a", "b"))
            .AddCoreTask(x => x.LinuxTasks().SystemCtlTask("a", "b"));

            session.CreateTarget("IIS")
            .AddTask(x => x.IisTasks().CreateWebsiteTask())
            .AddTask(x => x.IisTasks().DeleteAppPoolTask("test"));

            session.CreateTarget("Do").Do(DoExample, "test");
        }
Exemplo n.º 11
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            session.CreateTarget("SuccesfullTarget").Do(SuccesfullTarget, "f",
                                                        doOptions: x => x.ForMember(m => m.Param, "FileName"));
            session.CreateTarget("FailedTarget").Do(FailedTarget);

            session.CreateTarget("FinallyTarget")
            .Group(target =>
            {
                target.AddTask(x => x.DeleteDirectoryTask("fakeDir", false));
            },
                   onFinally: c =>
            {
                File.Create("Finally.txt");
            });

            session.CreateTarget("OnErrorTarget")
            .Group(target =>
            {
                target.Do(FailedTarget);
            },
                   onFinally: c =>
            {
                File.Create("Finally.txt");
            },
                   onError: (c, e) =>
            {
                File.Create("OnError.txt");
            });

            session.CreateTarget("WhenTarget")
            .Do(SuccesfullTarget, "file2.txt")
            .Group(
                target =>
            {
                target.Do(SuccesfullTarget, "file.txt");
            },
                when: c => { return(false); })
            .Group(target =>
            {
                target.Do(SuccesfullTarget, "file3.txt");
            },
                   when: c => { return(true); });

            Mock <ITaskContext>         context = new Mock <ITaskContext>();
            Mock <ITaskFluentInterface> tf      = new Mock <ITaskFluentInterface>();

            context.Setup(x => x.Tasks()).Returns(tf.Object);
        }
Exemplo n.º 12
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var clean = context.CreateTarget("Clean")
                        .SetDescription("Clean's the solution.")
                        .AddCoreTask(x => x.Clean()
                                     .AddDirectoryToClean(OutputDir, true));

            var restore = context.CreateTarget("Restore")
                          .SetDescription("Restore's nuget packages in all projects.")
                          .AddCoreTask(x => x.Restore());


            //// UpdateNetCoreVersionTask updates NetCoreOpenSource project version. Version is fetched from flubu session.
            //// Alternatively you can set version in Build task through build task fluent interface.
            var build = context.CreateTarget("Build")
                        .SetDescription("Build's the solution.")
                        .DependsOn(clean)
                        .DependsOnAsync(restore)
                        .AddCoreTask(x => x.UpdateNetCoreVersionTask("NetCoreOpenSource/NetCoreOpenSource.csproj"))
                        .AddCoreTask(x => x.Build()
                                     .Version(BuildVersion.Version.ToString()));


            var tests = context.CreateTarget("Run.tests")
                        .SetDescription("Run's all test's in the solution")
                        .AddCoreTask(x => x.Test()
                                     .Project("NetCoreOpenSource.Tests")
                                     .NoBuild());

            var pack = context.CreateTarget("Pack")
                       .SetDescription("Prepare's nuget package.")
                       .AddCoreTask(x => x.Pack()
                                    .NoBuild()
                                    .OutputDirectory(OutputDir));

            var branch = context.BuildSystems().Travis().BranchName;

            //// Examine travis.yaml to see how to pass api key from travis to FlubuCore build script.
            var nugetPush = context.CreateTarget("Nuget.publish")
                            .SetDescription("Publishes nuget package.")
                            .DependsOn(pack)
                            .AddCoreTask(x => x.NugetPush($"{OutputDir}/NetCoreOpenSource.nupkg")
                                         .ServerUrl("https://www.nuget.org/api/v2/package")
                                         .ApiKey(NugetApiKey)
                                         )
                            .When((c) => c.BuildSystems().RunningOn == BuildSystemType.TravisCI &&
                                  !string.IsNullOrEmpty(branch) &&
                                  branch.EndsWith("stable", StringComparison.OrdinalIgnoreCase));


            var rebuild = context.CreateTarget("Rebuild")
                          .SetDescription("Builds the solution and runs all tests.")
                          .SetAsDefault()
                          .DependsOn(build, tests);

            context.CreateTarget("Rebuild.Server")
            .SetDescription("Builds the solution, runs all tests and publishes nuget package.")
            .DependsOn(rebuild, nugetPush);
        }
Exemplo n.º 13
0
    protected override void ConfigureTargets(ITaskContext context)
    {
        context.CreateTarget("Fetch.FlubuCore.Version")
        .Do(UpdateFlubuCoreNugetPackageToLatest);

        context
        .CreateTarget("rebuild")
        .SetAsDefault()
        .SetDescription("Rebuilds the solution")
        .CoreTaskExtensions()
        .DotnetRestore(x => x.WithArguments("FlubuExample"))
        .DotnetBuild("FlubuExample")
        .DotnetPublish("FlubuExample")
        .CreateZipPackageFromProjects("FlubuExample", "netcoreapp1.0", "FlubuExample");
    }
Exemplo n.º 14
0
 protected override void ConfigureTargets(ITaskContext session)
 {
     session.CreateTarget("Deploy")
     .SetDescription("Deploys flubu web api")
     .SetAsDefault()
     .Do(DeployWebApi);
 }
Exemplo n.º 15
0
        } = "Release";                                              // Debug or Release

        protected override void ConfigureTargets(ITaskContext session)
        {
            var clean = session.CreateTarget("clean")
                        .SetDescription("Cleaning solution output folder.")
                        .AddCoreTask(x => x.Clean()
                                     .CleanOutputDir());

            var compile = session.CreateTarget("compile")
                          .SetDescription("編譯 solution。")
                          .AddCoreTask(x => x.Build());

            var publish = session.CreateTarget("pack")
                          .SetDescription("建立 NuGet 套件。")
                          .DependsOn(compile)
                          .AddCoreTask(x => x.Pack());
        }
Exemplo n.º 16
0
        /// <summary>
        /// Script takes already prepared deploy package. Normaly your build server would prepare the package.
        /// </summary>
        /// <param name="session"></param>
        protected override void ConfigureTargets(ITaskContext session)
        {
            session.CreateTarget("package")
            .AddTask(x => x.PackageTask("").AddDirectoryToPackage("WebApplication1\\Scripts", "ExampleApp\\Scripts", true)
                     .AddDirectoryToPackage("WebApplication1\\Views", "ExampleApp\\Views", true)
                     .AddDirectoryToPackage("WebApplication1\\Content", "ExampleApp\\Content", true)
                     .AddDirectoryToPackage("WebApplication1\\Bin", "ExampleApp\\Bin", true)
                     .AddDirectoryToPackage("WebApplication1", "ExampleApp", false, new NegativeFilter(new RegexFileFilter(@"^.*\.(svc|asax|config|js|html|ico|bat)$")))
                     .ZipPackage("ExampleApp.zip"));

            session.CreateTarget("deploy")
            .SetAsDefault()
            .AddTask(x => x.FlubuWebApiTasks().GetTokenTask("test", "test"))
            .AddTask(x => x.FlubuWebApiTasks().DeletePackagesTask())
            .AddTask(x => x.FlubuWebApiTasks().UploadPackageTask(".\\BuildScript\\ExamplePackages", "*.zip"))
            .AddTask(x => x.FlubuWebApiTasks().ExecuteScriptTask("deploy", "DeployScript.cs"));
        }
Exemplo n.º 17
0
 protected override void ConfigureTargets(ITaskContext context)
 {
     var compile = context.CreateTarget("compile")
                   .SetDescription("Compile the solution.")
                   .AddCoreTask(
         x => x.Build());
     //.Do(CopyAdditionalFiles);
 }
Exemplo n.º 18
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            session.CreateTarget("deploy")
            .AddTask(x =>
                     x.IisTasks().CreateAppPoolTask("Example app pool")
                     .Mode(CreateApplicationPoolMode.DoNothingIfExists))
            .AddTask(x =>
                     x.IisTasks().ControlAppPoolTask("Example app pool", ControlApplicationPoolAction.Stop)
                     .DoNotFailOnError())
            .Do(UnzipPackage)
            .AddTask(x => x.CopyDirectoryStructureTask(@"Packages\ExampleApp", @"C:\ExampleApp", true).Retry(20, 5000))
            .Do(CreateWebSite)
            .AddTask(x => x.IisTasks().ControlAppPoolTask("Example app pool", ControlApplicationPoolAction.Start));


            session.CreateTarget("deployTest3");
        }
Exemplo n.º 19
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var firstTarget = context.CreateTarget("FirstTarget").Do(t => { Console.WriteLine("display this to."); });

            var nested = context.CreateTarget("ShouldAlsoBeDisplayed").Do(t => { Console.WriteLine("Should also be displayed"); })
                         .SetAsHidden()
                         .DependsOn(firstTarget);

            var doExample = context.CreateTarget("DoExample")
                            .Do(t => { throw new Exception("error on purpose."); });

            var doExample2 = context.CreateTarget("DoExample2")
                             .DependsOn(nested)
                             .Do(t => { Console.WriteLine("from doExample2"); });

            var doExample3 = context.CreateTarget("DoExample3")
                             .Do(t => { Console.WriteLine("from doExample3"); });

            context.CreateTarget("Test")
            .SetAsDefault()
            .AddTask(t => t.Do(x => { Console.WriteLine("from Test"); }))
            .DependsOnAsync(doExample2, doExample)
            .DependsOn(doExample3);

            context.CreateTarget("Test2")
            .SetAsDefault()
            .AddTask(t => t.Do(x => { Console.WriteLine("from Test"); }));
        }
Exemplo n.º 20
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            if (Environment == "dev")
            {
                Version = $"{Version}-preview-" + DateTime.Now.ToString("MMddHHmm");
            }

            context.LogInfo("============================================");
            context.LogInfo($"NugetKey:{NugetKey} Version:{Version}");
            context.LogInfo("============================================");

            var clean = context.CreateTarget("Clean")
                        .SetDescription("Clean's the solution")
                        .AddCoreTask(x => x.Clean()
                                     .AddDirectoryToClean(OutputDir, true));

            var restore = context.CreateTarget("Restore")
                          .SetDescription("Restore's the solution")
                          .DependsOn(clean)
                          .AddCoreTask(x => x.Restore());


            var build = context.CreateTarget("Build")
                        .SetDescription("Build's the solution")
                        .DependsOn(restore)
                        .AddCoreTask(x => x.Build().Version(Version).FileVersion(Version).InformationalVersion(Version));

            var projectsToPack = context.GetFiles(SourceDir, "*/*.csproj");

            projectsToPack.AddRange(context.GetFiles("src/Storage", "*/*.csproj"));
            projectsToPack.AddRange(context.GetFiles("src/Diagnostics", "*/*.csproj")
                                    .Where(x => x.FileName.Contains("HttpReports.Diagnostic.AspNetCore") || x.FileName.Contains("HttpReports.Diagnostic.HttpClient")));


            var pack = context.CreateTarget("Pack")
                       .SetDescription("Packs and publishes nuget package.")
                       .DependsOn(build)
                       .ForEach(projectsToPack, (project, target) =>
            {
                target.AddCoreTask(x => x.Pack().PackageVersion(Version)
                                   .Project(project)
                                   .NoBuild()
                                   .OutputDirectory(OutputDir));
            });

            var push = context.CreateTarget("push")
                       .SetDescription("Publishes nuget package.")
                       .DependsOn(pack)
                       .Do(NugetPush);

            var push2 = context.CreateTarget("push2")
                        .SetDescription("Publishes nuget package.")
                        .DependsOn(pack)
                        .Do(NugetPush2);

            context.CreateTarget("Default")
            .SetDescription("Runs all targets.")
            .SetAsDefault()
            .DependsOn(clean, restore, build, pack, push, push2);
        }
Exemplo n.º 21
0
    protected override void ConfigureTargets(ITaskContext context)
    {
        context
        .CreateTarget("compile")
        .SetDescription("Compiles the VS solution.")
        .AddCoreTask(x => x.Restore())
        //// this is just example and in real scenario is recomended to set BuildConfiguration only through build properties as other tasks might use it.
        .AddCoreTask(x => x.Build().ForMember(y => y.Configuration("Debug"), "c"));     //// Debug is default value. If not set in enviroment variable, config or pass through from argument.

        //// run in cmd 'dotnet flubu -key2=5'
        context.CreateTarget("DoExample").SetAsDefault().Do(DoExample, "DefaultValue", 0, doOptions: o =>
        {
            o.SetTaskName("Do example with ForMember");
            o.SetDescription("Do task logs string and integer value.");
            o.ForMember(x => x.Param, "key1", "custom help");
            o.ForMember(x => x.Param2, "key2"); //// adds default help to target help. Run 'dotnet flubu DoExample help'
        });
    }
Exemplo n.º 22
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            ITargetFluentInterface test = session.CreateTarget("test")
                                          .AddTask(s => s.CopyFileTask("t1", "t2", false));

            ITargetFluentInterface test1 = session.CreateTarget("test1")
                                           .DependsOn(test);

            session.CreateTarget("extensions")
            .CoreTaskExtensions()
            .DotnetPublish("33")
            .CreateZipPackageFromProjects("aa", "netcoreapp1.1", "fdf");

            var restore = session
                          .CreateTarget("restore")
                          .AddCoreTask(s => s.Restore());

            var init = session
                       .CreateTarget("init")
                       .AddTask(s => s.FetchBuildVersionFromFileTask())
                       .AddTask(s => s.FetchVersionFromExternalSourceTask())
                       .AddCoreTask(s => s.UpdateNetCoreVersionTask("a"));

            var package = session
                          .CreateTarget("package")
                          .DependsOn(init, restore);

            session.CreateTarget("Linux")
            .AddCoreTask(x => x.LinuxTasks().SystemCtlTask("a", "b"))
            .AddCoreTask(x => x.LinuxTasks().SystemCtlTask("a", "b"));

            session.CreateTarget("IIS")
            .AddTask(x => x.IisTasks().CreateWebsiteTask())
            .AddTask(x => x.IisTasks().DeleteAppPoolTask("test"));

            session.CreateTarget("Do").Do(DoExample, "test");

            package
            .CoreTaskExtensions()
            .DotnetPublish("a", "b", "c")
            .CreateZipPackageFromProjects("8d", "netcoreapp1.1", "a", "b", "c", task =>
            {
                task.AddDirectoryToPackage("configuration", "configuration", true)
                .AddFileToPackage("DeployScript.cs", string.Empty)
                .AddFileToPackage("project.json", string.Empty)
                .AddFileToPackage("NuGet.config", string.Empty);
            });
        }
Exemplo n.º 23
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var build = context.CreateTarget("Build")
                        .SetDescription("Build's the solution.")
                        .AddCoreTask(x => x.Clean()
                                     .CleanOutputDir())
                        .AddCoreTask(x => x.Restore())
                        .AddCoreTask(x => x.Build());

            var runTests = context.CreateTarget("Run.Tests")
                           .SetDescription("Run's all EasyCaching tests.")
                           .AddTask(X => X.RunProgramTask("docker")
                                    .WithArguments("ps", "-a"))
                           .AddCoreTask(x => x.Test().Project(TestDir.CombineWith("EasyCaching.UnitTests/EasyCaching.UnitTests.csproj"))
                                        .NoBuild());

            var projectsToPack = context.GetFiles(SourceDir, "*/*.csproj");
            var nugetPublish   = context.CreateTarget("Nuget.Publish")
                                 .SetDescription("Packs and publishes nuget package.")
                                 .Requires(() => NugetApiKey)
                                 .ForEach(projectsToPack, (project, target) =>
            {
                target
                .AddCoreTask(x => x.Pack()
                             .Project(project)
                             .IncludeSymbols()
                             .OutputDirectory(OutputDir));
            })
                                 .Do(PublishNuGetPackage);

            var rebuild = context.CreateTarget("Rebuild")
                          .SetAsDefault()
                          .SetDescription("Build's the solution and run's all tests.")
                          .DependsOn(build, runTests);

            var branch = context.BuildSystems().AppVeyor().BranchName;

            context.CreateTarget("Rebuild.Server")
            .SetDescription("Build's the solution, run's all tests and publishes nuget package when running on Appveyor.")
            .DependsOn(rebuild)
            .DependsOn(nugetPublish)
            .When((c) => c.BuildSystems().RunningOn == BuildSystemType.AppVeyor && branch != null && branch.Equals("master", StringComparison.OrdinalIgnoreCase));
        }
Exemplo n.º 24
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var clean = context.CreateTarget("Clean")
                        .SetDescription("Cleans the output of all projects in the solution.")
                        .AddCoreTask(x => x.Clean()
                                     .AddDirectoryToClean(ArtifactsDir, true));

            var restore = context.CreateTarget("Restore")
                          .SetDescription("Restores the dependencies and tools of all projects in the solution.")
                          .DependsOn(clean)
                          .AddCoreTask(x => x.Restore());

            var justbuild = context.CreateTarget("JustBuild")
                            .SetDescription("Builds all projects in the solution.")
                            // .DependsOn(restore)
                            .AddCoreTask(x => x.Build()
                                         .InformationalVersion(BuildVersion.VersionWithSuffix()));

            var build = context.CreateTarget("Build")
                        .SetDescription("Builds all projects in the solution.")
                        .DependsOn(restore)
                        .AddCoreTask(x => x.Build()
                                     .InformationalVersion(BuildVersion.VersionWithSuffix()));

            var tests = context.CreateTarget("Tests")
                        .SetDescription("Runs all SoMall tests.")
                        .ForEach(TestProjectFiles,
                                 (projectFile, target) =>
            {
                target.AddCoreTask(x => x.Test()
                                   .Project(projectFile)
                                   .NoBuild());
            });

            var pack = context.CreateTarget("Pack")
                       .SetDescription("Creates nuget packages for SoMall.")
                       .ForEach(ProjectFiles, (projectFile, target) =>
            {
                target.AddCoreTask(x => x.Pack()
                                   .NoBuild()
                                   .Project(projectFile)
                                   //.IncludeSymbols()
                                   .VersionSuffix(BuildVersion.Suffix)
                                   .OutputDirectory(ArtifactsDir));
            });

            context.CreateTarget("Default")
            .SetDescription("Runs all targets.")
            .SetAsDefault()
            .DependsOn(
                clean,
                restore,
                build,
                //   tests,
                pack
                );
        }
Exemplo n.º 25
0
    protected override void ConfigureTargets(ITaskContext session)
    {
        var updateVersion = session.CreateTarget("update.version")
                            .Do(TargetFetchBuildVersion)
                            .SetAsHidden();

        var unitTest = session.CreateTarget("unit.tests")
                       .SetDescription("Runs unit tests")
                       .AddTask(x => x.NUnitTaskForNunitV3("FlubuExample.Tests"));

        var package = session.CreateTarget("Package")
                      .SetDescription("Packages mvc example for deployment")
                      .Do(TargetPackage);

        session.CreateTarget("Rebuild")
        .SetDescription("Rebuilds the solution.")
        .SetAsDefault()
        .DependsOn("compile")     //// compile is included as one of the default targets.
        .DependsOn(unitTest, package);
    }
Exemplo n.º 26
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            Console.WriteLine($"RootDirectory: {RootDirectory}");
            Console.WriteLine($"OutputDir: {OutputDir}");

            var target = session.CreateTarget("compile")
                         .SetDescription("Compile the solution.")
                         .AddCoreTask(x =>
                                      x.Build()
                                      .Output(OutputDir));
        }
Exemplo n.º 27
0
        protected override void ConfigureTargets(ITaskContext session)
        {
            // Add custom targets to build and dependencies to default target if needed.
            session.CreateTarget("rebuild")
            .SetDescription("Rebuilds the project.")
            .SetAsDefault()
            .DependsOn("compile");

            //////// fetch.build.version and compile are default Dotnet targets.
            ////session.GetTarget("fetch.build.version");
        }
 protected override void ConfigureTargets(ITaskContext session)
 {
     session.CreateTarget("Unzip.deploy.package")
     .AddTask(x => x.IisTasks().ControlAppPoolTask("flubu", ControlApplicationPoolAction.Stop).DoNotFailOnError())
     .AddTask(x => x.IisTasks().ControlAppPoolTask("flubu3.1", ControlApplicationPoolAction.Stop).DoNotFailOnError())
     .AddTask(x => x.Sleep(5000))
     .Do(UnzipDeployPackages)
     .Do(Deploy)
     .AddTask(x => x.IisTasks().ControlAppPoolTask("flubu", ControlApplicationPoolAction.Start))
     .AddTask(x => x.IisTasks().ControlAppPoolTask("flubu3.1", ControlApplicationPoolAction.Start))
     .DoAsync(this.TestWebApi);
 }
        protected override void ConfigureTargets(ITaskContext session)
        {
            //  var deleteN2Tables = session.CreateTarget("Delete.N2Tables").Do(DeleteN2Tables);

            session.CreateTarget("deployTest")
            .AddTasks(Deploy, @"C:\Web\App", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool", "Test", true, TestDbConnectionString);

            session.CreateTarget("deployTest2")
            .AddTasks(Deploy, @"C:\\WebApp", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool", "Test", false, TestDbConnectionString);

            session.CreateTarget("deployPreproduction")
            .AddTasks(Deploy, @"C:\WebAppP", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool_Preprod", "Preproduction", true, ProdDbConnectionString);

            session.CreateTarget("deployPreProduction2")
            .AddTasks(Deploy, @"C:\WebP", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool_preprod", "Preproduction", false, ProdDbConnectionString);

            session.CreateTarget("deployProduction")
            .AddTasks(Deploy, @"C:\Web", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool", "Production", true, ProdDbConnectionString);

            session.CreateTarget("deployProduction2")
            .AddTasks(Deploy, @"C:WebApp\", $"C:\\WebApp\\Backup\\web_{DateTime.Now:yyyy-M-dd--HH-mm-ss}.zip",
                      "web_AppPool", "Production", false, ProdDbConnectionString);
        }
Exemplo n.º 30
0
        protected override void ConfigureTargets(ITaskContext context)
        {
            var clean = context.CreateTarget("Clean")
                        .SetDescription("Clean's the solution.")
                        .AddCoreTask(x => x.Clean()
                                     .AddDirectoryToClean(OutputDir, true));

            var restore = context.CreateTarget("Restore")
                          .SetDescription("Restore's nuget packages in all projects.")
                          .AddCoreTask(x => x.Restore());

            var build = context.CreateTarget("Build")
                        .SetDescription("Build's the solution.")
                        .DependsOn(clean)
                        .DependsOn(restore)
                        .AddCoreTask(x => x.Build()
                                     .Version(BuildVersion.Version.ToString()));

            var tests = context.CreateTarget("Run.tests")
                        .SetDescription("Run's all test's in the solution")
                        .AddCoreTask(x => x.Test()
                                     .Project("WindowsService.Tests")
                                     .NoBuild());

            var package = context
                          .CreateTarget("Package")
                          .AddCoreTask(x => x.Publish("WindowsService"))
                          .AddCoreTask(x => x.CreateZipPackageFromProjects("WindowsService", "net48", "WindowsService"));

            var rebuild = context.CreateTarget("Rebuild")
                          .SetDescription("Builds the solution and runs all tests.")
                          .SetAsDefault()
                          .DependsOn(build, tests);
        }