Skip to content

Commit e822060

Browse files
Evgeny ShvarovEvgeny Shvarov
authored andcommitted
updated docker
1 parent 08d9627 commit e822060

13 files changed

Lines changed: 253 additions & 67 deletions

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
**/.DS_Store
2+
.git

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.sh text eol=lf
2+
*.cls text eol=lf
3+
*.mac text eol=lf
4+
*.int text eol=lf
5+
Dockerfil* text eol=lf
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+

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
.DS*
1+
.DS_Store
2+
3+

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "objectscript",
6+
"request": "launch",
7+
"name": "ObjectScript Debug Class",
8+
"program": "##class(PackageSample.ObjectScript).Test()",
9+
},
10+
{
11+
"type": "objectscript",
12+
"request": "attach",
13+
"name": "ObjectScript Attach",
14+
"processId": "${command:PickProcess}",
15+
"system": true
16+
}
17+
]
18+
}

.vscode/settings.json

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
{
2-
"objectscript.conn": {
3-
"active": true,
4-
"port": 52774,
5-
"user": "admin",
6-
"password": "SYS",
7-
"ns": "DCANALYTICS"
8-
},
9-
"objectscript.conn.version": 3,
10-
"objectscript.conn.active": true,
11-
"objectscript.export.addCategory": true
2+
"objectscript.conn" :{
3+
"ns": "DCANALYTICS",
4+
"active": true,
5+
"docker-compose": {
6+
"service": "iris",
7+
"internalPort": 52773
8+
},
9+
"links": {
10+
"RESTForms2-UI": "http://localhost:${port}/restforms2-ui/index.html"
11+
12+
}
13+
}
14+
1215
}

Dockerfile

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,49 @@
11
ARG IMAGE=store/intersystems/iris:2019.1.0.511.0-community
22
ARG IMAGE=store/intersystems/iris:2019.2.0.107.0-community
3+
ARG IMAGE=intersystemsdc/iris-community:2020.2.0.204.0-zpm
34
FROM $IMAGE
45

5-
WORKDIR /opt/app
6-
7-
COPY ./src/ ./src/
6+
USER root
7+
WORKDIR /opt/dcanalytics
8+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/dcanalytics
9+
COPY irissession.sh /
10+
RUN chmod +x /irissession.sh
811

912
RUN mkdir -p /tmp/deps \
10-
1113
&& cd /tmp/deps \
12-
13-
&& wget -q https://pm.community.intersystems.com/packages/zpm/latest/installer -O zpm.xml \
14-
1514
# Download globals data
1615
&& wget -q -O - https://api.github.com/repos/intersystems-community/dc-analytics/releases/latest \
1716
| egrep 'http.*DCAnalytics_globals.*gz' \
1817
| cut -d : -f 2,3 \
1918
| tr -d '"' \
2019
| wget -O - -i - \
21-
| gunzip > /opt/app/globals.xml
22-
23-
RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
24-
/bin/echo -e "sys\nsys\n" \
25-
" do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \
26-
" do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \
27-
" do \$system.OBJ.Load(\"/opt/app/dswinstaller.cls\",\"ck\")\n" \
28-
" do ##class(Security.System).Get(,.p)\n" \
29-
" set p(\"AutheEnabled\")=\$zb(p(\"AutheEnabled\"),16,7)\n" \
30-
" do ##class(Security.System).Modify(,.p)\n" \
31-
" Do \$system.OBJ.Load(\"/tmp/deps/zpm.xml\", \"ck\")" \
32-
" do CreateDatabase^%SYS.SQLSEC(\"DCANALYTICS\",\"\",,0)\n" \
33-
" zn \"DCANALYTICS\"" \
34-
" zpm \"install dsw\"" \
35-
" do \$system.OBJ.ImportDir(\"/opt/app/src\",,\"ck\",,1)\n" \
36-
" do ##class(Community.Utils).setup(\"/opt/app/globals.xml\")" \
37-
" zn \"%sys\"" \
38-
" write \"Create web application ...\",!" \
39-
" set webName = \"/csp/dcanalytics\"" \
40-
" set webProperties(\"NameSpace\") = \"DCANALYTICS\"" \
41-
" set webProperties(\"Enabled\") = 1" \
42-
" set webProperties(\"IsNameSpaceDefault\") = 1" \
43-
" set webProperties(\"CSPZENEnabled\") = 1" \
44-
" set webProperties(\"AutheEnabled\") = 32" \
45-
" set webProperties(\"iKnowEnabled\") = 1" \
46-
" set webProperties(\"DeepSeeEnabled\") = 1" \
47-
" set status = ##class(Security.Applications).Create(webName, .webProperties)" \
48-
" write:'status \$system.Status.DisplayError(status)" \
49-
" write \"Web application \"\"\"_webName_\"\"\" was created!\",!" \
50-
" zn \"DCANALYTICS\"" \
51-
" halt" \
52-
| iris session $ISC_PACKAGE_INSTANCENAME && \
53-
/bin/echo -e "sys\nsys\n" \
54-
| iris stop $ISC_PACKAGE_INSTANCENAME quietly
55-
56-
RUN apt update && apt install -y git && git clone https://github.com/intersystems-community/dsw-reports.git && cp -r dsw-reports/src/web/reports /usr/irissys/csp/dsw/ && cp -r src/reports /usr/irissys/csp/dsw/ && rm -rf dsw-reports
57-
58-
COPY ./other/dcanalytics.json /usr/irissys/csp/dsw/configs/
59-
60-
COPY ./fixoverlay.sh ./
61-
62-
CMD [ "-b", "/opt/app/fixoverlay.sh" ]
20+
| gunzip > /opt/dcanalytics/globals.xml
21+
22+
23+
USER ${ISC_PACKAGE_MGRUSER}
24+
25+
COPY Installer.cls .
26+
COPY src src
27+
SHELL ["/irissession.sh"]
28+
29+
RUN \
30+
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
31+
set sc = ##class(App.Installer).setup() \
32+
zn "DCANALYTICS" \
33+
zpm "install dsw" \
34+
zpm "install isc-dev" \
35+
do ##class(dev.code).workdir("/irisdev/app/src") \
36+
do EnableDeepSee^%SYS.cspServer("/csp/dcanalytics/") \
37+
do ##class(Community.Utils).setup("/opt/dcanalytics/globals.xml") \
38+
zn "%SYS" \
39+
write "Modify MDX2JSON application security...",! \
40+
set webName = "/mdx2json" \
41+
set webProperties("AutheEnabled") = 64 \
42+
set webProperties("MatchRoles")=":%DB_IRISAPP" \
43+
set sc = ##class(Security.Applications).Modify(webName, .webProperties) \
44+
45+
46+
SHELL ["/bin/bash", "-c"]
47+
48+
COPY /dsw/dcanalytics.json /usr/irissys/csp/dsw/configs/
49+

