Skip to content

Commit 54e7812

Browse files
committed
WIP CI
1 parent 23457db commit 54e7812

3 files changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/main.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Upload questionnaire
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
Upload:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: oven-sh/setup-bun@v2
12+
- name: Build bundle
13+
run: docker compose run --rm build-seeds
14+
- name: Extract questionnaires
15+
run: bun extract.js
16+
- name: debug:
17+
run: find . | grep -v git

compose.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
services:
2+
build-seeds:
3+
image: bedasoftware/fhirsnake:latest
4+
command:
5+
- export
6+
- --output
7+
- /app/bundle/initBundle.json
8+
- --external-questionnaire-fce-fhir-converter-url
9+
- http://questionnaire-fce-fhir-converter:3000/to-fhir
10+
depends_on:
11+
questionnaire-fce-fhir-converter:
12+
condition: service_healthy
13+
volumes:
14+
- ./resources:/app/resources
15+
- ./extract:/app/bundle
16+
17+
questionnaire-fce-fhir-converter:
18+
image: bedasoftware/questionnaire-fce-fhir-converter:latest
19+
healthcheck:
20+
test: curl --fail http://localhost:3000/health || exit 1
21+
interval: 5s
22+
timeout: 30s
23+
retries: 50

extract.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const file = Bun.file("extract/initBundle.json");
2+
const bundle = await file.json();
3+
for(const e of bundle.entry){
4+
const r = e.resource;
5+
await Bun.write(`extract/${r.id}.json`,JSON.stringify(r, undefined, 4));
6+
}

0 commit comments

Comments
 (0)