Skip to content

Commit bed0839

Browse files
author
Tomas Oliveira
committed
Merge remote-tracking branch 'origin/master' into AP-84-V2
2 parents 1c8374a + 01e5896 commit bed0839

23 files changed

+265
-15
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Build and Publish
2+
on:
3+
push:
4+
branches:
5+
- master
6+
- 'release-*'
7+
tags:
8+
- '[0-9]+.[0-9]+.[0-9]+'
9+
paths-ignore:
10+
- "**.md"
11+
12+
jobs:
13+
build-publish-docker-helm:
14+
name: Build & Publish Docker Image & Helm Chart
15+
runs-on: ubuntu-latest
16+
env:
17+
HELM_CHART_PATH: package/helm/
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set env.ARTIFACT_VERSION
21+
run: |
22+
wget -q https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/setArtifactVersion.sh && chmod +x setArtifactVersion.sh
23+
./setArtifactVersion.sh
24+
rm setArtifactVersion.sh
25+
- name: Use Node.js 14.x
26+
uses: actions/setup-node@v1
27+
with:
28+
node-version: 14.x
29+
- name: Install dependencies ui
30+
run: cd ui && npm install
31+
- name: Install dependencies root
32+
run: npm install
33+
- name: run test
34+
run: npm run test
35+
- name: Build
36+
run: npm run build
37+
- name: Login to DockerHub
38+
uses: docker/login-action@v1
39+
with:
40+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
41+
password: ${{ secrets.DOCKER_HUB_TOKEN }}
42+
- name: Docker Build and push
43+
uses: docker/build-push-action@v2
44+
with:
45+
context: .
46+
file: package/docker/Dockerfile
47+
push: true
48+
tags: bahmni/appointments:${{env.ARTIFACT_VERSION}},bahmni/appointments:latest
49+
- name: Helm - Update Version and Image Tag
50+
run: |
51+
yq --inplace '.image.tag = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/values.yaml
52+
yq --inplace '.version = "${{ env.ARTIFACT_VERSION }}"' $HELM_CHART_PATH/Chart.yaml
53+
54+
- name: Helm Lint
55+
run: helm lint $HELM_CHART_PATH
56+
57+
- name: Helm Package
58+
run: helm package $HELM_CHART_PATH
59+
60+
- name: Helm - Checkout Charts Repository
61+
uses: actions/checkout@v2
62+
with:
63+
repository: Bahmni/helm-charts
64+
ref: gh-pages
65+
path: helm-charts
66+
persist-credentials: false
67+
68+
- name: Helm - Copy chart
69+
run: mkdir -p helm-charts/appointments/ && cp appointments-${{ env.ARTIFACT_VERSION }}.tgz helm-charts/appointments/
70+
71+
- name: Helm - reIndex
72+
working-directory: helm-charts/
73+
run: helm repo index --merge index.yaml --url https://bahmni.github.io/helm-charts/ .
74+
75+
- name: Helm - Publish Chart
76+
working-directory: helm-charts/
77+
run: |
78+
git config user.name ${{ secrets.BAHMNI_USERNAME}}
79+
git config user.email ${{ secrets.BAHMNI_EMAIL}}
80+
git add .
81+
git commit -m "Release of bahmni-web-${{ env.ARTIFACT_VERSION }}"
82+
git push 'https://${{ secrets.BAHMNI_USERNAME}}:${{ secrets.BAHMNI_PAT}}@github.com/bahmni/helm-charts.git' gh-pages

.github/workflows/validate_pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v2
17-
- name: Use Node.js 12.x
17+
- name: Use Node.js 14.x
1818
uses: actions/setup-node@v1
1919
with:
20-
node-version: '12.x'
20+
node-version: '14.x'
2121
- run: npm install
2222
- run: npm test
2323
- run: npm run build

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
engine-strict=true

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ npm run test-react-watch
8181
* Create a folder called 'appointments' under '/var/www'.
8282
* Add an alias in httpd ssl.conf, like below:
8383
```
84-
Alias /appointments-v2 /var/www/appointments
84+
Alias /appointments /var/www/appointments
8585
```
8686

8787
# Project Structure

config/ng-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
},
8989
"Appointments": {
9090
"Constants": {
91-
"homeUrl": "../../home",
91+
"homeUrl": "../../bahmni/home",
9292
"createServiceUrl": "/openmrs/ws/rest/v1/appointmentService",
9393
"getServiceLoad": "/openmrs/ws/rest/v1/appointmentService/load",
9494
"getAllSpecialitiesUrl": "/openmrs/ws/rest/v1/speciality/all",
@@ -143,7 +143,7 @@
143143
"CANCELLED": "CANCELLED",
144144
"AWAITING": "AWAITING"
145145
},
146-
"appointmentsV2Url" : "/appointments-v2/#/home/manage/appointments"
146+
"appointmentsV2Url" : "/appointments/#/home/manage/appointments"
147147
}
148148
}
149149
}

config/react-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"appointmentService": "/openmrs/ws/rest/v1/appointmentService",
3-
"searchPatientUrl": "/openmrs/ws/rest/v1/bahmnicore/search/patient",
3+
"searchPatientUrl": "/openmrs/ws/rest/v1/bahmnicore/search/patient/lucene",
44
"patientUrl": "/openmrs/ws/rest/v1/patient",
55
"servicesDefaultUrl": "/openmrs/ws/rest/v1/appointmentService/all/default",
66
"providerUrl": "/openmrs/ws/rest/v1/provider",

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.0.4",
44
"description": "An appointment app for bahmni/openmrs.",
55
"license": "AGPLv3",
6+
"engines": {
7+
"node": ">=12 <15"
8+
},
69
"scripts": {
710
"build-react": "cd ui && npm run build-react",
811
"build": "npm run build-react && webpack --mode=development",

package/.appversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0.0

package/docker/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM httpd:2.4-alpine
2+
COPY dist/. /usr/local/apache2/htdocs/appointments/

package/helm/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

0 commit comments

Comments
 (0)