This feature makes the distribution of models a piece of cake. It essentially generates model code and immediately creates a new pull request in your connected repository. Imagine we have a Notes app that supports: Web, iPhone and Android. Using remote gen, we could instantly create pull requests in all three app repositories, so every change in your models gets propagated to all the supported platforms. Check out the diagram below.
We need to connect an engine to a GitHub repository. OneGen currently supports only GitHub, but that's likely to change in the future.
If you're adding a new engine, you should see Connect to a remote repository section. If you want to connect an existing engine, navigate to engine config.
- Select Remote Repository: OneGen automatically retrieves a list of your GitHub repositories, you can just the right one
- Select Remote Branch: Select one of the branches of the given repository.
- Model Path: Enter the model path, for example /src/models
- Finally, save the dialog
Unset a remote repository
You probably noticed the red button in the picture above. It lets you unset (reset) the current remote repository. If you decide to unset a repository, make sure to save the dialog, otherwise, it won't take effect.
You can open the remote gen dialog by clicking on the purple cloud icon in the action bar as highlighted in the picture below.
The remote gen dialog requires you to enter a pull request title and description. Just describe the changes, for instance, Added User model.
When you click on the Generate button, the dialog will show you a link to the newly created pull request(s).
If you're currently in the design module (the design tab on top is active), remote gen will generate code for every engine that's connected to a remote repository. Thus, if you have 2 engines, each connected to a remote repository, a new pull request would be generated for both.
If you're currently in an engine (an engine tab on top is active), remote gen will generate code only for this engine.