Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patient registration #4

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/deploy_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Build and Publish
on:
push:
branches:
- Bahmni-IPD-master
- patient_registration
paths-ignore:
- "**.md"
workflow_dispatch:

jobs:
Trivy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Trivy Scan
run: |
wget -q https://raw.githubusercontent.com/Bahmni/bahmni-infra-utils/main/trivy_scan.sh && chmod +x trivy_scan.sh
./trivy_scan.sh
rm trivy_scan.sh
build-publish-docker:
name: Build & Publish Docker Image
runs-on: ubuntu-20.04
needs: Trivy
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: '17'
- name: Build & Test
run: ./mvnw clean install
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Docker Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
file: Dockerfile
push: true
tags: bahmni/event-router-service:ipd-${{ github.run_number }}, bahmni/event-router-service:ipd

trigger-workflow:
name: Trigger workflow to deploy to docker env
needs:
- build-publish-docker
- Trivy
runs-on: ubuntu-latest
env:
EVENT_TYPE: bahmni-ipd-event-router-service-event
steps:
- name: Create repository_dispatch
run: |
trigger_result=$(curl -s -o trigger_response.txt -w "%{http_code}" -X POST -H "Accept: application/vnd.github.v3+json" -H 'authorization: Bearer ${{ secrets.IPD_PAT }}' https://api.github.com/repos/${{ secrets.IPD_ORG_NAME }}/${{ secrets.IPD_REPOSITORY_NAME }}/dispatches -d '{"event_type":"'"${EVENT_TYPE}"'"}')
if [ $trigger_result == 204 ];then
echo "Trigger Success"
else
echo "Trigger Failed"
cat trigger_response.txt
exit 1
fi
20 changes: 20 additions & 0 deletions .github/workflows/validate_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: A workflow to validate PRs

on:
pull_request:
branches: [ Bahmni-IPD-master ]

jobs:
build:

runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
- run: npm install
- run: npm test
- run: npm run build
3 changes: 3 additions & 0 deletions .trivyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignoring snakeyaml dependency 1.33 which is critical vulnerability because liquibase-core is using that.
# Even latest version of liquibase-core that is 4.21 as of now is also using this.
CVE-2022-1471
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<version>3.0.6</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.bahmni</groupId>
Expand Down Expand Up @@ -84,7 +84,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<version>2.7</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
Expand Down