Dockerfile_old

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
ARG IMAGE=store/intersystems/iris:2019.1.0.511.0-community
2+
ARG IMAGE=store/intersystems/iris:2019.2.0.107.0-community
3+
ARG IMAGE=intersystemsdc/iris-community:2020.2.0.204.0-zpm
4+
FROM $IMAGE
5+
6+
USER root
7+
WORKDIR /opt/irisapp
8+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
9+
COPY irissession.sh /
10+
RUN chmod +x /irissession.sh
11+
12+
RUN mkdir -p /tmp/deps \
13+
14+
&& cd /tmp/deps \
15+
16+
# Download globals data
17+
&& wget -q -O - https://api.github.com/repos/intersystems-community/dc-analytics/releases/latest \
18+
| egrep 'http.*DCAnalytics_globals.*gz' \
19+
| cut -d : -f 2,3 \
20+
| tr -d '"' \
21+
| wget -O - -i - \
22+
| gunzip > /opt/irisapp/globals.xml
23+
24+
25+
USER ${ISC_PACKAGE_MGRUSER}
26+
27+
COPY Installer.cls .
28+
COPY src src
29+
SHELL ["/irissession.sh"]
30+
31+
RUN \
32+
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
33+
set sc = ##class(App.Installer).setup() \
34+
zn "DCANALYTICS" \
35+
zpm "install dsw" \
36+
zpm "install isc-dev" \
37+
do ##class(dev.code).workdir("/irisdev/app/src") \
38+
do EnableDeepSee^%SYS.cspServer("/csp/dcanalytics/") \
39+
do ##class(Community.Utils).setup("/opt/irisapp/globals.xml") \
40+
zn "%SYS" \
41+
write "Modify MDX2JSON application security...",! \
42+
set webName = "/mdx2json" \
43+
set webProperties("AutheEnabled") = 64 \
44+
set webProperties("MatchRoles")=":%DB_IRISAPP" \
45+
set sc = ##class(Security.Applications).Modify(webName, .webProperties) \
46+
47+
48+
RUN iris start $ISC_PACKAGE_INSTANCENAME quietly EmergencyId=sys,sys && \
49+
/bin/echo -e "sys\nsys\n" \
50+
" do ##class(Security.Users).UnExpireUserPasswords(\"*\")\n" \
51+
" do ##class(Security.Users).AddRoles(\"admin\", \"%ALL\")\n" \
52+
" do \$system.OBJ.Load(\"/opt/app/dswinstaller.cls\",\"ck\")\n" \
53+
" do ##class(Security.System).Get(,.p)\n" \
54+
" set p(\"AutheEnabled\")=\$zb(p(\"AutheEnabled\"),16,7)\n" \
55+
" do ##class(Security.System).Modify(,.p)\n" \
56+
" Do \$system.OBJ.Load(\"/tmp/deps/zpm.xml\", \"ck\")" \
57+
" do CreateDatabase^%SYS.SQLSEC(\"DCANALYTICS\",\"\",,0)\n" \
58+
" zn \"DCANALYTICS\"" \
59+
" zpm \"install dsw\"" \
60+
" do \$system.OBJ.ImportDir(\"/opt/app/src\",,\"ck\",,1)\n" \
61+
" do ##class(Community.Utils).setup(\"/opt/app/globals.xml\")" \
62+
" zn \"%sys\"" \
63+
" write \"Create web application ...\",!" \
64+
" set webName = \"/csp/dcanalytics\"" \
65+
" set webProperties(\"NameSpace\") = \"DCANALYTICS\"" \
66+
" set webProperties(\"Enabled\") = 1" \
67+
" set webProperties(\"IsNameSpaceDefault\") = 1" \
68+
" set webProperties(\"CSPZENEnabled\") = 1" \
69+
" set webProperties(\"AutheEnabled\") = 32" \
70+
" set webProperties(\"iKnowEnabled\") = 1" \
71+
" set webProperties(\"DeepSeeEnabled\") = 1" \
72+
" set status = ##class(Security.Applications).Create(webName, .webProperties)" \
73+
" write:'status \$system.Status.DisplayError(status)" \
74+
" write \"Web application \"\"\"_webName_\"\"\" was created!\",!" \
75+
" zn \"DCANALYTICS\"" \
76+
" halt" \
77+
| iris session $ISC_PACKAGE_INSTANCENAME && \
78+
/bin/echo -e "sys\nsys\n" \
79+
| iris stop $ISC_PACKAGE_INSTANCENAME quietly
80+
81+
RUN apt update && apt install -y git && git clone https://github.com/intersystems-community/dsw-reports.git && cp -r dsw-reports/src/web/reports /usr/irissys/csp/dsw/ && cp -r src/reports /usr/irissys/csp/dsw/ && rm -rf dsw-reports
82+
83+
COPY ./other/dcanalytics.json /usr/irissys/csp/dsw/configs/
84+
85+
COPY ./fixoverlay.sh ./
86+
87+
CMD [ "-b", "/opt/app/fixoverlay.sh" ]

