From 0089fe3025b5ae0bcf48f5bf760737cf61866fb7 Mon Sep 17 00:00:00 2001 From: Pravin Barton <9560941+isc-pbarton@users.noreply.github.com> Date: Thu, 26 Feb 2026 17:18:26 -0500 Subject: [PATCH] Docker environment for developing on the package itself --- .dockerignore | 1 + CONTRIBUTING.md | 46 +++++++++++++++++++++++++++++++++++++++++++++- Dockerfile | 16 ++++++++++++++++ docker-compose.yml | 12 ++++++++++++ iris.script | 7 +++++++ 5 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100644 iris.script diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..cf709889 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +**/node_modules diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2d95cfd7..ae2c3825 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,7 +4,51 @@ Thank you for your interest in contributing! While this project originated at In ## Getting Started -We recommend setting up a local development instance by following these steps: +### Developing in Docker Containers + +The easiest way to get a working development environment is with Docker. This gives you an IRIS instance with git-source-control pre-installed in development mode. + +#### Prerequisites + +- [Docker](https://www.docker.com/get-started/) installed and running +- [VS Code](https://code.visualstudio.com/) with the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack) + +#### Setup + +```bash +git clone https://github.com/intersystems/git-source-control +cd git-source-control +git checkout -b +docker compose up -d --build +``` + +This spins up a single container: +- **git-source-control-iris-1**: an IRIS instance with git-source-control loaded in dev mode in the USER namespace. The management portal is published to the host at port 52774. + +#### Important Notes + +- The repository is mounted at `/home/irisowner/dev/git-source-control/` inside the container. +- If port 52774 is already in use, edit the port mapping in `docker-compose.yml`. +- If you have an InterSystems license key at `~/iris.key`, it will be mounted into the container automatically. + +#### Development + +Make changes locally and compile them via VS Code. To access the IRIS terminal in the container: + +```bash +docker compose exec -it iris iris session iris +``` + +To run the unit tests from the IRIS terminal: + +``` +zpm "git-source-control test -only -verbose" +``` + +### Developing on an Existing IRIS Instance + +If you prefer to use an existing IRIS installation: + 1. Install an instance of IRIS (go to https://evaluation.intersystems.com/ for an evaluation kit). 2. Install IPM (InterSystems Package Manager) (https://github.com/intersystems/ipm). 3. Clone a copy of the Embedded Git repository to disk using `git clone`. diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e4e31642 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +ARG BASE=containers.intersystems.com/intersystems/iris-community:2025.1 + +FROM ${BASE} + +USER root +RUN apt-get update && apt-get install -y git nodejs npm + +RUN --mount=type=bind,src=.,dst=/home/irisowner/dev/git-source-control/,rw \ + chown -R irisowner:irisowner /home/irisowner/dev/git-source-control/ && \ + su - irisowner -c "iris start iris" && \ + su - irisowner -c "iris session IRIS < /home/irisowner/dev/git-source-control/iris.script" && \ + su - irisowner -c "iris stop iris quietly" + +USER irisowner + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..1bae21bc --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +services: + iris: + build: . + restart: always + ports: + - 52774:52773 + volumes: + - ~/iris.key:/usr/irissys/mgr/iris.key + - ./:/home/irisowner/dev/git-source-control/ + command: + - -a + - iris session iris -U%SYS '##class(Security.Users).UnExpireUserPasswords("*")' diff --git a/iris.script b/iris.script new file mode 100644 index 00000000..b2ad4dd4 --- /dev/null +++ b/iris.script @@ -0,0 +1,7 @@ + zn "USER" + // install IPM + s version="latest" s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/"_version_"/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") + // Load git-source-control in dev mode + zpm "load /home/irisowner/dev/git-source-control/ -dev -verbose" + + halt