Hi Developers!
Often I find questions on how to install IRIS, connect to IRIS from IDE, setup the environment, compile, debug, maintain the repository.
Here below possibly the shortest way to set up all the environment and start development with ObjectScript on InterSystems IRIS.
Prerequisites
Make sure you have Git, Docker, and VSCode installed
Install Docker and ObjectScript extensions into VSCode
Sign in or Create an account on Github
Here we go!
To start development you do the following:
- Use the template repository and create your own repository on Github.
- Clone your repository with git on your desktop in terminal
- Open repository in VSCode
- Use docker-compose.yml to build the container with InterSystems IRIS and import all the ObjectScript from /src folder into USER namespace of IRIS container.
- Open a terminal to IRIS and call the imported ObjectScript code
- Make a change to ObjectScript code and compile it
- Commit and push changes to your GitHub repository
Check the screencast below:
Or check the long video with all the explanations.
What's next? Start learning ObjectScript with Online Learning and Documentation.
Also check Beginner posts, Best Practices and ObjectScript code guidelines.
Happy coding!
Noticed some good stuff in @Dmitry.Maslennikov's iris-template repo and updated mine foundation template for development with IRIS Community Edition in ObjectScript.
It's much easier now to run ObjectScript instructions in Dockerfile. Check the basic Dockerfie:
And another which installs ZPM and Webterminal:
First, thanks for this. It go me up and running pretty fast (as title says!). Couple of things:
- The notes/documentation say that code will be loaded into USER namespace, however it's actually being loaded into IRISAPP (as configured in docckerfiles).
- The jason.config is pointing to USER namespace so any new files and changes to existing will be actually loaded into USER instead of IRISAPP
- Make sure it's all consistent
- The webapp (irisweb) is missing a config for the directory where to store files. I fixed this by modifying the app in management portal. Need to address the installation file/dockerfile
- Haven't been able to make CSPs flow to the container the same as classes. I'm sure I'm missing something but haven't figured out what yet. Any tips? Maybe I'm placing files in the wrong location? Right now I created a csp/irisweb folder under src folder.
Because I made an update to the code recently) And not to the documentation) PR is welcome, or I'll change it by myself soon. Or add an issue!
Yes, it's a bug from previous version. Need to be fixed, thanks!
Cool!
Do you want to make a PR?
You need to COPY this files from /csp in sources to /usr/irissys/mgr/csp/yourwebapp in Dockerfile
OK, I'll give it a try and create a PR once I have a new config file. Thanks!
Hi @Warlin Garcia !
I pushed the commit into the repo which fixes Namespace and README issue, thanks!
Thank you. I'll check on it.
Do you have any tips to make csp changes flow in realtime the same as classes do? I've modified the dockerfile to copy the contents of my csp directory into the container, however my edits to CSPs are not flowing realtime which forces me to rebuild the container everytime to get my updates.
Sure!
just add the volume mapping in docker-compose.yml file which maps folder /csp in sources into /csp directory in docker.
Got it all working. Thank you!
Updated the Installer.cls file - now you can set up the namespace and path in variables "Namespace" and "app" respectfully at the top of Installer.cls.
<Default Name="Namespace" Value="IRISAPP"/>
<Default Name="app" Value="irisapp" />
This is convenient if you need to install the app to the namespace with your name.
Notice, that if you want instantly edit and compile the code of your project with VSCode don't forget to change the Namespace parameter in settings.json too.