Skip to content

Commit 15012ba

Browse files
committed
Initial commit
0 parents  commit 15012ba

File tree

15 files changed

+315
-0
lines changed

15 files changed

+315
-0
lines changed

.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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"files.associations": {
3+
4+
"Dockerfile*": "dockerfile",
5+
"iris.script": "objectscript"
6+
},
7+
"objectscript.conn" :{
8+
"ns": "USER",
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": "USER",
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+
]
32+
33+
}

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
ARG IMAGE=store/intersystems/iris-community:2020.1.0.204.0
2+
ARG IMAGE=intersystemsdc/iris-community:2020.1.0.209.0-zpm
3+
ARG IMAGE=intersystemsdc/iris-community:2020.2.0.204.0-zpm
4+
ARG IMAGE=intersystemsdc/irishealth-community:2020.3.0.200.0-zpm
5+
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.200.0-zpm
6+
ARG IMAGE=intersystemsdc/iris-community:2020.3.0.221.0-zpm
7+
ARG IMAGE=intersystemsdc/iris-community:2020.4.0.524.0-zpm
8+
FROM $IMAGE
9+
10+
USER root
11+
12+
WORKDIR /opt/irisbuild
13+
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisbuild
14+
USER ${ISC_PACKAGE_MGRUSER}
15+
16+
#COPY Installer.cls .
17+
COPY src src
18+
COPY module.xml module.xml
19+
COPY iris.script iris.script
20+
21+
RUN iris start IRIS \
22+
&& iris session IRIS < iris.script \
23+
&& iris stop IRIS quietly

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 InterSystems Developer Community
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## intersystems-objectscript-template
2+
This is a template for InterSystems ObjectScript Github repository.
3+
The template goes also with a few files which let you immedietly compile your ObjecScript files in InterSystems IRIS Community Edition in a docker container
4+
5+
## Prerequisites
6+
Make sure you have [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) and [Docker desktop](https://www.docker.com/products/docker-desktop) installed.
7+
8+
## Installation
9+
10+
Clone/git pull the repo into any local directory
11+
12+
```
13+
$ git clone https://github.com/intersystems-community/objectscript-docker-template.git
14+
```
15+
16+
Open the terminal in this directory and run:
17+
18+
```
19+
$ docker-compose build
20+
```
21+
22+
3. Run the IRIS container with your project:
23+
24+
```
25+
$ docker-compose up -d
26+
```
27+
28+
## How to Test it
29+
30+
Open IRIS terminal:
31+
32+
```
33+
$ docker-compose exec iris iris session iris
34+
USER>write ##class(dc.PackageSample.ObjectScript).Test()
35+
```
36+
## How to start coding
37+
This repository is ready to code in VSCode with ObjectScript plugin.
38+
Install [VSCode](https://code.visualstudio.com/), [Docker](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker) and [ObjectScript](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript) plugin and open the folder in VSCode.
39+
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
40+
![docker_compose](https://user-images.githubusercontent.com/2781759/76656929-0f2e5700-6547-11ea-9cc9-486a5641c51d.gif)
41+
42+
Feel free to delete PackageSample folder and place your ObjectScript classes in a form
43+
/src/Package/Classname.cls
44+
[Read more about folder setup for InterSystems ObjectScript](https://community.intersystems.com/post/simplified-objectscript-source-folder-structure-package-manager)
45+
46+
The script in Installer.cls will import everything you place under /src into IRIS.
47+
48+
49+
## What's inside the repository
50+
51+
### Dockerfile
52+
53+
The simplest dockerfile which starts IRIS and imports code from /src folder into it.
54+
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
55+
56+
57+
### .vscode/settings.json
58+
59+
Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript))
60+
61+
### .vscode/launch.json
62+
Config file if you want to debug with VSCode ObjectScript
63+
64+
[Read about all the files in this artilce](https://community.intersystems.com/post/dockerfile-and-friends-or-how-run-and-collaborate-objectscript-projects-intersystems-iris)

dev.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# useful commands
2+
## clean up docker
3+
```
4+
docker system prune -f
5+
```
6+
7+
## build container with no cache
8+
```
9+
docker-compose build --no-cache
10+
```
11+
## start iris container
12+
```
13+
docker-compose up -d
14+
```
15+
16+
## open iris terminal in docker
17+
```
18+
docker-compose exec iris iris session iris -U IRISAPP
19+
```
20+
21+
## install docker-compose
22+
```
23+
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
24+
25+
sudo chmod +x /usr/local/bin/docker-compose
26+
27+
```
28+
29+
## select zpm test registry
30+
```
31+
repo -n registry -r -url https://test.pm.community.intersystems.com/registry/ -user test -pass PassWord42
32+
```
33+
34+
## get back to public zpm registry
35+
```
36+
repo -r -n registry -url https://pm.community.intersystems.com/
37+
```
38+
39+
## export a global in runtime into the repo
40+
```
41+
d $System.OBJ.Export("GlobalD.GBL","/irisrun/repo/src/gbl/GlobalD.xml")
42+
```
43+
44+
## create a web app in dockerfile
45+
```
46+
zn "%SYS" \
47+
write "Create web application ...",! \
48+
set webName = "/csp/irisweb" \
49+
set webProperties("NameSpace") = "IRISAPP" \
50+
set webProperties("Enabled") = 1 \
51+
set webProperties("CSPZENEnabled") = 1 \
52+
set webProperties("AutheEnabled") = 32 \
53+
set webProperties("iKnowEnabled") = 1 \
54+
set webProperties("DeepSeeEnabled") = 1 \
55+
set sc = ##class(Security.Applications).Create(webName, .webProperties) \
56+
write "Web application "_webName_" has been created!",!
57+
```
58+
59+
zw ##class(community.csvgen).GenerateFromURL("https://github.com/h2oai/h2o-tutorials/raw/master/h2o-world-2017/automl/data/product_backorders.csv")
60+

0 commit comments

Comments
 (0)