Skip to content

Commit 0089fe3

Browse files
committed
Docker environment for developing on the package itself
1 parent 896874c commit 0089fe3

5 files changed

Lines changed: 81 additions & 1 deletion

File tree

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
**/node_modules

CONTRIBUTING.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,51 @@ Thank you for your interest in contributing! While this project originated at In
44

55
## Getting Started
66

7-
We recommend setting up a local development instance by following these steps:
7+
### Developing in Docker Containers
8+
9+
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.
10+
11+
#### Prerequisites
12+
13+
- [Docker](https://www.docker.com/get-started/) installed and running
14+
- [VS Code](https://code.visualstudio.com/) with the [InterSystems ObjectScript Extension Pack](https://marketplace.visualstudio.com/items?itemName=intersystems-community.objectscript-pack)
15+
16+
#### Setup
17+
18+
```bash
19+
git clone https://github.com/intersystems/git-source-control
20+
cd git-source-control
21+
git checkout -b <new-branch-name>
22+
docker compose up -d --build
23+
```
24+
25+
This spins up a single container:
26+
- **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.
27+
28+
#### Important Notes
29+
30+
- The repository is mounted at `/home/irisowner/dev/git-source-control/` inside the container.
31+
- If port 52774 is already in use, edit the port mapping in `docker-compose.yml`.
32+
- If you have an InterSystems license key at `~/iris.key`, it will be mounted into the container automatically.
33+
34+
#### Development
35+
36+
Make changes locally and compile them via VS Code. To access the IRIS terminal in the container:
37+
38+
```bash
39+
docker compose exec -it iris iris session iris
40+
```
41+
42+
To run the unit tests from the IRIS terminal:
43+
44+
```
45+
zpm "git-source-control test -only -verbose"
46+
```
47+
48+
### Developing on an Existing IRIS Instance
49+
50+
If you prefer to use an existing IRIS installation:
51+
852
1. Install an instance of IRIS (go to https://evaluation.intersystems.com/ for an evaluation kit).
953
2. Install IPM (InterSystems Package Manager) (https://github.com/intersystems/ipm).
1054
3. Clone a copy of the Embedded Git repository to disk using `git clone`.

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ARG BASE=containers.intersystems.com/intersystems/iris-community:2025.1
2+
3+
FROM ${BASE}
4+
5+
USER root
6+
RUN apt-get update && apt-get install -y git nodejs npm
7+
8+
RUN --mount=type=bind,src=.,dst=/home/irisowner/dev/git-source-control/,rw \
9+
chown -R irisowner:irisowner /home/irisowner/dev/git-source-control/ && \
10+
su - irisowner -c "iris start iris" && \
11+
su - irisowner -c "iris session IRIS < /home/irisowner/dev/git-source-control/iris.script" && \
12+
su - irisowner -c "iris stop iris quietly"
13+
14+
USER irisowner
15+
16+

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
iris:
3+
build: .
4+
restart: always
5+
ports:
6+
- 52774:52773
7+
volumes:
8+
- ~/iris.key:/usr/irissys/mgr/iris.key
9+
- ./:/home/irisowner/dev/git-source-control/
10+
command:
11+
- -a
12+
- iris session iris -U%SYS '##class(Security.Users).UnExpireUserPasswords("*")'

iris.script

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
zn "USER"
2+
// install IPM
3+
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")
4+
// Load git-source-control in dev mode
5+
zpm "load /home/irisowner/dev/git-source-control/ -dev -verbose"
6+
7+
halt

0 commit comments

Comments
 (0)