diff --git a/.github/workflows/bump-module-version.yml b/.github/workflows/bump-module-version.yml new file mode 100644 index 0000000..5532a56 --- /dev/null +++ b/.github/workflows/bump-module-version.yml @@ -0,0 +1,30 @@ +name: versionbump + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + release: + types: + - released + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Bump version + run: | + git config --global user.name 'ProjectBot' + git config --global user.email 'bot@users.noreply.github.com' + VERSION=$(sed -n '0,/.*\(.*\)<\/Version>.*/s//\1/p' module.xml) + VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.` + sed -i "0,/\(.*\)<\/Version>/s//$VERSION<\/Version>/" module.xml + git add module.xml + git commit -m 'auto bump version' + git push diff --git a/.github/workflows/runtests.yml b/.github/workflows/runtests.yml new file mode 100644 index 0000000..7464209 --- /dev/null +++ b/.github/workflows/runtests.yml @@ -0,0 +1,28 @@ +name: unittest + +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + release: + types: + - released + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Build and Test + uses: docker/build-push-action@v2 + with: + context: . + push: false + load: true + tags: ${{ github.repository }}:${{ github.sha }} + build-args: TESTS=1 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 5e9684d..df456d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,25 +1,31 @@ -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 +ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm +ARG IMAGE=intersystemsdc/iris-community:2020.4.0.547.0-zpm +ARG IMAGE=containers.intersystems.com/intersystems/iris:2021.1.0.215.0 ARG IMAGE=intersystemsdc/iris-community FROM $IMAGE -USER root +WORKDIR /home/irisowner/irisbuild -WORKDIR /opt/irisapp -RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp +## install git +## USER root +##RUN apt update && apt-get -y install git +##USER ${ISC_PACKAGE_MGRUSER} -USER irisowner +ARG TESTS=0 +ARG MODULE="dc-sample-template" +ARG NAMESPACE="IRISAPP" -COPY Installer.cls . -COPY src src -COPY irissession.sh / -SHELL ["/irissession.sh"] +## Embedded Python environment +ENV IRISUSERNAME "_SYSTEM" +ENV IRISPASSWORD "SYS" +ENV IRISNAMESPACE $NAMESPACE +ENV PYTHON_PATH=/usr/irissys/bin/ +ENV PATH "/usr/irissys/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/irisowner/bin" -RUN \ - do $SYSTEM.OBJ.Load("Installer.cls", "ck") \ - set sc = ##class(App.Installer).setup() -# bringing the standard shell back -SHELL ["/bin/bash", "-c"] +RUN --mount=type=bind,src=.,dst=. \ + #pip3 install -r requirements.txt && \ + iris start IRIS && \ + iris session IRIS < iris.script && \ + ([ $TESTS -eq 0 ] || iris session iris -U $NAMESPACE "##class(%ZPM.PackageManager).Shell(\"test $MODULE -v -only\",1,1)") && \ + iris stop IRIS quietly diff --git a/Installer.cls b/Installer.cls deleted file mode 100644 index 91b0bd4..0000000 --- a/Installer.cls +++ /dev/null @@ -1,32 +0,0 @@ -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/docker-compose.yml b/docker-compose.yml index a41ee12..5a0a647 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,11 +5,10 @@ services: context: . dockerfile: Dockerfile restart: always - ports: + command: --check-caps false + ports: - 1972 - - 51773 - 52773 - 53773 volumes: - - ~/iris.key:/usr/irissys/mgr/iris.key - - ./:/irisdev/app + - ./:/irisrun/repo diff --git a/iris.script b/iris.script new file mode 100755 index 0000000..28ba16c --- /dev/null +++ b/iris.script @@ -0,0 +1,21 @@ + // Unexpire passwords to simplify dev mode. Comment these two lines for Production use + zn "%SYS" + Do ##class(Security.Users).UnExpireUserPasswords("*") + + ; enabling callin for Embedded Python + do ##class(Security.Services).Get("%Service_CallIn",.prop) + set prop("Enabled")=1 + set prop("AutheEnabled")=48 + do ##class(Security.Services).Modify("%Service_CallIn",.prop) + + // create IRISAPP namespace + do $SYSTEM.OBJ.Load("/home/irisowner/irisbuild/Installer.cls", "ck") + set sc = ##class(App.Installer).setup() + + + // load all the code of the project as a ZPM package + zn "IRISAPP" + do ##class(dev.code).workdir("/irisrun/repo/src") + + zpm "load /home/irisowner/irisbuild/ -v":1:1 + halt diff --git a/irissession.sh b/irissession.sh deleted file mode 100755 index 8f4a51d..0000000 --- a/irissession.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/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 diff --git a/src/dev/FileManExtension.cls b/src/dev/FileManExtension.cls index 60bc517..482e3f7 100755 --- a/src/dev/FileManExtension.cls +++ b/src/dev/FileManExtension.cls @@ -154,7 +154,7 @@ Method OnAfterDelete(InternalName As %String) As %Status set dir = ##class(%File).ParentDirectoryName(fileName) - while dir '= ..workdir() + while dir '= ##class(dev.code).workdir() { set rs = ##class(%File).FileSetFunc(dir, , , 1) quit:rs.%Next()=1 diff --git a/src/dev/code.cls b/src/dev/code.cls index 41bceba..a8f5a91 100755 --- a/src/dev/code.cls +++ b/src/dev/code.cls @@ -211,11 +211,17 @@ ClassMethod exportDeepSeeArtefacts() As %Status set artefact = $list(artefacts,i) continue:$data(@("^"_artefact))=0 + ; set artefact = artefact_".GBL" set filename = ..filename(artefact) - do ..mkdir(filename) - - set sc = ..fixXMLLine(artefact, filename_".xml") + set filename=$p(filename,".GBL") + set fileglobalname=$p(filename,"gbl")_"gbl/" + set fileglobalname=fileglobalname_$tr($p($p(filename,"gbl",2),"/",2,*),"/",".") + ; + ;B "L" + ;do ..mkdir(filename) + + set sc = ..fixXMLLine(artefact, fileglobalname_".xml") } return sc @@ -312,7 +318,7 @@ ClassMethod inFilter(ByRef filtermask, filename) As %Boolean /// get the filtermask for the repository. /// looks for .gitignore file and applies all the lines to filters -ClassMethod setIgnore(ByRef filtermask,verbose) +ClassMethod setIgnore(ByRef filtermask, verbose) { // working with .gitignore file // gitignore consists of masks of filtering files