This is how I have been setting up IRIS instance local filesystem registries. I'm still using an old 0.9.1 version so your version might behave differently.
The repository location is recorded by environment variable IPM_LOCAL_REGISTRY.
In ObjectScript shell %SYS namespace:
// install ipm
do $system.OBJ.Load("/path/to/zpm-0.9.1.xml","ck",.errorlog)
// setup local filesystem ipm registry
zwrite ##class(%IPM.Main).Shell("repo -name REPONAME -filesystem -depth 2 -path ${IPM_LOCAL_REGISTRY}")A (minimized) bash script used to install module tarballs:
#!/bin/bash
declare -r tarball=${1}
declare -r workdir=$(mktemp --directory --tmpdir=/tmp ipm-module.XXXXXX)
trap "rm -rf ${workdir}" EXIT
declare -r manifest=${workdir}/module.xml
tar zxf ${tarball} -C ${workdir}
declare -r name=$(perl -ne 'if (m/<Name>(.*?)<\/Name>/) { print "$1"; last; }' ${manifest})
declare -r version=$(perl -ne 'if (m/<Version>(.*?)<\/Version>/) { print "$1"; last; }' ${manifest})
declare -r module_dir=${IPM_LOCAL_REGISTRY}/${name}/${version}
if [[ -d ${module_dir} ]]; then
echo "Module ${name} version ${version} is already in the local registry"
exit 0
fi
mkdir -p ${module_dir}
cp -r ${workdir}/* ${module_dir}It will untar the tarball, figure out the module name and version from the manifest file and copy the sources to correctly named directory.
I also have other scripts that will fetch the tarballs from the actual artifact repository where the module tarballs are stored.
- Log in to post comments