ACLI beginners questions

Started by Manj75, August 11, 2021, 16:39:12 PM

Previous topic - Next topic

Manj75

I have just started to explore usage of the ACLI to create windows batch script to carry out some scheduled activities.

Use Case: Remote repo contains the Enterprise Architecture model and I want to run daily a script that automates:

  • Fetching or Refreshing the remote GIT repo to get the latest
  • Generate a HTML report of the retrieved model to an output folder
  • Remainder actions will be outside of ACLI to move the HTML files to SharePoint for publication

Questions on ACLI usage:


  • If I were to create an empty model using --createEmptyModel does this just a create a temporal current model in the run of the command and disposed when the archi command run exits, i.e. are all options in context to the given archi cmd execution?
  • What are providers? Are these just categories under-the-hood but are covered by the listed options?
  • Will --modelrepository.cloneModel <url> do the same as 'Import Remote Model to Workspace' in that it creates a local repo from the URL remote and not the same as a GIT clone?
  • Is the pass file used in -modelrepository.passFile <password file> plain text and only the password in the file no other notation?

I hoping for the use case described above I can use

archi -application com.archimatetool.commandline.app -consoleLog -nosplash --modelrepository.cloneModel <url> --modelrepository.userName <userName> --modelrepository.passFile <password file> --html.createReport <path>

It would be good to have some example usage of --modelrepository

Are there any examples community ACLI scripts to look at - it would be good to see the power of ACLI used by others.

Phil Beauvoir

1. If I were to create an empty model using --createEmptyModel does this just a create a temporal current model in the run of the command and disposed when the archi command run exits, i.e. are all options in context to the given archi cmd execution?

Yes, this becomes the "current model". If you don't save it, it is discarded.


2. What are providers? Are these just categories under-the-hood but are covered by the listed options?

They're plug-ins that support some ACLI action(s). Each provider has a priority as explained in the wiki https://github.com/archimatetool/archi/wiki/Archi-Command-Line-Interface


3. Will --modelrepository.cloneModel <url> do the same as 'Import Remote Model to Workspace' in that it creates a local repo from the URL remote and not the same as a GIT clone?

It doesn't import it to the workspace but clones the repo to the specified folder given in the argument --modelrepository.loadModel. This is then loaded as the "current model".


4. Is the pass file used in -modelrepository.passFile <password file> plain text and only the password in the file no other notation?

Plain text of the password only. A file is used to avoid putting the password in the history of the terminal app.


It would be good to have some example usage of --modelrepository

It's basically this:

Archi -consoleLog -nosplash -application com.archimatetool.commandline.app
--modelrepository.cloneModel "<url of repo>"
--modelrepository.loadModel "<path to folder to clone to>"
--modelrepository.userName "<userName>"
--modelrepository.passFile "<pathtoPasswordFile>"


And you can also add:

-html.createReport <path>

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Manj75

Worked like a charm :)

There is no option in ACLI to carry out a repository commit and publish, which would be useful.

As --modelrepository cloneModel is creating a local git repo it should be possible to carry out the operations with commands such as:

--modelrepository commitModel <url>
--modelrepository publishModel <url>

<url> specified if needed as the cloneModel will create a .git so it should already know the url.


Commit model only if there are changes to the Current Model and publish will carry out a commit first then publish to the remote repo.

If this is not currently supported are there plans to support it and will it be in v4.9?

Phil Beauvoir

> If this is not currently supported are there plans to support it and will it be in v4.9?

This is discussed here - https://github.com/archimatetool/archi-modelrepository-plugin/issues/121

It would be part of coArchi 2, not Archi itself.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Manj75

Looking at the GitHub issue it was tagged as an enhancement in Nov 2020 - is there any update to when coArchi 2 will be released?

Great news though, Archi is really becoming a mature powerful platform.