Skip to content

Commit 3fd079a

Browse files
Merge remote-tracking branch 'upstream/develop' into enhancement
# Conflicts: # src/main/java/com/iemr/admin/utils/JwtUserIdValidationFilter.java
2 parents a069382 + 73ea731 commit 3fd079a

File tree

75 files changed

+868
-730
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+868
-730
lines changed

.github/workflows/build-on-pull-request.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build On Pull Request
22
on:
33
pull_request:
44
branches: [ "master","develop" ]
5-
5+
66
jobs:
77
Build:
88
runs-on: ubuntu-latest
@@ -14,9 +14,9 @@ jobs:
1414
repository: ${{ github.event.pull_request.head.repo.full_name }}
1515

1616
- name: Setup JDK 17
17-
uses: actions/setup-java@v2
17+
uses: actions/setup-java@v4
1818
with:
1919
java-version: 17
20-
distribution: 'adopt'
20+
distribution: 'temurin'
2121
- name: Build with Maven
2222
run: mvn clean install

.github/workflows/package.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,35 @@ on:
55
branches: [ "develop"]
66
paths-ignore:
77
- target/**
8-
8+
99
pull_request:
1010
branches: [ "develop" ]
1111
paths-ignore:
1212
- target/**
13-
13+
1414
env:
1515
ENV_VAR: test
1616

1717
jobs:
1818
Package-test:
1919
runs-on: ubuntu-latest
2020
steps:
21-
21+
2222
- name: Checkout code
23-
uses: actions/checkout@v2
24-
23+
uses: actions/checkout@v3
24+
2525
- name: Setup JDK 17
26-
uses: actions/setup-java@v2
26+
uses: actions/setup-java@v4
2727
with:
2828
java-version: 17
29-
distribution: 'adopt'
30-
29+
distribution: 'temurin'
30+
3131
- name: Build with Maven
3232
run: mvn clean install -DENV_VAR=${{ env.ENV_VAR }}
33-
33+
3434
- name: Build WAR file
3535
run: mvn -B package --file pom.xml
36-
36+
3737
- name: Upload WAR file as artifact
3838
uses: actions/upload-artifact@v4
3939
with:

.github/workflows/sast.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ "develop" ]
66
paths-ignore:
77
- target/**
8-
8+
99
pull_request:
1010
branches: [ "develop" ]
1111
paths-ignore:
@@ -25,7 +25,7 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
language: [ 'java' ]
28-
28+
2929
steps:
3030
- name: Checkout code
3131
uses: actions/checkout@v3
@@ -42,7 +42,7 @@ jobs:
4242
with:
4343
java-version: 17
4444
distribution: 'adopt'
45-
45+
4646
- name: Build with Maven
4747
run: mvn clean install
4848

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ target/
1515
*.iml
1616
*.ipr
1717

18+
### environment ###
19+
.env
20+
1821
### NetBeans ###
1922
nbproject/private/
2023
build/

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# --- Stage 1: Build the application using Maven ---
2+
FROM maven:3.9.6-eclipse-temurin-17 AS build
3+
4+
WORKDIR /app
5+
6+
COPY . .
7+
8+
# Build the application while caching Maven dependencies to speed up future builds
9+
RUN --mount=type=cache,target=/root/.m2 \
10+
mvn clean package -DENV_VAR=docker -DskipTests -Dgit.skip=true
11+
12+
# --- Stage 2: Run the application with a minimal JRE image ---
13+
FROM eclipse-temurin:17-jre
14+
15+
WORKDIR /app
16+
17+
# Copy the built WAR file from the build stage
18+
COPY --from=build /app/target/*.war app.war
19+
20+
EXPOSE 8080
21+
22+
ENTRYPOINT ["java", "-jar", "app.war"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ Admin module provides a user-friendly interface for managing your application. I
1010

1111
## Building From Source
1212
This microservice is built on Java, Spring boot framework and MySQL DB.
13-
13+
For steps to clone and set up this Repository, refer to the [Developer Guide](https://piramal-swasthya.gitbook.io/amrit/developer-guide/development-environment-setup)
1414
Prerequisites
15-
* JDK 1.8
15+
* JDK 17
1616
* Maven
1717
* Springboot V2
1818
* MySQL
@@ -24,7 +24,7 @@ Prerequisites
2424
3. Run the spring server with local configuration `mvn spring-boot:run -DENV_VAR=local`
2525

2626
## Installation
27-
This service has been tested on Wildfly as the application server. To install the admin module, follow these steps:
27+
This service has been tested on Wildfly as the application server. To install the admin module, kindly refer to Installation Guide for [API Repository](https://piramal-swasthya.gitbook.io/amrit/developer-guide/development-environment-setup/installation-instructions/for-api-repositories) for guidance.
2828

2929
## Usage
3030
All the features have been exposed as REST endpoints.

logs/admin-api.log.json

Lines changed: 163 additions & 0 deletions
Large diffs are not rendered by default.
3.96 KB
Binary file not shown.

pom.xml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.iemr.admin</groupId>
7-
<artifactId>Admin-API</artifactId>
8-
<version>1.2.0</version>
7+
<artifactId>admin-api</artifactId>
8+
<version>3.1.0</version>
99
<packaging>war</packaging>
1010
<name>Admin-API</name>
1111
<description>Admin Page</description>
@@ -280,7 +280,7 @@
280280
</dependencies>
281281

282282
<build>
283-
<finalName>adminapi-v3.0.0</finalName>
283+
<finalName>${artifactId}-${version}</finalName>
284284
<plugins>
285285
<plugin>
286286
<groupId>org.owasp</groupId>
@@ -467,7 +467,18 @@
467467
</execution>
468468
</executions>
469469
</plugin>
470-
470+
<plugin>
471+
<groupId>org.springframework.boot</groupId>
472+
<artifactId>spring-boot-maven-plugin</artifactId>
473+
<version>3.2.2</version>
474+
<executions>
475+
<execution>
476+
<goals>
477+
<goal>repackage</goal>
478+
</goals>
479+
</execution>
480+
</executions>
481+
</plugin>
471482
</plugins>
472483
</build>
473484
<reporting>

src/main/environment/admin_ci.properties

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ [email protected]_BASE_URL@
1313

1414

1515
### Redis IP
16-
spring.redis.host=localhost
16+
spring.redis.host=@env.REDIS_HOST@
1717
spring.main.allow-bean-definition-overriding=true
1818
jwt.secret=@env.JWT_SECRET_KEY@
1919
#ELK logging file name
20+
logging.path=logs/
2021
logging.file.name=@env.ADMIN_API_LOGGING_FILE_NAME@
2122

22-
common-url=@env.COMMON_URL@
23+
common-url=@env.COMMON_API@
24+
25+
springdoc.api-docs.enabled=@env.SWAGGER_DOC_ENABLED@
26+
springdoc.swagger-ui.enabled=@env.SWAGGER_DOC_ENABLED@
27+
28+
cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@

0 commit comments

Comments
 (0)