Commit 9c2fc476 authored by Reza Sahebgharan's avatar Reza Sahebgharan

fix(testwithfetchworklist): test app with dockerized fetch worklist

parent 80c5dd0a
Pipeline #539 passed with stages
in 18 minutes and 49 seconds
...@@ -20,7 +20,7 @@ build_in_devel: ...@@ -20,7 +20,7 @@ build_in_devel:
- docker-compose config - docker-compose config
- docker-compose build - docker-compose build
- echo y | plink -ssh administrator@staging.karname.ir "exit" - echo y | plink -ssh administrator@staging.karname.ir "exit"
- docker save -o ./scripts/karname-app.tar karname/app:$env:TAG_VERSION # save docker in scripts folder - docker save -o ./scripts/karname-app.tar karname-app:$env:TAG_VERSION # save docker in scripts folder
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./scripts/karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server - echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./scripts/karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server
- echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q - echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./docker-compose-staging.yml staging.karname.ir:c:/Users/administrator/docker-compose.yml # save docker-compose.yml in remote server - echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./docker-compose-staging.yml staging.karname.ir:c:/Users/administrator/docker-compose.yml # save docker-compose.yml in remote server
...@@ -53,9 +53,9 @@ build_in_devel_windows: ...@@ -53,9 +53,9 @@ build_in_devel_windows:
- cd C:\output\bundle\programs\server - cd C:\output\bundle\programs\server
- npm install - npm install
- cd ../.. - cd ../..
- docker build -t karname/app:$env:TAG_VERSION . - docker build -t karname-app:$env:TAG_VERSION .
- echo y | plink -ssh administrator@staging.karname.ir "exit" - echo y | plink -ssh administrator@staging.karname.ir "exit"
- docker save -o ./karname-app.tar karname/app:$env:TAG_VERSION # save docker in scripts folder - docker save -o ./karname-app.tar karname-app:$env:TAG_VERSION # save docker in scripts folder
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server - echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./karname-app.tar staging.karname.ir:c:/Users/administrator/karname-app.tar # save docker in remote server
- echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q - echo y | plink -batch -ssh administrator@staging.karname.ir -pw $env:StagingPass docker load -i c:/Users/administrator/karname-app.tar -q
- echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./docker-compose.yml staging.karname.ir:c:/Users/administrator/docker-compose.yml # save docker-compose.yml in remote server - echo y | pscp.exe -batch -l administrator -pw $env:StagingPass ./docker-compose.yml staging.karname.ir:c:/Users/administrator/docker-compose.yml # save docker-compose.yml in remote server
......
## Installation Guide
1. create a folder in the production server for example in the drive C(ex:C:/build)
2. navigate to created folder in step 1 and create a file called docker-compose.yml (ex: c:/build/docker-compose.yml)
3. open docker-compose.yml with an editor and paste following statements in the created docker compose file
* please consider that "worklistUrl" is the ip of worklist services for fetching and editing worklists
* if the worklist services have been deployed in a container, "worklistUrl" must be container_name of worklist in docker
-----------------------------------------------------------------
version: '3'
services:
app:
container_name: karname-app
restart: always
image: repo.marcopacs.com/karname/karname-app
ports:
- '80:3000'
depends_on:
- mongo
links:
- mongo
environment:
ROOT_URL: ${APP_ROOT_URL:-http://localhost}
MONGO_URL: mongodb://mongo:27017/karname
PORT: 3000
METEOR_SETTINGS: '{"worklistUrl":"http://192.168.0.163"}'
mongo:
image: repo.marcopacs.com/karname/mongo-windows
volumes:
- C:\data\db:C:\data\db
volumes:
data:
-------------------------------------------------------------------
4. navigate to Drive C and create a folder called "data"
5. navigate to C:/data and create a folder called "db"
6. open CMD
7. CD to created folder in step 1 (ex: cd C:/build)
8. login into repo.marcopacs.com with following command:
--------------------------------------------------------------------
docker login -u username -p password repo.marcopacs.com
--------------------------------------------------------------------
9. run following command:
--------------------------------------------------------------------
docker-compose up -d --force-recreate
--------------------------------------------------------------------
10. goto localhost
in this app data of mongodb will be mapped to created folder in step 5.
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<v-app-bar fixed app elevation="24" color="#c0d7d6"> <v-app-bar fixed app elevation="24" color="#c0d7d6">
<v-toolbar-title class="red--text">{{$t('AppHeader.appName')}}</v-toolbar-title> <v-toolbar-title class="red--text">{{$t('AppHeader.appName')}}</v-toolbar-title>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn text color="red red--text" :to="btnTo"> <v-btn text color="red red--text" :to="btnTo" :data-cy="btnToProp">
<v-icon left>{{ btnIconName }}</v-icon> <v-icon left>{{ btnIconName }}</v-icon>
<strong>{{$t(btnLabel)}}</strong> <strong>{{$t(btnLabel)}}</strong>
</v-btn> </v-btn>
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<v-row> <v-row>
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
data-cy="username"
:label="$t('Login.username')" :label="$t('Login.username')"
prepend-icon="mdi-account-circle" prepend-icon="mdi-account-circle"
:rules="[rules.required]" :rules="[rules.required]"
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
data-cy="password"
:type="!showPassword?'password' :'text'" :type="!showPassword?'password' :'text'"
:label="$t('Login.password')" :label="$t('Login.password')"
prepend-icon="mdi-lock" prepend-icon="mdi-lock"
...@@ -108,7 +110,6 @@ export default { ...@@ -108,7 +110,6 @@ export default {
let self = this; let self = this;
this.username = null; this.username = null;
this.password = null; this.password = null;
}, },
data() { data() {
return { return {
...@@ -164,7 +165,6 @@ export default { ...@@ -164,7 +165,6 @@ export default {
that.snackbar = true; that.snackbar = true;
} }
} else { } else {
Meteor.setTimeout(() => { Meteor.setTimeout(() => {
that.loading = false; that.loading = false;
that.$router.push("/main/worklist"); that.$router.push("/main/worklist");
......
/// <reference types="Cypress" />
describe('The Login Page', function() {
this.beforeEach(function() {
cy.visit('/signin');
});
it('login test', function() {
cy.get("[data-cy=username]").debug().type("reza.s");
cy.get("[data-cy=password]").type(`1{enter}`);
cy.url().should('include', '/main/worklist');
});
it("register page", function() {
cy.get("[data-cy=signup]").click();
cy.url().should('include', '/signup');
});
});
\ No newline at end of file
...@@ -5,7 +5,7 @@ services: ...@@ -5,7 +5,7 @@ services:
app: app:
container_name: karname-app container_name: karname-app
restart: always restart: always
image: 'karname/app:${TAG_VERSION}' image: 'karname-app:${TAG_VERSION}'
ports: ports:
- '80:3000' - '80:3000'
depends_on: depends_on:
...@@ -21,6 +21,10 @@ services: ...@@ -21,6 +21,10 @@ services:
image: repo.marcopacs.com/karname/mongo-windows image: repo.marcopacs.com/karname/mongo-windows
volumes: volumes:
- C:\data\db:C:\data\db - C:\data\db:C:\data\db
networks:
default:
external:
name: nat
volumes: volumes:
data: data:
import { Meteor } from 'meteor/meteor'; import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check'; import { check } from 'meteor/check';
import { HTTP } from 'meteor/http'; import { HTTP } from 'meteor/http';
import DeviceCode from '../collections/devicecode.js'; import DeviceCode from '../collections/devicecode.js';
Meteor.methods({ Meteor.methods({
'getDeviceCodes' () { 'getDeviceCodes' () {
debugger; debugger;
this.unblock(); this.unblock();
if (this.userId) { if (this.userId) {
try { try {
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/getdevicecodes`); const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/getdevicecodes`);
let deviceCodeHttpResult = JSON.parse(result.content); let deviceCodeHttpResult = JSON.parse(result.content);
DeviceCode.remove({}); DeviceCode.remove({});
deviceCodeHttpResult.Devices.forEach((device) => { deviceCodeHttpResult.Devices.forEach((device) => {
......
...@@ -19,7 +19,7 @@ Meteor.methods({ ...@@ -19,7 +19,7 @@ Meteor.methods({
this.unblock(); this.unblock();
if (this.userId) { if (this.userId) {
try { try {
const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/Fetchworklist/${devicemap}`); const result = HTTP.call('GET', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/Fetchworklist/${devicemap}`);
let worklistHttp = JSON.parse(result.content); let worklistHttp = JSON.parse(result.content);
Worklist.remove({ _userid: this.userId, _devicemap: devicemap }); Worklist.remove({ _userid: this.userId, _devicemap: devicemap });
worklistHttp.WorkListItems.forEach((patient) => { worklistHttp.WorkListItems.forEach((patient) => {
...@@ -95,7 +95,7 @@ Meteor.methods({ ...@@ -95,7 +95,7 @@ Meteor.methods({
} }
} }
const result = HTTP.call('POST', `${Meteor.settings.worklistUrl}/Broker/HISIntegration.svc/rest/EditworklistItem`, options); const result = HTTP.call('POST', `${Meteor.settings.worklistUrl}/HISIntegration.svc/rest/EditworklistItem`, options);
// console.log(result); // console.log(result);
let update = Worklist.update({ AdmissionID: item.AdmissionID }, { $set: JSON.parse(result.content) }); let update = Worklist.update({ AdmissionID: item.AdmissionID }, { $set: JSON.parse(result.content) });
......
{ {
"worklistUrl": "http://192.168.0.163" "worklistUrl": "http://staging.karname.ir:8086"
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment