Build & Deploy an Extension with the Matrix42 CLI
This is a step-by-step guide on how to use Matrix42 DevOps Services to build and deploy a Enterprise Automation Platform Extension using the Matrix42 CLI.
Prerequisites
- A Matrix42 Cloud Account. (https://accounts.matrix42.com)
- The source files of a Enterprise Automation Platform Configuration Package.
- The Matrix42 Command-Line Interface (CLI).
Install the Matrix42 Command-Line Interface (CLI)
To use the CLI you will need to have npm installed on your device. You can find a guide on how to install npm in the official npm documentation:
Downloading and installing Node.js and npm | npm Docs (npmjs.com)
Now all you need to do is install the Matrix42 CLI using npm:
> npm i -g @matrix42/cli
Build the Extension
To build your Enterprise Automation Platform Extension (Configuration Package) you need to run the "generate-extension" command:
> m42 generate-extension --manifest --output [--output-manifest] [--additions] [--build]
An example for this command:
> m42 generate-extension -m /path/to/package.json -o MyExtension.zip -a "/directory/to/add/1,/directory/to/add/2"
Sign your Extension
Now that you built your Enterprise Automation Platform Extension you will later want to upload it as a Release. But before you need to sign this Release using a Matrix42 Developer Identity.
You can read all about how to sign your Release here.
Upload your Extension
Now that you have a signed Extension Release you can upload it using the "upload-extension" command:
> m42 upload-extension --id --path [--runtime]
An example for this command:
> m42 upload-extension -i 9720d1e9-65f1-4897-b850-2a5bdb72cfcc -p /path/to/Extension.zip
Troubleshooting
For some commands you might need to be logged in. The CLI will output an error if authentication is missing.
You can authenticate your current session using the "login" command:
> m42 login [--personal-access-token]
Please be aware that the implicit login via a Browser is not supported in Pipeline an integration. Therefor you will need to create a PAT (personal access token) with an account you want to use for your Pipeline integration.
You can create a new PAT by logging in to https://accounts.matrix42.com and then on the bottom of your Account site (https://accounts.matrix42.com/my/account).