Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Merge pull request #117 from ImisDevelopers/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jonathangpk authored Mar 31, 2020
2 parents 2e35d4d + ace2fed commit bd0d8c4
Show file tree
Hide file tree
Showing 26 changed files with 696 additions and 542 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
push:
branches:
- dev
- feature/staging-env

# Environment variables available to all jobs and steps in this workflow
env:
Expand Down Expand Up @@ -48,13 +47,15 @@ jobs:
- name: Build client
run: |
(cd client && docker build -f Dockerfile.prod -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT_ID"/"$CLIENT_IMAGE":"$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .)
--build-arg SENTRY_FRONTEND_DSN="${SENTRY_FRONTEND_DSN}" \
--build-arg DEPLOY_ENV=staging \
--build-arg GITHUB_SHA="${GITHUB_SHA}" \
--build-arg GITHUB_REF="${GITHUB_REF}" .)
- name: Build server
run: |
docker build -f Dockerfile.prod -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT_ID"/"$SERVER_IMAGE":"$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
--build-arg GITHUB_SHA="${GITHUB_SHA}" \
--build-arg GITHUB_REF="${GITHUB_REF}" .
# Push the Docker image to Google Container Registry
- name: Publish
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,16 @@ jobs:
- name: Build client
run: |
(cd client && docker build -f Dockerfile.prod -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT_ID"/"$CLIENT_IMAGE":"$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .)
--build-arg SENTRY_FRONTEND_DSN="${SENTRY_FRONTEND_DSN}" \
--build-arg DEPLOY_ENV=production \
--build-arg GITHUB_SHA="${GITHUB_SHA}" \
--build-arg GITHUB_REF="${GITHUB_REF}" .)
- name: Build server
run: |
docker build -f Dockerfile.prod -t "$REGISTRY_HOSTNAME"/"$GKE_PROJECT_ID"/"$SERVER_IMAGE":"$GITHUB_SHA" \
--build-arg GITHUB_SHA="$GITHUB_SHA" \
--build-arg GITHUB_REF="$GITHUB_REF" .
--build-arg GITHUB_SHA="${GITHUB_SHA}" \
--build-arg GITHUB_REF="${GITHUB_REF}" .
# Push the Docker image to Google Container Registry
- name: Publish
Expand Down
12 changes: 10 additions & 2 deletions chart/cluster-setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#!/bin/bash

helm upgrade --install sentry stable/sentry \
# Will take ages for the first run...
helm upgrade --install --atomic sentry stable/sentry \
--set ingress.enabled=true,ingress.hostname=sentry.imis-prototyp.de,service.type=ClusterIP \
--set ingress.annotations."kubernetes.io\/ingress.class"=traefik
--set ingress.annotations."kubernetes.io\/ingress.class"=traefik

helm upgrade --install --atomic prometheus stable/prometheus \
--set server.global.scrape_interval=30s

helm upgrade --install --atomic grafana stable/grafana \
--set "ingress.enabled=true,ingress.hosts={grafana.imis-prototyp.de}" \
--set "persistence.enabled=true"
4 changes: 4 additions & 0 deletions chart/templates/deployment-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ spec:
metadata:
labels:
{{- include "imis.server.selectorLabels" . | nindent 8 }}
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /actuator/prometheus
prometheus.io/port: "8081"
spec:
containers:
- name: imis-server
Expand Down
4 changes: 4 additions & 0 deletions chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ spec:
targetPort: 8080
protocol: TCP
name: http
- port: 8081
targetPort: 8081
protocol: TCP
name: management
selector:
{{- include "imis.server.selectorLabels" . | nindent 4 }}
9 changes: 8 additions & 1 deletion chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,11 @@ traefik:
persistence:
enabled: true
rbac:
enabled: true
enabled: true
deployment:
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "9100"
metrics:
prometheus:
enabled: true
4 changes: 4 additions & 0 deletions client/Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ WORKDIR /app
COPY package*.json yarn.lock ./
RUN yarn install
COPY . .
ARG SENTRY_FRONTEND_DSN
ARG DEPLOY_ENV
ENV SENTRY_FRONTEND_DSN $SENTRY_FRONTEND_DSN
ENV DEPLOY_ENV $DEPLOY_ENV
RUN yarn run build

