Skip to content

Commit ebc8f43

Browse files
committed
global bugfix with zpm and clean up
1 parent fb72c58 commit ebc8f43

9 files changed

Lines changed: 73 additions & 104 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: objectscriptquality
2+
on: push
3+
4+
jobs:
5+
linux:
6+
name: Linux build
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Execute ObjectScript Quality Analysis
11+
run: wget https://raw.githubusercontent.com/litesolutions/objectscriptquality-jenkins-integration/master/iris-community-hook.sh && sh ./iris-community-hook.sh
12+

.vscode/settings.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,32 @@
22
"files.associations": {
33

44
"Dockerfile*": "dockerfile",
5+
"iris.script": "objectscript"
56
},
6-
"objectscript.conn.active": true,
7-
"objectscript.conn.version": 3,
8-
"objectscript.conn.ns": "IRISAPP",
9-
"objectscript.conn.port": 52775 ,
10-
"objectscript.export.addCategory": true
7+
"objectscript.conn" :{
8+
"ns": "IRISAPP",
9+
"username": "_SYSTEM",
10+
"password": "SYS",
11+
"docker-compose": {
12+
"service": "iris",
13+
"internalPort": 52773
14+
},
15+
"active": true
16+
},
17+
"sqltools.connections": [
18+
{
19+
"namespace": "IRISAPP",
20+
"connectionMethod": "Server and Port",
21+
"showSystem": false,
22+
"previewLimit": 50,
23+
"server": "localhost",
24+
"port": 32770,
25+
"askForPassword": false,
26+
"driver": "InterSystems IRIS",
27+
"name": "objectscript-docker",
28+
"username": "_SYSTEM",
29+
"password": "SYS"
30+
}
31+
]
1132

1233
}

Dockerfile

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,23 @@
11
ARG IMAGE=intersystems/iris:2019.1.0S.111.0
22
ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0
33
ARG IMAGE=store/intersystems/iris-community:2019.4.0.379.0
4+
ARG IMAGE=intersystemsdc/iris-community
45
FROM $IMAGE
56

6-
USER root
7+
USER root
8+
## add git
9+
RUN apt update && apt-get -y install git
10+
11+
WORKDIR /opt/irisbuild
12+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisbuild
13+
USER ${ISC_PACKAGE_MGRUSER}
714

8-
WORKDIR /opt/irisapp
9-
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
10-
11-
12-
USER irisowner
13-
14-
RUN mkdir -p /tmp/deps \
15-
16-
&& cd /tmp/deps \
17-
18-
&& wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O zpm.xml
19-
20-
21-
COPY Installer.cls .
15+
#COPY Installer.cls .
2216
COPY src src
23-
COPY irissession.sh /
24-
25-
# running IRIS and open IRIS termninal in USER namespace
26-
SHELL ["/irissession.sh"]
27-
# below is objectscript executed in terminal
28-
# each row is what you type in terminal and Enter
29-
# zpm "install webterminal"
30-
RUN \
31-
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
32-
set sc = ##class(App.Installer).setup() \
33-
Do $system.OBJ.Load("/tmp/deps/zpm.xml", "ck") \
34-
zn "IRISAPP"
35-
17+
COPY Installer.cls Installer.cls
18+
COPY module.xml module.xml
19+
COPY iris.script iris.script
3620

37-
# bringing the standard shell back
38-
SHELL ["/bin/bash", "-c"]
39-
CMD [ "-l", "/usr/irissys/mgr/messages.log" ]
21+
RUN iris start IRIS \
22+
&& iris session IRIS < iris.script \
23+
&& iris stop IRIS quietly

Installer.cls

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,15 @@ Class App.Installer
44
XData setup
55
{
66
<Manifest>
7-
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}src"/>
87
<Default Name="Namespace" Value="IRISAPP"/>
9-
<Default Name="app" Value="irisapp" />
10-
<Default Name="restapp" Value="/rest-test" />
11-
8+
<Default Name="database" Value="irisapp"/>
9+
1210
<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">
1311

1412
<Configuration>
15-
<Database Name="${Namespace}" Dir="/opt/${app}/data" Create="yes" Resource="%DB_${Namespace}"/>
16-
17-
<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
13+
<Database Name="${Namespace}" Dir="${mgrdir}${database}/data" Create="yes" Resource="%DB_${Namespace}"/>
1814
</Configuration>
19-
<CSPApplication Url="/csp/${app}"
20-
Directory="${cspdir}${app}"
21-
ServeFiles="1"
22-
Recurse="1"
23-
Grant="%DB_${Namespace},%SQL"
24-
AuthenticationMethods="32"
25-
26-
/>
27-
<CSPApplication Url="${restapp}"
28-
Recurse="1"
29-
Directory="${cspdir}${restapp}"
30-
Grant="%DB_${Namespace},%SQL"
31-
AuthenticationMethods="96"
32-
/>
33-
3415
</Namespace>
35-
<Invoke Class="App.Installer" Method="SetDispatchClass">
36-
<Arg Value="${restapp}"/>
37-
<Arg Value="community.objectscript.RESTExample"/>
38-
</Invoke>
39-
40-
4116
</Manifest>
4217
}
4318

@@ -47,18 +22,4 @@ ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Install
4722
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
4823
}
4924

50-
ClassMethod SetDispatchClass(pApp As %String, pClass As %String) As %Status
51-
{
52-
New $Namespace
53-
Set $Namespace = "%SYS"
54-
Set tSC = ##class(Security.Applications).Get(pApp, .webProperties)
55-
If $$$ISERR(tSC) {
56-
Quit tSC
57-
}
58-
59-
Set webProperties("DispatchClass") = pClass
60-
Set tSC = ##class(Security.Applications).Modify(pApp, .webProperties)
61-
Quit tSC
62-
}
63-
6425
}

docker-compose.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ services:
33
iris:
44
build:
55
context: .
6-
dockerfile: ${DOCKERFILE:-Dockerfile}
6+
dockerfile: Dockerfile
77
restart: always
88
ports:
9-
- 51773
10-
- ${IRIS_PORT}:52773
9+
- 1972
10+
- 52773
1111
- 53773
1212
volumes:
13-
- ~/iris.key:/usr/irissys/mgr/iris.key
14-
- ./:/irisdev/app
15-
- ./src/csp:/usr/irissys/mgr/csp/irisapp
13+
- ./:/irisrun/repo

iris.script

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Unexpire passwords for dev mode
2+
zn "%SYS"
3+
Do ##class(Security.Users).UnExpireUserPasswords("*")
4+
5+
// create IRISAPP namespace
6+
do $SYSTEM.OBJ.Load("/opt/irisbuild/Installer.cls", "ck")
7+
set sc = ##class(App.Installer).setup()
8+
9+
10+
zn "IRISAPP"
11+
zpm "load /opt/irisbuild/ -v":1:1
12+
halt

irissession.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Document name="objectscript-package-template.ZPM">
44
<Module>
55
<Name>objectscript-package-template</Name>
6-
<Version>1.0.3</Version>
6+
<Version>1.0.4</Version>
77
<Packaging>module</Packaging>
88
<SourcesRoot>src</SourcesRoot>
99
<Resource Name="community.objectscript.PKG"/>
File renamed without changes.

0 commit comments

Comments
 (0)