Skip to content

Commit

Permalink
update iris version and some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
isc-afuentes committed Sep 19, 2023
1 parent 103a62e commit 072bcb9
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"objectscript.conn": {
"active": true,
"active": false,
"ns": "USER",
"username": "superuser",
"server": "default~iris",
"docker-compose": {
"service": "iris"
"service": "iris-shared"
},
"links": {
"SOAP Wizard": "${serverUrl}/isc/studio/templates/%25ZEN.Template.AddInWizard.SOAPWizard.cls?Namespace=${namespace}${serverAuth}",
Expand Down
40 changes: 17 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
FROM intersystemsdc/irishealth-community:2022.1.0.209.0-zpm
ARG IMAGE=containers.intersystems.com/intersystems/irishealth-community:2023.1.0.229.0
FROM $IMAGE

USER root

Expand All @@ -16,28 +17,21 @@ RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*

COPY --chown=$ISC_PACKAGE_IRISMGR:$ISC_PACKAGE_IRISGROUP irissession.sh /
RUN chmod +x /irissession.sh
# create directory to copy files into image
WORKDIR /opt/irisapp
RUN chown -R irisowner:irisowner /opt/irisapp

USER ${ISC_PACKAGE_MGRUSER}
USER irisowner

# copy files to container
COPY install /opt/irisapp/install
COPY src /opt/irisapp/src
# copy files to image
WORKDIR /opt/irisapp
RUN mkdir -p /opt/irisapp/db
COPY --chown=irisowner:irisowner iris.script iris.script
COPY --chown=irisowner:irisowner src src
COPY --chown=irisowner:irisowner install install
COPY --chown=irisowner:irisowner Installer.cls Installer.cls

SHELL ["/irissession.sh"]
RUN \
zn "%SYS" \
do $SYSTEM.OBJ.Load("/opt/irisapp/src/Workshop/Installer.cls", "ck") \
# setup environment (namespaces, users, etc.)
set sc = ##class(Workshop.Installer).Run(.vars) \
# install git-source-control package (zpm)
zn "DEV" \
zpm "install git-source-control" \
zn "PROD" \
zpm "install git-source-control" \
set sc = 1

# bringing the standard shell back
SHELL ["/bin/bash", "-c"]
CMD [ "-l", "/usr/irissys/mgr/messages.log" ]
# run iris.script
RUN iris start IRIS \
&& iris session IRIS < /opt/irisapp/iris.script \
&& iris stop IRIS quietly
2 changes: 1 addition & 1 deletion src/Workshop/Installer.cls → Installer.cls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Class Workshop.Installer Extends %RegisteredObject
Class App.Installer Extends %RegisteredObject
{

XData Install [ XMLNamespace = INSTALLER ]
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,3 @@ services:
volumes:
# - ./iris.key:/usr/irissys/mgr/iris.key
- ./shared:/shared
command: --check-caps false
21 changes: 21 additions & 0 deletions iris.script
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// unexpire passwords for dev mode
new $namespace
set $namespace = "%SYS"
do ##class(Security.Users).UnExpireUserPasswords("*")

// install zpm
set r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c")

// load installer
do $SYSTEM.OBJ.Load("/opt/irisapp/Installer.cls", "ck")

// setup environment (namespaces, users, etc.)
set sc = ##class(App.Installer).Run(.vars)

// install git-source-control package (zpm)
set $namespace = "DEV"
zpm "install git-source-control"
set $namespace = "PROD"
zpm "install git-source-control"

halt
58 changes: 58 additions & 0 deletions src/Test/Person.cls
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Class Test.Person Extends %Persistent
{

Property Name As %String;

Property Surname As %String;

Property City As %String;

Property SSN As %String;

ClassMethod Create(name As %String, surname As %String, city As %String, ssn As %String) As %Status
{
set ret = $$$OK
try {
set object = ..%New()
set object.Name = name
set object.Surname = surname
set object.City = city
set object.SSN = ssn

$$$ThrowOnError(object.%Save())
set ret = object.%Id()

} catch ex {
set ret = ex.AsStatus()
}
quit ret
}

Storage Default
{
<Data name="PersonDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
<Value name="3">
<Value>Surname</Value>
</Value>
<Value name="4">
<Value>City</Value>
</Value>
<Value name="5">
<Value>SSN</Value>
</Value>
</Data>
<DataLocation>^Test.PersonD</DataLocation>
<DefaultData>PersonDefaultData</DefaultData>
<IdLocation>^Test.PersonD</IdLocation>
<IndexLocation>^Test.PersonI</IndexLocation>
<StreamLocation>^Test.PersonS</StreamLocation>
<Type>%Storage.Persistent</Type>
}

}

0 comments on commit 072bcb9

Please sign in to comment.