-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
177 lines (159 loc) · 4.6 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
stages:
- linting
- build
- test
services:
- docker:dind
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
CI_REGISTRY_IMAGE: registry-tigr.narfs.co
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: "" # Disabled TLS for DinD
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
COMPOSE_PROFILES: neo4jTest
OPENAI_API_KEY: ""
ORGANIZATION_KEY: ""
PROJECT_KEY: ""
DOCKER_CONFIG: ${DOCKER_CONFIG:-$CI_PROJECT_DIR/.docker}
VISTA_VEHU_TAG: vista-vehu
VISTA_VEHU_PATH_TEST: "$CI_REGISTRY_IMAGE/$VISTA_VEHU_TAG:$CI_COMMIT_REF_SLUG"
VISTA_TAG: vista-fhir
VISTA_PATH_TEST: "$CI_REGISTRY_IMAGE/$VISTA_TAG:$CI_COMMIT_REF_SLUG"
HAPI_TAG: hapi-fhir
HAPI_PATH_TEST: "$CI_REGISTRY_IMAGE/$HAPI_TAG:$CI_COMMIT_REF_SLUG"
IBM_TAG: ibm-fhir
IBM_PATH_TEST: "$CI_REGISTRY_IMAGE/$IBM_TAG:$CI_COMMIT_REF_SLUG"
BLAZE_TAG: blaze-fhir
BLAZE_PATH_TEST: "$CI_REGISTRY_IMAGE/$BLAZE_TAG:$CI_COMMIT_REF_SLUG"
INTERSYSTEMS_TAG: iris-fhir
INTERSYSTEMS_PATH_TEST: "$CI_REGISTRY_IMAGE/$INTERSYSTEMS_TAG:$CI_COMMIT_REF_SLUG"
SYNTHEA_TAG: synthea
SYNTHEA_PATH_TEST: "$CI_REGISTRY_IMAGE/$SYNTHEA_TAG:$CI_COMMIT_REF_SLUG"
NEO4J_TEST_TAG: neo4j-test
NEO4J_TEST_PATH_TEST: "$CI_REGISTRY_IMAGE/$NEO4J_TEST_TAG:$CI_COMMIT_REF_SLUG"
.default_scripts: &default_scripts
- echo "Waiting for docker cli to respond before continuing build..."
- |
for i in $(seq 1 60); do
if ! docker info &> /dev/null; then
echo "Docker not responding yet. Sleeping for 2s..." && sleep 2s
else
echo "Docker ready. Continuing build..."
break
fi
done
- export DOCKER_CLIENT_TIMEOUT=300
- export COMPOSE_HTTP_TIMEOUT=300
- echo $CI_REGISTRY
- echo $CI_REGISTRY_IMAGE
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- export TAG=$([ "$CI_COMMIT_REF_NAME" == "staging" ] && echo "latest" || echo "$CI_COMMIT_REF_NAME" | tr '/' '-')
black:
stage: linting
tags:
- digiheals
image: registry.gitlab.com/pipeline-components/black:latest
script:
- black --check .
.build_template: &build_template
before_script: *default_scripts
variables:
BUILD_CONTEXT: "."
script:
- docker pull "${IMAGE_PATH}" || true
- docker build --cache-from "${IMAGE_PATH}" -t "${IMAGE_PATH}" "${BUILD_CONTEXT}"
- docker push "${IMAGE_PATH}"
.push_image_template: &push_image_template
before_script: *default_scripts
script:
- docker pull "${GLOBAL_IMAGE_PATH}" || true
- docker tag "${GLOBAL_IMAGE_PATH}" "${IMAGE_PATH}"
- docker push "${IMAGE_PATH}"
build_vista_vehu:
<<: *push_image_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$VISTA_VEHU_PATH_TEST"
GLOBAL_IMAGE_PATH: "worldvista/vehu:201911-syn-fhir"
build_vista:
<<: *push_image_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$VISTA_PATH_TEST"
GLOBAL_IMAGE_PATH: "worldvista/fhir-on-vista:latest"
build_hapi:
<<: *push_image_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$HAPI_PATH_TEST"
GLOBAL_IMAGE_PATH: "hapiproject/hapi:latest"
build_ibm:
<<: *push_image_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$IBM_PATH_TEST"
GLOBAL_IMAGE_PATH: "ghcr.io/linuxforhealth/fhir-server"
build_blaze:
<<: *push_image_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$BLAZE_PATH_TEST"
GLOBAL_IMAGE_PATH: "samply/blaze:latest"
build_iris:
<<: *build_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$INTERSYSTEMS_PATH_TEST"
BUILD_CONTEXT: ./ehr-garden/intersystems
build_synthea:
<<: *build_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$SYNTHEA_PATH_TEST"
BUILD_CONTEXT: ./ehr-garden/synthea
build_neo4jtest:
<<: *build_template
stage: build
tags:
- digiheals
variables:
IMAGE_PATH: "$NEO4J_TEST_PATH_TEST"
BUILD_CONTEXT: ./ehr-garden/neo4jTest
run_test:
stage: test
allow_failure: true
before_script:
- *default_scripts
# Install Python and dependencies
- apk add --no-cache python3 py3-pip curl make
- python3 -m venv /builds/venv
- . /builds/venv/bin/activate
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install --upgrade openai
tags:
- digiheals
script:
- docker compose -f docker-compose-ci.yml pull
- docker compose -f docker-compose-ci.yml up -d
- docker ps
- sleep 420
- make test-pipeline
- docker compose -f docker-compose-ci.yml stop
- docker compose -f docker-compose-ci.yml down -v --timeout 120