You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
start a new dev repository with InterSystems IRIS using this one as a template.
@@ -19,70 +21,169 @@ Once you clone the new repo on your laptop and open the VSCode with installed In
19
21
## Prerequisites
20
22
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.
THe sample repository contains two simplest examples of ObjectScript classes: ObjectScript method that returns value and method that creates a persistent record.
48
+
1.
49
+
Open IRIS terminal and run the ObjectScript Test() method to see if runs the script and returns values from IRIS:
This repository is ready to code in VSCode with ObjectScript plugin.
56
80
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.
57
81
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.
Feel free to delete PackageSample folder and place your ObjectScript classes in a form
61
-
/src/Package/Classname.cls
85
+
/src/organisation/package/Classname.cls
62
86
[Read more about folder setup for InterSystems ObjectScript](https://community.intersystems.com/post/simplified-objectscript-source-folder-structure-package-manager)
87
+
and her on the [naming convention]()
88
+
89
+
## running unittests
90
+
The template contains to test classes: TestObjectScript.cls and TestPersistentClass.cls
91
+
To run the unittests we can use Package Manager environment.
The script in Installer.cls will import everything you place under /src into IRIS.
141
+
## What else is inside the repository
65
142
143
+
### .github folder
144
+
it contains to github actions workflows:
145
+
1. github-registry.yml
146
+
Once changes pushed to the repo, the action builds the docker image on Github side and pushes the image to Github registry that can be very convenient to further cloud deployement, e.g. kubernetes.
147
+
2. objectscript-qaulity.yml
148
+
with every push to master or main branch the workflow launches the repo test on objectscript issues with Objectscript Quality tool, [see the examples](https://community.objectscriptquality.com/projects?sort=-analysis_date). This works if the repo is open-source only.
66
149
67
-
## What's inside the repository
150
+
Both workflows are repo agnostic: so they work with any repository where they exist.
68
151
69
-
### Dockerfile
152
+
### .vscode folder
153
+
it contains to files to setup vscode environment:
154
+
#### .vscode/settings.json
70
155
71
-
The simplest dockerfile which starts IRIS and imports code from /src folder into it.
72
-
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
156
+
Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript))
157
+
158
+
#### .vscode/launch.json
159
+
Config file if you want to debug with VSCode ObjectScript
contains a set of useful commands that will help during the development
82
171
83
-
Settings file to let you immedietly code in VSCode with [VSCode ObjectScript plugin](https://marketplace.visualstudio.com/items?itemName=daimor.vscode-objectscript))
172
+
### docker-compose.yml
173
+
a docker engine helper file to manage images building and rule ports mapping an the host to container folders(volumes) mapping
174
+
### Dockerfile
175
+
176
+
The simplest dockerfile which starts IRIS and imports code from /src folder into it.
177
+
Use the related docker-compose.yml to easily setup additional parametes like port number and where you map keys and host folders.
178
+
179
+
180
+
### iris.script
181
+
contains objectscript commands that are feeded to iris during the image building
182
+
183
+
### module.xml
184
+
IPM Module's description of the code in the repository.
185
+
It describes what is loaded with the method, how it is being tested and what apps neeed to be created, what files need to be copied.
84
186
85
-
### .vscode/launch.json
86
-
Config file if you want to debug with VSCode ObjectScript
87
187
88
188
[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)
do $SYSTEM.OBJ.ImportDir("/opt/irisbuild/src",, "ck")
71
-
```
75
+
```
76
+
77
+
78
+
### run tests described in the module
79
+
80
+
IRISAPP>zpm
81
+
IRISAPP:zpm>load /irisrun/repo
82
+
IRISAPP:zpm>test package-name
83
+
84
+
### install ZPM with one line
85
+
// Install ZPM
86
+
set $namespace="%SYS", name="DefaultSSL" do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name) set url="https://pm.community.intersystems.com/packages/zpm/latest/installer" Do ##class(%Net.URLParser).Parse(url,.comp) set ht = ##class(%Net.HttpRequest).%New(), ht.Server = comp("host"), ht.Port = 443, ht.Https=1, ht.SSLConfiguration=name, st=ht.Get(comp("path")) quit:'st $System.Status.GetErrorText(st) set xml=##class(%File).TempFilename("xml"), tFile = ##class(%Stream.FileBinary).%New(), tFile.Filename = xml do tFile.CopyFromAndSave(ht.HttpResponse.Data) do ht.%Close(), $system.OBJ.Load(xml,"ck") do ##class(%File).Delete(xml)
0 commit comments