Exemplo n.º 1
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "0":
                steps.Enqueue(new EditConfigStep());
                return(StepResult.Ok());

            case "1":
                config.AssemblyVersioningScheme = AssemblyVersioningScheme.Major;
                steps.Enqueue(new EditConfigStep());
                return(StepResult.Ok());

            case "2":
                config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinor;
                steps.Enqueue(new EditConfigStep());
                return(StepResult.Ok());

            case "3":
                config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatch;
                steps.Enqueue(new EditConfigStep());
                return(StepResult.Ok());

            case "4":
                config.AssemblyVersioningScheme = AssemblyVersioningScheme.MajorMinorPatchTag;
                steps.Enqueue(new EditConfigStep());
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result.ToLower())
            {
            case "y":
                Console.Write(@"Because you need to maintain multiple versions of your product in production at the same time, GitFlow is likely a good fit.

GitFlow allows you to have new development happening on the 'develop' branch, patch issues in old minor versions with 'hotfix/' branches and support old major versions with 'support/' branches");
                steps.Enqueue(new PickBranchingStrategyStep());
                return(StepResult.Ok());

            case "n":
                steps.Enqueue(new PickBranchingStrategy2Step());
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
Exemplo n.º 3
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "0":
                steps.Enqueue(new ConfigureBranches());
                return(StepResult.Ok());

            case "1":
                steps.Enqueue(new SetBranchTag(name, branchConfig));
                return(StepResult.Ok());

            case "2":
                steps.Enqueue(new SetBranchIncrementMode(name, branchConfig));
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
Exemplo n.º 4
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "0":
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            case "1":
                branchConfig.VersioningMode = VersioningMode.ContinuousDelivery;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            case "2":
                branchConfig.VersioningMode = VersioningMode.ContinuousDeployment;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
Exemplo n.º 5
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result.ToLower())
            {
            case "y":
                Console.WriteLine("GitFlow is likely a good fit, the 'develop' branch can be used " +
                                  "for active development while stabilising the next release.");
                Console.WriteLine();
                Console.WriteLine("GitHubFlow is designed for a lightweight workflow where master is always " +
                                  "good to deploy to production and feature branches are used to stabilise " +
                                  "features, once stable they are merged to master and made available in the next release");
                steps.Enqueue(new PickBranchingStrategyStep());
                return(StepResult.Ok());

            case "n":
                steps.Enqueue(new PickBranchingStrategy3Step());
                return(StepResult.Ok());
            }

            return(StepResult.InvalidResponseSelected());
        }
Exemplo n.º 6
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result)
            {
            case "1":
                steps.Enqueue(new GitFlowSetupStep());
                break;

            case "2":
                steps.Enqueue(new GitHubFlowStep());
                break;

            case "3":
                steps.Enqueue(new PickBranchingStrategy1Step());
                break;

            default:
                return(StepResult.InvalidResponseSelected());
            }

            return(StepResult.Ok());
        }
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            switch (result.ToLower())
            {
            case "y":
                Console.WriteLine("GitFlow could be a better fit than GitHubFlow for you.");
                Console.WriteLine();
                Console.WriteLine("GitVersion increments the SemVer for each commit on the develop branch by default, " +
                                  "this means all packages built from develop can be published to a single NuGet feed.");
                break;

            case "n":
                Console.WriteLine("We recommend the GitHubFlow branching strategy, it sounds like you will " +
                                  "not benefit from the additional complexity that GitFlow introduces");
                break;

            default:
                return(StepResult.InvalidResponseSelected());
            }

            steps.Enqueue(new PickBranchingStrategyStep());
            return(StepResult.Ok());
        }
Exemplo n.º 8
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            int parsed;

            if (int.TryParse(result, out parsed))
            {
                if (parsed == 0)
                {
                    steps.Enqueue(new EditConfigStep());
                    return(StepResult.Ok());
                }

                try
                {
                    var foundBranch = OrderedBranches(config).ElementAt(parsed - 1);
                    steps.Enqueue(new ConfigureBranch(foundBranch.Key, foundBranch.Value));
                    return(StepResult.Ok());
                }
                catch (ArgumentOutOfRangeException)
                { }
            }

            return(StepResult.InvalidResponseSelected());
        }
Exemplo n.º 9
0
        protected override StepResult HandleResult(string result, Queue <ConfigInitWizardStep> steps, Config config)
        {
            if (string.IsNullOrWhiteSpace(result))
            {
                return(StepResult.InvalidResponseSelected());
            }

            switch (result)
            {
            case "0":
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            case "1":
                branchConfig.Tag = string.Empty;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());

            default:
                branchConfig.Tag = result;
                steps.Enqueue(new ConfigureBranch(name, branchConfig));
                return(StepResult.Ok());
            }
        }