diff --git a/.dockerignore b/.dockerignore index 9a1c280..cc970a8 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ ** !docker-entrypoint.sh !iriscli -!iris_ipm.py \ No newline at end of file +!iris_ipm.py +!iris.script \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 982cbd1..cf8948d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,45 +1,17 @@ -FROM --platform=$BUILDPLATFORM intersystems/iris-community-${BUILDARCH}:2024.1.0.238.0 +FROM --platform=$BUILDPLATFORM intersystems/iris-community:2024.1-linux-${BUILDARCH} + +ARG IPM_INSTALLER=https://pm.community.intersystems.com/packages/zpm/latest/installer + +COPY ./iris.script /tmp/iris.script RUN \ - wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \ + wget -q $IPM_INSTALLER -O /tmp/zpm.xml && \ mkdir /usr/irissys/mgr/zpm && \ iris start $ISC_PACKAGE_INSTANCENAME quietly && \ - /bin/echo -e \ - "set pNS(\"Globals\")=\"%DEFAULTDB\"\n" \ - "set sc=##class(Config.Namespaces).Create(\"%ALL\",.pNS)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set pDB(\"Directory\")=\"/usr/irissys/mgr/zpm/\"\n" \ - "set sc=##class(SYS.Database).CreateDatabase(pDB(\"Directory\"), 30)\n" \ - "do ##class(SYS.Database).MountDatabase(pDB(\"Directory\"))" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##class(Config.Databases).Create(\"ZPM\",.pDB)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set pMap(\"Database\")=\"ZPM\"\n" \ - "set sc=##Class(Config.MapPackages).Create(\"%ALL\",\"%ZPM\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapGlobals).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapGlobals).Create(\"%SYS\",\"ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGF00\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGC00\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc = ##class(%SYSTEM.OBJ).Load(\"/tmp/zpm.xml\", \"c\")\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "do ##class(SYS.Database).Defragment(pDB(\"Directory\"))" \ - "do ##class(SYS.Database).CompactDatabase(pDB(\"Directory\"),100)" \ - "do ##class(SYS.Database).ReturnUnusedSpace(pDB(\"Directory\"))" \ - "do ##class(SYS.Database).DismountDatabase(pDB(\"Directory\"))" \ - "halt" \ - | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \ + iris session $ISC_PACKAGE_INSTANCENAME -U %SYS < /tmp/iris.script && \ iris stop $ISC_PACKAGE_INSTANCENAME quietly -FROM --platform=$TARGETPLATFORM intersystems/iris-community-${TARGETARCH}:2024.1.0.238.0 - -COPY iris.key /usr/irissys/mgr/iris.key +FROM --platform=$TARGETPLATFORM intersystems/iris-community:2024.1-linux-${BUILDARCH} USER root diff --git a/Dockerfile-phase1 b/Dockerfile-phase1 index f88038e..44944ce 100644 --- a/Dockerfile-phase1 +++ b/Dockerfile-phase1 @@ -1,41 +1,14 @@ -ARG IMAGE=containers.intersystems.com/intersystems/iris-community:2022.2.0.368.0 -ARG IMAGEARM=containers.intersystems.com/intersystems/iris-community-arm64:2022.2.0.368.0 +ARG IMAGE=intersystems/iris-community:latest-cd ARG DEV=0 FROM $IMAGE +ARG IPM_INSTALLER=https://pm.community.intersystems.com/packages/zpm/latest/installer + +COPY ./iris.script /tmp/iris.script + RUN \ - wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O /tmp/zpm.xml && \ + wget -q $IPM_INSTALLER -O /tmp/zpm.xml && \ mkdir /usr/irissys/mgr/zpm && \ iris start $ISC_PACKAGE_INSTANCENAME quietly && \ - /bin/echo -e \ - "set pNS(\"Globals\")=\"%DEFAULTDB\"\n" \ - "set sc=##class(Config.Namespaces).Create(\"%ALL\",.pNS)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set pDB(\"Directory\")=\"/usr/irissys/mgr/zpm/\"\n" \ - "set sc=##class(SYS.Database).CreateDatabase(pDB(\"Directory\"), 30)\n" \ - "do ##class(SYS.Database).MountDatabase(pDB(\"Directory\"))" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##class(Config.Databases).Create(\"ZPM\",.pDB)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set pMap(\"Database\")=\"ZPM\"\n" \ - "set sc=##Class(Config.MapPackages).Create(\"%ALL\",\"%ZPM\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapGlobals).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapGlobals).Create(\"%SYS\",\"ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZPM.*\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGF00\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc=##Class(Config.MapRoutines).Create(\"%ALL\",\"%ZLANGC00\",.pMap)\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "set sc = ##class(%SYSTEM.OBJ).Load(\"/tmp/zpm.xml\", \"c\")\n" \ - "if '\$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1)\n" \ - "do ##class(SYS.Database).Defragment(pDB(\"Directory\"))" \ - "do ##class(SYS.Database).CompactDatabase(pDB(\"Directory\"),100)" \ - "do ##class(SYS.Database).ReturnUnusedSpace(pDB(\"Directory\"))" \ - "do ##class(SYS.Database).DismountDatabase(pDB(\"Directory\"))" \ - "halt" \ - | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS && \ + iris session $ISC_PACKAGE_INSTANCENAME -U %SYS < /tmp/iris.script && \ iris stop $ISC_PACKAGE_INSTANCENAME quietly diff --git a/README.md b/README.md index 8437539..176eb4e 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,4 @@ The published images could be found at following Docker Repositories: [InterSystems IRIS Community Edition](https://hub.docker.com/r/intersystemsdc/iris-community) [InterSystems IRIS Community Edition for Health:](https://hub.docker.com/r/intersystemsdc/irishealth-community) -Current version of [ZPM installed](https://openexchange.intersystems.com/package/ObjectScript-Package-Manager-2): 0.7.0 +Current version of [IPM installed](https://openexchange.intersystems.com/package/InterSystems-Package-Manager-1): 0.9.0 diff --git a/docker-compose-beta.yml b/docker-compose-beta.yml new file mode 100644 index 0000000..dc42f80 --- /dev/null +++ b/docker-compose-beta.yml @@ -0,0 +1,16 @@ +version: '3.6' +services: + iris: + build: + context: . + dockerfile: Dockerfile-amd64 + args: + IPM_INSTALLER: https://github.com/intersystems/ipm/releases/download/v0.9.0-beta.31/zpm-0.9.0-beta.31.xml + restart: always + ports: + - 1972 + - 57774:52773 + - 53773 + volumes: + - ~/iris.key:/usr/irissys/mgr/iris.key + - ./:/irisdev/app diff --git a/iris.script b/iris.script new file mode 100644 index 0000000..631b021 --- /dev/null +++ b/iris.script @@ -0,0 +1,41 @@ +set pNS("Globals")="%DEFAULTDB" +set sc=##class(Config.Namespaces).Create("%ALL",.pNS) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set pDB("Directory")="/usr/irissys/mgr/zpm/" +set sc=##class(SYS.Database).CreateDatabase(pDB("Directory"), 30) +do ##class(SYS.Database).MountDatabase(pDB("Directory")) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##class(Config.Databases).Create("IPM",.pDB) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set pNamespace("Globals")="IPM" +set pNamespace("Routines")="IPM" +set sc=##Class(Config.Namespaces).Create("IPM",.pNamespace) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set pMap("Database")="IPM" +set sc=##Class(Config.MapPackages).Create("%ALL","%IPM",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapPackages).Create("%ALL","IPM",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapGlobals).Create("%ALL","%IPM.*",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapGlobals).Create("%ALL","IPM.Repo.*",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapGlobals).Create("%SYS","IPM.*",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapRoutines).Create("%ALL","%IPM.*",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapRoutines).Create("%ALL","%ZLANGF00",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +set sc=##Class(Config.MapRoutines).Create("%ALL","%ZLANGC00",.pMap) +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +zn "IPM" +set sc = ##class(%SYSTEM.OBJ).Load("/tmp/zpm.xml", "c") +if '$Get(sc,1) do ##class(%SYSTEM.Process).Terminate(, 1) +zpm "repo -reset-defaults" +zn "%SYS" +do ##class(Config.Namespaces).Delete("IPM") +do ##class(SYS.Database).Defragment(pDB("Directory")) +do ##class(SYS.Database).CompactDatabase(pDB("Directory"),100) +do ##class(SYS.Database).ReturnUnusedSpace(pDB("Directory")) +do ##class(SYS.Database).DismountDatabase(pDB("Directory")) +halt \ No newline at end of file diff --git a/iris_ipm.py b/iris_ipm.py index 430d9f5..35ee4d4 100644 --- a/iris_ipm.py +++ b/iris_ipm.py @@ -21,7 +21,7 @@ def shell(cmd, status): status.put(True) - res = iris.cls("%ZPM.PackageManager").Shell(cmd) + res = iris.cls("%IPM.Main").Shell(cmd) print('') if res != 1: status.get()