diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..c292b73 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +**/.DS_Store +.git \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..0512189 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +*.sh text eol=lf +*.cls text eol=lf +*.mac text eol=lf +*.int text eol=lf +Dockerfil* text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e6aff51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +.DS_Store + + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c446b3c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +ARG IMAGE=store/intersystems/irishealth:2019.3.0.308.0-community +ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0 +ARG IMAGE=store/intersystems/iris-community:2019.4.0.379.0 +ARG IMAGE=store/intersystems/iris-community:2020.1.0.199.0 +FROM $IMAGE + +USER root + +WORKDIR /opt/irisapp +RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp + +USER irisowner + +COPY Installer.cls . +COPY src src +COPY irissession.sh / +SHELL ["/irissession.sh"] + +RUN \ + do $SYSTEM.OBJ.Load("Installer.cls", "ck") \ + set sc = ##class(App.Installer).setup() + +# bringing the standard shell back +SHELL ["/bin/bash", "-c"] diff --git a/Installer.cls b/Installer.cls new file mode 100644 index 0000000..91b0bd4 --- /dev/null +++ b/Installer.cls @@ -0,0 +1,32 @@ +Class App.Installer +{ + +XData setup +{ + + + + + + + + + + + + + + + + +} + +ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ] +{ + #; Let XGL document generate code for this method. + Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup") +} + +} diff --git a/README.md b/README.md index e085782..9b058b4 100644 --- a/README.md +++ b/README.md @@ -16,30 +16,20 @@ How it works : https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GGBL_using_storing https://community.intersystems.com/post/m-cell - Download IRIS: https://www.intersystems.com/try-intersystems-iris-for-free/ - https://download.intersystems.com/download/login.csp - Preparation for start MX with Cache 8-bit or unicode, or IRIS InterSystems : - - download the repository as ZIP file, then unzip to a separate folder, for example: to c:\mx\ - - if you don’t yet have Cache or IRIS, download and install IRIS, preferably in unicode, on any win-computer - - start IRIS (Cache) terminal, then run the following commands after USER>: - - zn "yournspace" - Set root = "path on filesystem to which repository was downloaded" - Do $System.OBJ.ImportDir(root,"vmx.ro","ck",,1) Do ^ZSTU - ( Alternative option : USER> zn "yournspace" Do ^%RI Do ^ZSTU ) - + For start project with docker - edit the [connections] table in the MX_CONFI.xlsb (edit m-server-IP4-address, tcp port, $znspace) - run mx.xlsb (MS EXCEL be sure, required dot . as system-decimal-delimiter) then select and press the big button to connect to the mx-server Then you will see sheet with buttons for calling tests and games. You can test MX without m-server installation - just start mx-sea-battle.xlsb. - For install IRIS LINUX in docker, unzip repozitory to /mx/, then enter: - $ docker run --name myiris -v /mx/:/mx -p 5264:5264 -d store/intersystems/iris-community:2020.1.0.202.0 + For install IRIS LINUX in docker, unzip repozitory to /path/to/mymx, then enter: + $ docker run --name myiris -v /path/to/mymx:/mx -p 5264:5264 -d store/intersystems/iris-community:2020.1.0.202.0 $ docker exec -it myiris session iris USER>do $System.OBJ.ImportDir("/mx","vmx.ro","ck",,1) do ^ZSTU + With MX : - you can create new complex projects, or use MX as an auxiliary tool diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..fe91c2b --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3.6' +services: + iris: + build: + context: . + dockerfile: Dockerfile + restart: always + ports: + - 51773 + - 52773 + - 53773 + - 5264:5264 + volumes: + - ~/iris.key:/usr/irissys/mgr/iris.key + - ./:/irisdev/app diff --git a/irissession.sh b/irissession.sh new file mode 100644 index 0000000..8f4a51d --- /dev/null +++ b/irissession.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +iris start $ISC_PACKAGE_INSTANCENAME quietly + +cat << EOF | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS +do ##class(%SYSTEM.Process).CurrentDirectory("$PWD") +$@ +if '\$Get(sc) do ##class(%SYSTEM.Process).Terminate(, 1) +zn "%SYS" +do ##class(SYS.Container).QuiesceForBundling() +Do ##class(Security.Users).UnExpireUserPasswords("*") +halt +EOF + +exit=$? + +iris stop $ISC_PACKAGE_INSTANCENAME quietly + +exit $exit \ No newline at end of file