archi-modelrepository-plugin icon indicating copy to clipboard operation
archi-modelrepository-plugin copied to clipboard

Add CLI options for commit and push

Open vv3 opened this issue 5 years ago • 5 comments

There are CLI options for cloning a repo and loading a model. I'd like to see options for commiting and pushing as well. Something like: --modelrepository.commit --modelrepository.push

The commit option should take an Commit-message argument

Combining this with jArchi scripting, this would make it possible to automatically update the model without using the GUI. See disussion here: https://forum.archimatetool.com/index.php?topic=733.msg4491#msg4491

vv3 avatar Feb 14 '20 06:02 vv3

Great idea. I wonder of the 'push' should be called 'publish' for consistency with the UI?

rich-biker avatar Feb 14 '20 08:02 rich-biker

This would require a significant re-write of the code as it does a lot of UI stuff. For example, "Publish" does the following:

  1. Ask user to save model if needed (UI)
  2. Ask user to commit changes if needed (UI)
  3. Pull from remote
  4. If a merge is required present a dialog to user, deal with any merge conflicts (UI)
  5. Push to remote

It would be possible to throw some exceptions or not proceed in cases of (1) and (2) and (4) but all of the code would need to be re-written to do this, quite significantly.

Phillipus avatar Feb 14 '20 08:02 Phillipus

Is it easier to create a CLI-option for simply exporting the model as a set of XML files? Something like: --modelrepository.export-to-XML The git operations themselves can then be performed from a batch/shell script.

vv3 avatar Feb 19 '20 09:02 vv3

A first stage might be to look at "commit". It still requires some refactoring of the code, though.

Phillipus avatar Feb 19 '20 09:02 Phillipus

Hi! Let me bring this thread back to life. We are using the collaboration plugin too and found ACLI very useful for automating export tasks, but we are limited for import tasks which we are forced to run manually from the Archi application. We don't really need the git features as we use an environment with an already cloned repo and load the model using "--modelrepository.loadModel". A "--modelrepository.saveModel" would be extremely useful for running unattended import scripts.

mmoreno803user avatar Nov 09 '22 12:11 mmoreno803user