Skip to content

Commit 403072c

Browse files
committed
some build automation
1 parent c816c92 commit 403072c

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
build-for-zpm/*
2+
export/*
3+
readme.md

Dockerfile-build-npm

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
ARG IMAGE=intersystemsdc/iris-community
2+
FROM $IMAGE
3+
4+
USER root
5+
6+
# install curl
7+
RUN apt update && apt install curl -y
8+
9+
# set env
10+
ENV NVM_DIR=/root/.nvm
11+
12+
# install nvm
13+
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
14+
15+
# install node
16+
RUN bash -c "source $NVM_DIR/nvm.sh && nvm install 10 && nvm use 10"
17+
18+
# copy code
19+
WORKDIR /opt/irisapp
20+
COPY src ./src
21+
COPY gulpfile.js .
22+
COPY package.json .
23+
COPY iris-build-npm.script .
24+
25+
# build npm
26+
RUN bash -c "source $NVM_DIR/nvm.sh && npm install && npm run gulp"
27+
28+
RUN mkdir /opt/irisapp/export/
29+
RUN chown -R ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisapp
30+
USER ${ISC_PACKAGE_MGRUSER}
31+
32+
# import/export IRIS
33+
RUN iris start iris && \
34+
iris session iris < iris-build-npm.script && \
35+
iris stop iris quietly

iris-build-npm.script

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
do $SYSTEM.OBJ.LoadDir("/opt/irisapp/src/","c",,1)
2+
do $SYSTEM.OBJ.ExportPackage("ClassExplorer", "/opt/irisapp/export/ClassExplorer-v0.xml")
3+
4+
halt

readme.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ application.
4646

4747
## Development
4848

49+
### Local
50+
4951
To build project, you need [NodeJS](https://nodejs.org) platform to be installed. Then, clone source
5052
code and run <code>npm install</code> from the root of the project. This will install all necessary
5153
modules from NPM for the project.
@@ -61,6 +63,17 @@ One can import/export the built source to the local Cache/URIS instance (see `im
6163

6264
This will bring `ClassExplorer-v*.*.*.xml` to the `build` directory, which you can then package with `npm run zip`.
6365

66+
### Using docker
67+
68+
:warning: incomplete procedure
69+
70+
```Shell
71+
docker build -f .\Dockerfile-build-npm -t build-npm .
72+
docker run --rm -d --name build-npm build-npm
73+
docker cp build-npm:/opt/irisapp/
74+
docker stop build-npm
75+
```
76+
6477
### ZPM
6578

6679
[ZPM](https://github.com/intersystems-community/zpm) is the package manager for InterSystems products. Currently,

0 commit comments

Comments
 (0)