Modes
The Bingo engine can optionally be told to run in one the following “modes”:
"setup"
: Indicating the production is being used to create a new repository"transition"
: Indicating the production is migrating an existing repository
Running the Bingo CLI will always infer one of the modes.
The produceTemplate
and runTemplate
may optionally specify a mode.
Setup
This mode creates a new repository on GitHub.
As the production is run, the Bingo engine will add in additional creations from the template’s setup()
function, if it exists.
Those creations typically includes example starter files or one-time API registrations.
When running a Bingo template in setup mode, it will:
- Create a new repository on GitHub
- If the template defines an
about.repository
, the repository will include a generated from notice pointing to that template repository
- If the template defines an
- Run the template’s producer function
- Add that new repository as the
origin
remote - Apply the template’s creations to the repository
- Force-push a single commit with the new repository contents to that origin
Transition
This mode migrates an existing repository onto the provided template.
As the production is run, the Bingo engine will add in additional creations from the template’s transition()
function, if it exists.
Those creations typically includes scripts that delete files from known no-longer-used pieces of tooling.
When running Bingo on the CLI in transition mode, it will:
- Check if the repository is freshly cloned from the template’s GitHub template repository
- If it is, remove all local files and Git history
- Run the template’s producer function
- If this was a fresh template repository clone, create and push an initial commit
- Apply the template’s creations to the repository