Skip to content

Commit c6ac5ab

Browse files
committed
simpler dockerfile, and image and runtests added
1 parent 7c1bab8 commit c6ac5ab

File tree

5 files changed

+71
-15
lines changed

5 files changed

+71
-15
lines changed

.github/workflows/github-registry.yml

Lines changed: 25 additions & 0 deletions
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

.github/workflows/runtests.yml

Lines changed: 28 additions & 0 deletions
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

Dockerfile

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ USER root
66
## add git
77
RUN apt update && apt-get -y install git
88

9-
WORKDIR /opt/irisbuild
10-
RUN chown ${ISC_PACKAGE_MGRUSER}:${ISC_PACKAGE_IRISGROUP} /opt/irisbuild
119
USER ${ISC_PACKAGE_MGRUSER}
1210

13-
#COPY Installer.cls .
14-
COPY src src
15-
COPY module.xml module.xml
16-
COPY iris.script iris.script
11+
ARG TESTS=0
12+
ARG MODULE="objectscript-template"
13+
ARG NAMESPACE="USER"
1714

18-
RUN iris start IRIS \
19-
&& iris session IRIS < iris.script \
20-
&& iris stop IRIS quietly
15+
RUN --mount=type=bind,src=.,dst=. \
16+
iris start IRIS && \
17+
iris session IRIS < iris.script && \
18+
([ $TESTS -eq 0 ] || iris session iris -U $NAMESPACE "##class(%ZPM.PackageManager).Shell(\"test $MODULE -v -only\",1,1)") && \
19+
iris stop IRIS quietly

dev.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ use it when docker says "There is no space left on device". It will remove built
55
docker system prune -f
66
```
77

8+
```
9+
docker rm -f $(docker ps -qa)
10+
```
11+
812
## build container with no cache
913
```
1014
docker-compose build --no-cache

iris.script

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
;do $System.OBJ.LoadDir("/opt/irisbuild/src","ck",,1)
1+
;do $System.OBJ.LoadDir("/opt/irisbuild/src","ck",,1)
22

3-
zn "%SYS"
4-
Do ##class(Security.Users).UnExpireUserPasswords("*")
3+
zn "%SYS"
4+
Do ##class(Security.Users).UnExpireUserPasswords("*")
55

6-
zn "USER"
7-
zpm "load /opt/irisbuild/ -v":1:1
8-
halt
6+
zn "USER"
7+
zpm "load /opt/irisbuild/ -v":1:1
8+
halt

0 commit comments

Comments
 (0)