Skip to content

Add improved splitting utility#5

Merged
bennothommo merged 12 commits intomainfrom
wip/split-command
Apr 5, 2021
Merged

Add improved splitting utility#5
bennothommo merged 12 commits intomainfrom
wip/split-command

Conversation

@bennothommo
Copy link
Copy Markdown
Member

@bennothommo bennothommo commented Apr 3, 2021

Remake of wintercms/winter#66.

Adds a much faster and more robust subsplit utility into Winter CMS CLI, and adds a split command to be used by the maintainers to execute a subsplit of the modules into their split repositories.

Usage:

Description:
  Runs a subsplit to publish the Winter CMS modules in their own repositories.

Usage:
  split [options] [--]


Options:
  -b, --branch[=BRANCH]                Publishes a branch in the subsplit repositories.
  -g, --git[=GIT]                      The path to the "git" binary.
      --remove-branch[=REMOVE-BRANCH]  Removes a branch in the subsplit repositories.
      --remove-tag[=REMOVE-TAG]        Removes a tag in the subsplit repositories.
  -s, --sync                           Fully synchronises branches and tags with the subsplit repositories.
  -a, --tag[=TAG]                      Publishes a tag in the subsplit repositories.
  -w, --work-repo[=WORK-REPO]          Defines the location of the working repository. Defaults to "/storage/temp/split-repo" within the base path.
  -h, --help                           Display this help message
  -q, --quiet                          Do not output any message
  -V, --version                        Display this application version
      --ansi                           Force ANSI output
      --no-ansi                        Disable ANSI output
  -n, --no-interaction                 Do not ask any interactive question
      --env[=ENV]                      The environment the command should run under
  -v|vv|vvv, --verbose                 Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

It should be run as follows:

winter-cli split

and followed by one of the following:

  • -s|--sync: Runs a full sync of all branches from the main repo to the subsplits
  • -b|--branch <branch>: Runs a sync for a single branch
  • -a|--tag <tag>: Runs a sync for a single tag
  • --remove-branch <branch>: Removes a single branch from the subsplits
  • --remove-tag <tag>: Removes a single tag from the subsplits

@bennothommo
Copy link
Copy Markdown
Member Author

@LukeTowers this is good to go if you wanted to give it a test.

If you want to test with the compiled program, run composer install after checking out this PR, then run vendor/bin/box compile and it will create a winter.phar file inside the directory. Then run that directly.

It will run this against the actual module repos, so we may need to reset them as the commits are out of whack with the old split script.

@LukeTowers
Copy link
Copy Markdown
Member

@bennothommo works great! I took a brief look at the module repos on github after running --sync and they seem to be fine. Could you give me a cheatsheet of the common stuff (i.e. sync all the branches, sync a specific branch, sync a specific tag, anything else you can think of)?

Are we going to be able to work this into the main repo github actions so we never have to worry about manually syncing again? 😉

@bennothommo
Copy link
Copy Markdown
Member Author

@LukeTowers

Could you give me a cheatsheet of the common stuff (i.e. sync all the branches, sync a specific branch, sync a specific tag, anything else you can think of)?

Sure thing, here's the common uses:

  • Do a full synchronisation of all branches (synchronises all current branches, removes orphaned branches)
    • winter split -s
  • Synchronise the "wip/test" branch only
    • winter split -b wip/test
  • Synchronse the "1.0.999" tag only
    • winter split -a 1.0.999
  • Delete the "wip/no-more" branch from the subsplits
    • winter split --remove-branch wip/no-more
  • Delete the "1.0.469" tag from the subsplits
    • winter split --remove-tag 1.0.469

Are we going to be able to work this into the main repo github actions so we never have to worry about manually syncing again?

For sure, although not sure the best course of action in regards to making the utility available. The simplest solution would be to download the utility each time it is required in an action, but seems rather "wasteful".

@bennothommo bennothommo merged commit 34de033 into main Apr 5, 2021
@bennothommo bennothommo deleted the wip/split-command branch April 5, 2021 05:43
@LukeTowers
Copy link
Copy Markdown
Member

Is there any value in making it a github action available in the marketplace / does that even do a better job than just download the utility every time?

@bennothommo
Copy link
Copy Markdown
Member Author

Will give it a try :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants