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

Note:
- 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
Comments
@Jimmy Xu - thank you for this very simple primer for getting started with ZPM ... it is very clearly laid out!
Thanks Ben!
I assume there is a way to install a private local ZPM repository if you want or need to keep your code internally.
I answered my own question by a simple search, d'oh. but to save anyone else that 30 seconds of effort, here it is.
https://community.intersystems.com/post/setting-your-own-intersystems-o…
💡 This article is considered as InterSystems Data Platform Best Practice.
Hello, I'm getting this error when I execute: publish {myPackageName}
ERROR! Publishing module, authorization required.
Can you help me?
Thanks!!
You can't publish manually to the public repository, you can do it only through OpenExchange, check IPM during application creation, and with the next release, it will publish your project for you
If you want to publish to your repo, you just have to specify login and password, with command like this
repo -r -n myrepo -url https://server/registry/ -user "test" -pass "test"Ok, thanks Dimitry! 👏
In addition to what @Dmitry Maslennikov says here is the related information in docs.
Thanks Evgeny 👍