Skip to content
This repository was archived by the owner on Jul 18, 2026. It is now read-only.

Commit e83c6f9

Browse files
authored
Merge pull request #4 from fastenhealth/ci_test
2 parents d765b03 + 4d9ea2b commit e83c6f9

17 files changed

Lines changed: 188 additions & 1050 deletions

File tree

.github/workflows/build.yaml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Docker
2+
on:
3+
push:
4+
branches: [ main, sandbox ]
5+
# Publish semver tags as releases.
6+
tags: [ 'v*.*.*' ]
7+
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
omnibus:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v2
22+
# - name: "Populate frontend version information"
23+
# run: "cd webapp/frontend && ./git.version.sh"
24+
# - name: "Generate frontend & version information"
25+
# uses: addnab/docker-run-action@v3
26+
# with:
27+
# image: node:lts
28+
# options: -v ${{ github.workspace }}:/work
29+
# run: |
30+
# cd /work
31+
# make binary-frontend && echo "print contents of /work/dist" && ls -alt /work/dist
32+
- name: Set up QEMU
33+
uses: docker/setup-qemu-action@v2
34+
with:
35+
platforms: 'arm64,arm'
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v2
38+
# Login against a Docker registry except on PR
39+
# https://github.com/docker/login-action
40+
- name: Log into registry ${{ env.REGISTRY }}
41+
if: github.event_name != 'pull_request'
42+
uses: docker/login-action@v2
43+
with:
44+
registry: ${{ env.REGISTRY }}
45+
username: ${{ github.actor }}
46+
password: ${{ secrets.GITHUB_TOKEN }}
47+
# Extract metadata (tags, labels) for Docker
48+
# https://github.com/docker/metadata-action
49+
- name: Extract Docker metadata
50+
id: meta
51+
uses: docker/metadata-action@v4
52+
with:
53+
tags: |
54+
type=ref,enable=true,event=branch
55+
type=ref,enable=true,event=tag
56+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
57+
# Build and push Docker image with Buildx (don't push on PR)
58+
# https://github.com/docker/build-push-action
59+
- name: Build and push Docker image
60+
uses: docker/build-push-action@v3
61+
with:
62+
platforms: linux/amd64,linux/arm64
63+
context: .
64+
file: docker/Dockerfile
65+
push: ${{ github.event_name != 'pull_request' }}
66+
tags: ${{ steps.meta.outputs.tags }}
67+
labels: ${{ steps.meta.outputs.labels }}
68+
# cache-from: type=gha
69+
# cache-to: type=gha,mode=max

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
cd frontend
44
npm run dist
55
go mod vendor
6-
go run backend/cmd/fasten/fasten.go start --config ./config.yaml --debug
6+
go run backend/cmd/fasten/fasten.go start --config ./config.example.yaml --debug
77
```

Dockerfile

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ WORKDIR /usr/src/fastenhealth/frontend
44
COPY frontend/package.json ./
55
RUN yarn install --frozen-lockfile
66
COPY frontend/ ./
7-
RUN yarn run build -- --output-path=../dist
7+
RUN yarn run build -- --configuration sandbox --output-path=../dist
88

99
FROM golang:1.18 as backend-build
1010
WORKDIR /go/src/github.com/fastenhealth/fastenhealth-onprem
@@ -15,13 +15,20 @@ RUN go mod vendor \
1515
&& go generate ./... \
1616
&& go vet ./... \
1717
&& go test ./...
18-
1918
RUN CGO_ENABLED=0 go build -o /go/bin/fasten ./backend/cmd/fasten/
2019

21-
FROM gcr.io/distroless/static-debian11
20+
# create folder structure
21+
RUN mkdir -p /opt/fasten/db \
22+
mkdir -p /opt/fasten/web \
23+
mkdir -p /opt/fasten/config
24+
2225

23-
COPY --from=frontend-build /usr/src/fastenhealth/dist /opt/fasten/dist
26+
27+
FROM gcr.io/distroless/static-debian11
28+
WORKDIR /opt/fasten/
29+
COPY --from=backend-build /opt/fasten/ /opt/fasten/
30+
COPY --from=frontend-build /usr/src/fastenhealth/dist /opt/fasten/web
2431
COPY --from=backend-build /go/bin/fasten /opt/fasten/fasten
2532
COPY LICENSE.md /opt/fasten/LICENSE.md
26-
COPY config.yaml /opt/fasten/config.yaml
27-
CMD ["/opt/fasten/fasten"]
33+
COPY config.yaml /opt/fasten/config/config.yaml
34+
CMD ["/opt/fasten/fasten", "start", "--config", "/opt/fasten/config/config.yaml"]

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# goweb-template
2-
1+
# Fasten - On Premise/Self-Hosted
32

43
Find & replace the following
54

backend/pkg/hub/internal/fhir/cerner/client_test.go

Lines changed: 0 additions & 48 deletions
This file was deleted.

backend/pkg/hub/internal/fhir/logica/client_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestLogicaClient_SyncAll(t *testing.T) {
2121
defer mockCtrl.Finish()
2222
fakeConfig := mock_config.NewMockInterface(mockCtrl)
2323

24-
testDatabase, err := ioutil.TempFile("testdata", "fasten.db")
24+
testDatabase, err := ioutil.TempFile("", "fasten.db")
2525
require.NoError(t, err)
2626
defer os.Remove(testDatabase.Name())
2727
fakeConfig.EXPECT().GetString("web.database.location").AnyTimes().Return(testDatabase.Name())

backend/pkg/hub/internal/fhir/logica/testdata/govcr-fixtures/TestLogicaClient_SyncAll.cassette

Lines changed: 50 additions & 74 deletions
Large diffs are not rendered by default.

config.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ web:
1010
# used to encrypt/validate JWT session key (used for authentication)
1111
encryptionkey: 'changethissupersecretkey'
1212
listen:
13-
port: 9090
13+
port: 8080
1414
host: 0.0.0.0
1515

1616
# if you're using a reverse proxy like apache/nginx, you can override this value to serve fasten on a subpath.
@@ -21,8 +21,7 @@ web:
2121
src:
2222
# the location on the filesystem where webapp javascript + css is located
2323
frontend:
24-
# path: /opt/fasten/web
25-
path: ./dist
24+
path: /opt/fasten/web
2625

2726
log:
2827
file: '' #absolute or relative paths allowed, eg. web.log

frontend/angular.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,33 @@
4747
"optimization": true,
4848
"outputHashing": "all",
4949
"sourceMap": false,
50-
"extractCss": true,
50+
"namedChunks": false,
51+
"extractLicenses": true,
52+
"vendorChunk": false,
53+
"buildOptimizer": true,
54+
"budgets": [
55+
{
56+
"type": "initial",
57+
"maximumWarning": "2mb",
58+
"maximumError": "5mb"
59+
},
60+
{
61+
"type": "anyComponentStyle",
62+
"maximumWarning": "6kb",
63+
"maximumError": "10kb"
64+
}
65+
]
66+
},
67+
"sandbox": {
68+
"fileReplacements": [
69+
{
70+
"replace": "src/environments/environment.ts",
71+
"with": "src/environments/environment.sandbox.ts"
72+
}
73+
],
74+
"optimization": true,
75+
"outputHashing": "all",
76+
"sourceMap": false,
5177
"namedChunks": false,
5278
"extractLicenses": true,
5379
"vendorChunk": false,
@@ -65,6 +91,7 @@
6591
}
6692
]
6793
}
94+
6895
}
6996
},
7097
"serve": {

frontend/src/app/app.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, OnInit } from '@angular/core';
2-
import {Router} from '@angular/router';
2+
import {NavigationEnd, Router} from '@angular/router';
33

44
@Component({
55
selector: 'app-root',
@@ -10,7 +10,7 @@ export class AppComponent implements OnInit {
1010
title = 'fastenhealth';
1111

1212
public layoutOption: string;
13-
showHeader:boolean = true;
13+
showHeader:boolean = false;
1414
showFooter:boolean = true;
1515

1616
constructor(private router: Router) {}
@@ -28,8 +28,8 @@ export class AppComponent implements OnInit {
2828
this.router.events.subscribe(event => this.modifyHeader(event));
2929
}
3030

31-
modifyHeader(location) {
32-
if(location.url?.startsWith('/auth'))
31+
modifyHeader(event) {
32+
if(event instanceof NavigationEnd && event.url?.startsWith('/auth'))
3333
{
3434
this.showHeader = false;
3535
} else {

0 commit comments

Comments
 (0)