Package: luma
Lumavate CLIConfig Summary:Install CLIProvision CLI credentialsConfigure CLIDeveloping In The CLIPublishing CLIExample CommandsInstalling the CLI from pip:On Windows, run BASH as admin and omit 'sudo'$ pip3 install lumaInstalling the CLI from source:Clone this repo.CD into the CLI dir and run:$ pip3 install .CLI support:The CLI is written for and tested in a BASH shellTo get the most of of the CLI, use it with ZSH. This enables extra features such as showing help text during autocompletionTo activate autocompletion after install, restart your terminal or source your shell config (Either .zshrc or .bash_profile)Provision CLI Credentials:In the Lumavate App, navigate to the Lumavate CLI page inside a command centerProvisioning CLI credentials will generate credentials for the user you are currently signed in asWhen running the add profile command, you will have the option to associate the new profile to anyorganization your user has access to, regardless of the command center you are currently inCLI Config:Configuring the CLI requires two steps, configuring environments and configuring profiles.Environmentsknow how to get and refresh tokens so you stay authorized with the platform as a user.Profilesgive the user a company context which is required by most of the platform API.CLI Env:To configure the CLI Env, run the generated command from the Lumavate CLI page in the app in your terminalTo configure each Env value one by one, run:$ luma env config

Env Name: prod
App: appUrl
Token: token
Audience: audience
Client id: clientId
Client secret: clientSecretCLI Profile:To add a profile to the CLI, run:$ luma profile add

Profile Name: globex
Env: prod
Org ID you want to associate with this profile: 11Developing In The CLIThe easiest way to develop for the cli is in a venv. A helper script has been setup for this.Runsource ~/.local-setupto create the venv and install the cli as an editable packageThen run./local-luma <cmd>where cmd is a normal lumavate cli command.Write code and re-run step 2 as needed until ready for package deployment test.When your code is ready for package level testing, tag the branch that you want tested with..*
where..* would be the next incremental test semvar. Push it and github will build and deploy to Test pypi.
These tagged test versions are independent of production versions in pypi, but for simplicity its best to increment it in sync with both prod and test.Publishing The CLIDeployment of the CLI has been simplified to deploy to PyPi when a release is Published in github.
NOTE: Have you tested locally and in TestPyPi yet? If not, follow directions in Developing In The CLI section.After developing and testing locally, create a PR to master. Create a release off master in github, tag it using a standard..* semvar value and the deploy process will internally set the PyPi package version to the deployed tagged version using python setuptools_scm in combination with the github actionpypa/gh-action-pypi-publishRunning CommandsTo list top level commands, run:$ lumaTo get help with any command or subcommand, run it without passing in any options or, pass in the --help flagAs an example let's create a microservice, create a version, upload a docker image, and start the service$ luma microservice add
Profile: globex
Name: Auth Service
Url ref: auth
| id | name         | urlRef | createdAt         | createdBY          |
|----|--------------|--------|-------------------|--------------------|
| 45 | Auth Service | auth   | 10/16/18 20:29:49 | john+doe@gmail.com |

$ luma microservice access --profile globex
Microservice: auth
| failed | sharedWith | unsharedWith | resultingGrantees |
|--------|------------|--------------|-------------------|
| []     | []         | []           | []                |

$ luma microservice access -p globex --container auth --add "Acme Corp" --add Initech
| failed | sharedWith   | unsharedWith | resultingGrantees        |
|--------|--------------|--------------|--------------------------|
| []     | [{id}, {id}] | []           |  [Acme Corp, 'Initech']  |

$ luma microservice-version add -p globex --version-number 0.1.0 --container-file-path ~/Desktop/auth-service.tar.gz --label prod --port 8080 -c auth
| id  | actualState | versionNumber | label | createdAt         | createdBy          |
|-----|-------------|---------------|-------|-------------------|--------------------|
| 107 | created     | 0.1.0         | prod  | 10/16/18 20:46:44 | john+doe@gmail.com |

$ luma microservice-version start -p globex
Microservice: auth
Version: 0.1.0
Starting Microservice  [####################################]  100%