Skip to content

Commit b7758c2

Browse files
committed
add Docker + :alias
1 parent d0a2d32 commit b7758c2

17 files changed

+420
-1
lines changed

.devcontainer/devcontainer.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.224.2/containers/docker-existing-docker-compose
3+
{
4+
"name": "intersystems-iris-dev-template devcontainer",
5+
6+
// Use the same recipe as creates the container we use when working locally.
7+
"dockerComposeFile": [
8+
"../docker-compose.yml"
9+
],
10+
11+
"service": "iris",
12+
13+
"workspaceFolder": "/home/irisowner/dev",
14+
15+
// This provides the elements of the connection object which require different values when connecting to the workspace within the container,
16+
// versus those in .vscode/settings.json which apply when operating locally on the workspace files.
17+
// We define and use a `server` so that (a) a user-level `objectscript.conn.server` properly doesn't override us, and (b) so InterSystems
18+
// Server Manager can also be used.
19+
"settings": {
20+
"objectscript.conn" :{
21+
"server": "devcontainer",
22+
"active": true,
23+
},
24+
"intersystems.servers": {
25+
"devcontainer": {
26+
"username": "SuperUser",
27+
"password": "SYS",
28+
"webServer": {
29+
"scheme": "http",
30+
"host": "127.0.0.1",
31+
"port": 52773
32+
},
33+
},
34+
},
35+
"python.defaultInterpreterPath":"/usr/irissys/bin/irispython"
36+
},
37+
38+
// Add the IDs of extensions we want installed when the container is created.
39+
// Currently (March 2022) `intersystems.language-server` fails to run within the container (alpine platform).
40+
// Issue is probably https://github.com/intersystems/language-server/issues/185 and/or https://github.com/intersystems/language-server/issues/32
41+
// Crash gets reported to the user, after which `intersystems-community.vscode-objectscript` falls back to
42+
// using its TextMate grammar for code coloring.
43+
"extensions": [
44+
"ms-python.python",
45+
"ms-python.vscode-pylance",
46+
"intersystems-community.vscode-objectscript",
47+
"intersystems.language-server",
48+
"intersystems-community.servermanager",
49+
"ms-vscode.docker"
50+
],
51+
}

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/.DS_Store
2+
iris-main.log
3+
.git

.github/workflows/build-push-gcr.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Cloud Run Deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
workflow_dispatch:
9+
10+
jobs:
11+
deploy:
12+
uses: intersystems-community/demo-deployment/.github/workflows/deployment.yml@master
13+
with:
14+
# Replace the name: parameter below to have your application deployed at
15+
# https://project-name.demo.community.intersystems.com/
16+
name: project-name
17+
secrets:
18+
# Do not forget to add Secret in GitHub Repoository Settings with name SERVICE_ACCOUNT_KEY
19+
SERVICE_ACCOUNT_KEY: ${{ secrets.SERVICE_ACCOUNT_KEY }}
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: versionbump
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
release:
9+
types:
10+
- released
11+
permissions:
12+
contents: write
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Bump version
20+
run: |
21+
git config --global user.name 'ProjectBot'
22+
git config --global user.email '[email protected]'
23+
VERSION=$(sed -n '0,/.*<Version>\(.*\)<\/Version>.*/s//\1/p' module.xml)
24+
VERSION=`echo $VERSION | awk -F. '/[0-9]+\./{$NF++;print}' OFS=.`
25+
sed -i "0,/<Version>\(.*\)<\/Version>/s//<Version>$VERSION<\/Version>/" module.xml
26+
git add module.xml
27+
git commit -m 'auto bump version'
28+
git push

.github/workflows/github-registry.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build and publish a Docker image to ghcr.io
2+
on:
3+
4+
# publish on pushes to the main branch (image tagged as "latest")
5+
# image name: will be: ghcr.io/${{ github.repository }}:latest
6+
# e.g.: ghcr.io/intersystems-community/intersystems-iris-dev-template:latest
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
docker_publish:
13+
runs-on: "ubuntu-20.04"
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
# https://github.com/marketplace/actions/push-to-ghcr
19+
- name: Build and publish a Docker image for ${{ github.repository }}
20+
uses: macbre/push-to-ghcr@master
21+
with:
22+
image_name: ${{ github.repository }}
23+
github_token: ${{ secrets.GITHUB_TOKEN }}
24+
# optionally push to the Docker Hub (docker.io)
25+
# docker_io_token: ${{ secrets.DOCKER_IO_ACCESS_TOKEN }} # see https://hub.docker.com/settings/security
+12
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+

.github/workflows/runtests.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: unittest
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
pull_request:
9+
branches:
10+
- master
11+
- main
12+
release:
13+
types:
14+
- released
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v2
21+
- name: Build and Test
22+
uses: docker/build-push-action@v2
23+
with:
24+
context: .
25+
push: false
26+
load: true
27+
tags: ${{ github.repository }}:${{ github.sha }}
28+
build-args: TESTS=1

.iris_init

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:alias enablebi do EnableDeepSee^%SYS.cspServer("/csp/"_$zcvt($namespace,"L")) ;
2+
:alias ssl x "n $namespace set $namespace=""%SYS"", name=$S(""$1""="""":""DefaultSSL"",1:""$1"") do:'##class(Security.SSLConfigs).Exists(name) ##class(Security.SSLConfigs).Create(name)" ;
3+
:alias createdb do $SYSTEM.SQL.Execute("CREATE DATABASE $1") ;
4+
:alias installipm s r=##class(%Net.HttpRequest).%New(),r.Server="pm.community.intersystems.com",r.SSLConfiguration="ISC.FeatureTracker.SSL.Config" d r.Get("/packages/zpm/latest/installer"),$system.OBJ.LoadStream(r.HttpResponse.Data,"c") ;
5+
:alias add%all x "n $namespace set $namespace=""%SYS"",P(""Globals"")=""%DEFAULTDB"",sc=##class(Config.Namespaces).Create(""%All"",.P)" ;
6+
:alias exportglobal d $System.OBJ.Export("$1.GBL","$2$1.xml") ;
7+
:alias rcc Write !,"Hi "_$namespace,! ;

.vscode/extensions.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"recommendations": [
3+
"eamodio.gitlens",
4+
"georgejames.gjlocate",
5+
"github.copilot",
6+
"intersystems-community.servermanager",
7+
"intersystems-community.sqltools-intersystems-driver",
8+
"intersystems-community.testingmanager",
9+
"intersystems-community.vscode-objectscript",
10+
"intersystems.language-server",
11+
"mohsen1.prettify-json",
12+
"ms-azuretools.vscode-docker",
13+
"ms-python.python",
14+
"ms-python.vscode-pylance",
15+
"ms-vscode-remote.remote-containers"
16+
]
17+
}

.vscode/launch.json

+18
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(dc.sample.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

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"files.associations": {
3+
4+
"Dockerfile*": "dockerfile",
5+
"iris.script": "objectscript"
6+
},
7+
"objectscript.conn" :{
8+
"active": true,
9+
"ns": "IRISAPP",
10+
"username": "_SYSTEM",
11+
"password": "SYS",
12+
"docker-compose": {
13+
"service": "iris",
14+
"internalPort": 52773
15+
},
16+
"links": {
17+
"UnitTest Portal": "${serverUrl}/csp/sys/%25UnitTest.Portal.Home.cls?$NAMESPACE=IRISAPP"
18+
}
19+
},
20+
"intersystems.testingManager.client.relativeTestRoot": "tests"
21+
22+
}

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22

33
---
44

5-
## [v0.0.4](https://github.com/intersystems-dach/MTConnect-ObjectScript/tree/0.0.4) (2023-2-9)
5+
## v0.0.5 (2024-2-9)
6+
7+
- Packed for _Docker support + inital :alias _
8+
9+
---
10+
11+
## v0.0.4 (2023-2-9)
612

713
- Packed for _ZPM_
814

Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# The most minimumalistic dockerfile possible.
2+
# No embedded python support, no unit-testing, no aliases.
3+
ARG IMAGE=intersystemsdc/iris-community
4+
FROM $IMAGE
5+
6+
WORKDIR /home/irisowner/dev
7+
COPY .iris_init /home/irisowner/.iris_init
8+
9+
RUN --mount=type=bind,src=.,dst=. \
10+
iris start IRIS && \
11+
iris session IRIS < iris.script && \
12+
iris stop IRIS quietly

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,33 @@ An example for how to use the [ClassBuilder Operation](https://github.com/inters
215215

216216
- _no known bugs_
217217

218+
---
219+
## DOCKER Support
220+
### Prerequisites
221+
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.
222+
### Installation
223+
Clone/git pull the repo into any local directory
224+
```
225+
$ git clone https://github.com/intersystems-dach/MTConnect-ObjectScript.git
226+
```
227+
Open the terminal in this directory and run:
228+
```
229+
$ docker-compose build
230+
```
231+
Run IRIS container with your project:
232+
```
233+
$ docker-compose up -d
234+
```
235+
Test from docker console
236+
```
237+
$ docker-compose exec iris1 iris session iris
238+
USER>
239+
```
240+
or using **WebTerminal**
241+
```
242+
http://localhost:42773/terminal/
243+
```
244+
218245
---
219246

220247
## [Release Notes](https://github.com/intersystems-dach/MTConnect-ObjectScript/blob/master/CHANGELOG.md)

0 commit comments

Comments
 (0)