Name

gx demo - Create demo repositories with X-Modules to show and test the functionality.

Synopsis

gx demo [--help] [--pull-only] [--repos-only] [--merge-type=MERGE_TYPE] [--scenario=SCENARIO] [--squash-rule=SQUASH_RULE] DIR

Description

Create demo repositories with X-Modules to show and test the functionality.

Options

--help

Display this help message.

--merge-type=MERGE_TYPE

Valid values: MERGE, REBASE

Default: MERGE

This option defines, how X-Module history is incorporated into the parent repository.

The default value (MERGE) means that the module history will be merged into the parent history.

        M1--M2--M3 module history
                  \
       P1--P2--P3--X parent history

If some M4 and M5 are added to the module later, gx sync command will merge them into the parent Git repository history using a separate merge commit.

        M1--M2--M3--M4--M5 module history
                  \       \
       P1--P2--P3--X-------Y parent history

REBASE means that the module history will be added to the top of the parent history.

        M1--M2--M3 module history

      P1--P2--P3--M1--M2--M3 parent history
--pull-only

One-way synchronization.

When this option is used, the external repository is NOT updated on pushes to the parent repository. Still, the X-Module inside the parent repository is updated with changes from the external repository after running gx sync command.

By default, the synchronization is two-way.

--repos-only

Interactive demo; when this option is used, the script creates the repositories, but NOT the X-Modules. Instead, it prints the instructions, how to create X-modules (ready to copy-n-paste).

By default, without this option, the script does all the work, and you are invited to explore the X-Modules and to push to the parent repository.

--scenario=SCENARIO

This demo has two scenarios, simulating real-life use cases.

Valid values: product-repo, split-monorepo

Default: product-repo

In the product-repo scenario, a parent repository includes three X-Modules from the other repositories.

In the split-monorepo scenario, three app repositories are containing parts of the monorepo as X-Modules.

--squash-rule=SQUASH_RULE

Valid values: NEVER, ALWAYS, ONCE

Default: NEVER

This option defines whether and when the commit history of the external repository history will be squashed into one commit in the parent repository.

The default value NEVER means that there’s no squashing.

ALWAYS means that upon gx sync command all new commits from the external repository will be replaced with one commit ('squashed') in the parent repository history.

ONCE means that, only when a module is added to the parent repository, all commits from the history of the external repository are replaced with one commit ('squashed') in the parent repository history. All further commits to the external repository will be copied to the parent repository as they are, without squashing.

Arguments

DIR

The path to a sandbox directory, where demo repositories are to be created.

  • No labels