# production stage
Expand Down
53 changes: 42 additions & 11 deletions client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,42 @@
<div v-else>
<a-layout id="components-layout-demo-responsive">
<a-layout>
<a-layout-header style="height: auto">
<Navigation />
</a-layout-header>
<a-layout-content
style="margin: auto; box-sizing: border-box; padding: 0 4rem; width: 100%;"
>
<div :style="{ padding: '0px', minHeight: '360px', width: '100%' }">
<router-view></router-view>
<a-layout-header style="height: auto; display: flex; justify-content: space-between; align-items: baseline; padding: 0">

<div>
<a-icon
v-if="authenticationStore.user"
@click="showNavbar = !showNavbar"
type="menu"
style="color: white; padding: 1.5rem"
/>
</div>
</a-layout-content>
<span :style="{color: 'white', }">IMIS</span>
<div>
<a-icon
v-if="authenticationStore.user"
type="user"
style="color: #aaa; padding: 1.5rem"
/>
</div>
</a-layout-header>
<a-layout>
<a-layout-sider
breakpoint="lg"
collapsed-width="0"
v-model="showNavbar"
:trigger="null"
>
<Navigation />
</a-layout-sider>
<a-layout-content
style="margin: auto; box-sizing: border-box; width: 100%;"
>
<div :style="{ padding: '0px', minHeight: '360px', width: '100%' }">
<router-view></router-view>
</div>
</a-layout-content>
</a-layout>
<a-layout-footer style="textAlign: center">
IMIS ©2020 with <a-icon type="heart" style="color:red;">❤</a-icon> by
<a-button type="link" href="https://wirvsvirushackathon.org" target="_blank" style="padding-left: 0">#WeVsVirus</a-button>
Expand All @@ -29,14 +55,20 @@
<script>
import Navigation from "./components/Navigation";
import LandingPage from "./components/LandingPage";
import ALayoutSider from "ant-design-vue/es/layout/Sider";
import {authenticationStore} from "./util/auth";
export default {
components: {
ALayoutSider,
Navigation,
LandingPage
},
data() {
return {};
return {
showNavbar: false,
authenticationStore: authenticationStore,
};
},
computed: {
currentPath: function() {
Expand All @@ -52,7 +84,6 @@ export default {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
Expand Down
6 changes: 5 additions & 1 deletion client/src/api/Api.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Api {
*/

postInstitution(request) {
return this.executeRequest("auth/register", METHOD.POST, request);
return this.executeRequest("institutions", METHOD.POST, request);
}

postPatient(request) {
Expand Down Expand Up @@ -96,6 +96,10 @@ class Api {
return this.executeRequest(`labtest/patient/${patientId}`, METHOD.GET);
}

getLaboratories() {
return this.executeRequest("institutions/laboratories", METHOD.GET)
}

getPatients() {
return this.executeRequest("patients", METHOD.GET);
}
Expand Down
16 changes: 8 additions & 8 deletions client/src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@
</a-form-item>
</a-form>
<div>
<p>Testzugänge:</p>
<ul style="text-align: left">
<li>Labor-Zugang <strong>test_lab</strong> mit Passwort <strong>asdf</strong></li>
<li>Arzt-Zugang <strong>test_doctor</strong> mit Passwort <strong>asdf</strong></li>
<li>oder neuen Zugang
<router-link to="/prototype/register-institution">auf der Registrierungsseite anlegen</router-link>
</li>
</ul>
<!-- <p>Testzugänge:</p>-->
<!-- <ul style="text-align: left">-->
<p>Demo-Zugang <strong>test_lab</strong> mit Passwort <strong>asdf</strong></p>
<!-- <li>Arzt-Zugang <strong>test_doctor</strong> mit Passwort <strong>asdf</strong></li>-->
<!-- <li>oder neuen Zugang-->
<!-- <router-link to="/prototype/register-institution">auf der Registrierungsseite anlegen</router-link>-->
<!-- </li>-->
<!-- </ul>-->
</div>
</a-card>
</template>
Expand Down
7 changes: 5 additions & 2 deletions client/src/components/Navigation.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<a-menu theme="dark" mode="horizontal" :selectedKeys="[key]" v-if="authenticationStore.user">
<a-menu-item v-for="item in availableItems" :key="item.key" @click="onClick">
<a-menu theme="dark" mode="inline" :selectedKeys="[key]" v-if="authenticationStore.user">
<a-menu-item
v-for="item in availableItems"
:key="item.key"
@click="onClick">
<router-link :to="item.url">
<a-icon :type="item.type"/>
<span class="nav-text">{{ item.text }}</span>
Expand Down
Loading

0 comments on commit bd0d8c4

Please sign in to comment.