ZPM Simple Implementation Cookbook
ZPM is designed to work with applications and modules for InterSystems IRIS Data Platform. It consists of two components, the ZPN Client which is a CLI to manage modules, and The Registry which is a database of modules and meta-information. We can use ZPM to search, install, upgrade, remove and publish modules. With ZPM you can install ObjectScript classes, Frontend applications, Interoperability productions, IRIS BI solutions, IRIS Datasets or any files such as Embedded Python wheels.
Today this cookbook will go through 3 sections:
- Install ZPM
- Generate Module
- Find, Install, publish modules inside the Registry
1. Install ZPM
- Download latest version of ZPM ( this should be one single XML file) Download link
- Import XML you have downloaded to IRIS and it can only be deployed into IRIS open IRIS terminal and enter
write $SYSTEM.OBJ.Load("C:\zpm.xml", "c")
Note "C:\zpm.xml" is the path of the XML file downloaded, this step could take a while.
- After finished installing, simply type zpm, press enter, you will see you are in zpm shell
2. Generate Module
Before we start generating module, we need to prepare a folder that has one or more files ready to load, Therefore I have created a folder under C drive called zpm.
Execute the command generate C:/zpm
After you specific all the necessary, your first module has been generated successfully, also you will see
- module version is using semantic versioning
- module source folder is the folder has all the class file
- zpm also offers a option to add web applications and dependency, in this example I will leave it blank
Now, open the file explorer, you will see a file called "module.xml" as you can see from the screenshot below
Type command load C:\ZPM\ you will see your module has been reloaded, validated, compiled and activated
3. Find, Install, publish modules inside the Registry
Find packages available in the current Registry: zpm:USER>search
Install package from current Registry as an example lets install a module called zpmshow in public Registry: zpm:USER>install zpmshow (the command is install "moduleName")
Publish module after loaded: zpm:USER>publish myFirstZPMDemo
You can use zpm:USER>search to verify the publish, in my case you can see "myfirstzpmdemo 0.1.0" is sitting in current Registry.
Note: If you have an error when you are publishing a module that says: "ERROR! Publishing module, something went wrong", make sure that the status of the current Registry is enabled and available.
You can use zpm:USER>repo -list, to verify the status of current Registry.
Video available: Click here