Installer.cls

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Class App.Installer
2+
{
3+
4+
XData setup
5+
{
6+
<Manifest>
7+
<Default Name="SourceDir" Value="#{$system.Process.CurrentDirectory()}src"/>
8+
<Default Name="Namespace" Value="DCANALYTICS"/>
9+
<Default Name="app" Value="dcanalytics" />
10+
11+
<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">
12+
13+
<Configuration>
14+
<Database Name="${Namespace}" Dir="/opt/${app}/data" Create="yes" Resource="%DB_${Namespace}"/>
15+
16+
<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
17+
</Configuration>
18+
<CSPApplication Url="/csp/${app}" Directory="${cspdir}${app}" ServeFiles="1" Recurse="1" MatchRoles=":%DB_${Namespace}" AuthenticationMethods="32"
19+
20+
/>
21+
</Namespace>
22+
23+
</Manifest>
24+
}
25+
26+
ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
27+
{
28+
#; Let XGL document generate code for this method.
29+
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
30+
}
31+
32+
}

dev.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1+
## export globals from COMMUNITYPUBLIC
12
```
2-
// export globals from COMMUNITYPUBLIC
3+
34
set gbl="Com*D.GBL,His*D.GBL"
45
s fn="DCPublic_globals.gz"
56
s s=##class(%Stream.FileBinaryGzip).%New() do s.LinkToFile(fn) do $System.OBJ.ExportToStream(gbl,s,"/mapped") do s.%Save() kill s
7+
68
```
9+
10+
## build container with no cache
11+
```
12+
docker-compose build --no-cache
13+
```
14+
## open terminal to docker
15+
```
16+
docker-compose exec iris iris session iris -U IRISAPP
17+
```
18+
19+
## global export
20+
$System.OBJ.Export("GlobalName.GBL","/irisdev/app/src/gbl/globalname.xml")
21+
```

0 commit comments

Comments
 (0)