Skip to content

Commit b078098

Browse files
committed
Prepare package for zpm publicaton
1 parent b541c15 commit b078098

File tree

8 files changed

+99
-0
lines changed

8 files changed

+99
-0
lines changed

.dockerignore

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

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sh eol=lf

.gitignore

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

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ARG IMAGE=intersystems/iris:2019.1.0S.111.0
2+
ARG IMAGE=store/intersystems/irishealth:2019.3.0.308.0-community
3+
ARG IMAGE=store/intersystems/iris-community:2019.3.0.309.0
4+
ARG IMAGE=intersystemsdc/iris-community:2020.2.0.196.0-zpm
5+
FROM $IMAGE
6+
7+
USER root
8+
9+
WORKDIR /opt/irisapp
10+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
11+
COPY irissession.sh /
12+
RUN chmod +x /irissession.sh
13+
14+
USER ${ISC_PACKAGE_MGRUSER}
15+
COPY Installer.cls .
16+
COPY src src
17+
SHELL ["/irissession.sh"]
18+
RUN \
19+
do $SYSTEM.OBJ.Load("Installer.cls", "ck") \
20+
set sc = ##class(App.Installer).setup()
21+
22+
# bringing the standard shell back
23+
SHELL ["/bin/bash", "-c"]
24+
CMD [ "-l", "/usr/irissys/mgr/messages.log" ]

Installer.cls

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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="IRISAPP"/>
9+
<Default Name="app" Value="irisapp" />
10+
11+
<Namespace Name="${Namespace}" Code="${Namespace}" Data="${Namespace}" Create="yes" Ensemble="no">
12+
<Configuration>
13+
<Database Name="${Namespace}" Dir="/opt/${app}/data" Create="yes" Resource="%DB_${Namespace}"/>
14+
<Import File="${SourceDir}" Flags="ck" Recurse="1"/>
15+
</Configuration>
16+
</Namespace>
17+
18+
</Manifest>
19+
}
20+
21+
ClassMethod setup(ByRef pVars, pLogLevel As %Integer = 3, pInstaller As %Installer.Installer, pLogger As %Installer.AbstractLogger) As %Status [ CodeMode = objectgenerator, Internal ]
22+
{
23+
#; Let XGL document generate code for this method.
24+
Quit ##class(%Installer.Manifest).%Generate(%compiledclass, %code, "setup")
25+
}
26+
27+
}

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.6'
2+
services:
3+
iris:
4+
build:
5+
context: .
6+
dockerfile: Dockerfile
7+
restart: always
8+
ports:
9+
- 51773
10+
- 52773
11+
- 53773
12+
volumes:
13+
- ~/iris.key:/usr/irissys/mgr/iris.key
14+
- ./:/irisdev/app

irissession.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
iris start $ISC_PACKAGE_INSTANCENAME quietly
4+
5+
cat << EOF | iris session $ISC_PACKAGE_INSTANCENAME -U %SYS
6+
do ##class(%SYSTEM.Process).CurrentDirectory("$PWD")
7+
$@
8+
if '\$Get(sc) do ##class(%SYSTEM.Process).Terminate(, 1)
9+
zn "%SYS"
10+
do ##class(SYS.Container).QuiesceForBundling()
11+
Do ##class(Security.Users).UnExpireUserPasswords("*")
12+
halt
13+
EOF
14+
15+
exit=$?
16+
17+
iris stop $ISC_PACKAGE_INSTANCENAME quietly
18+
19+
exit $exit

module.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Export generator="Cache" version="25">
3+
<Document name="github-api.ZPM">
4+
<Module>
5+
<Name>github-api</Name>
6+
<Version>1.0.0</Version>
7+
<Packaging>module</Packaging>
8+
<Resource Name="src.cls.GitHub.PKG"/>
9+
</Module>
10+
</Document>
11+
</Export>

0 commit comments

Comments
 (0)