Skip to content

Commit 4399deb

Browse files
chore(swagger): update swagger workflow and properties
1 parent 14a7f7d commit 4399deb

2 files changed

Lines changed: 15 additions & 7 deletions

File tree

.github/workflows/swagger-json.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,17 @@ jobs:
6969
- name: Stop API
7070
if: always()
7171
run: |
72+
# Graceful shutdown of the process group
73+
sleep 5
74+
# Force kill the process group if still running
7275
if [ -f api_pid.txt ]; then
73-
kill -9 $(cat api_pid.txt) || true
74-
fi
76+
PID=$(cat api_pid.txt)
77+
kill -TERM -- -"$PID" 2>/dev/null || true
78+
sleep 2
79+
kill -9 -- -"$PID" 2>/dev/null || true
80+
fi
81+
# Fallback: kill any remaining java process on port 9090
82+
fuser -k 9090/tcp 2>/dev/null || true
7583
7684
- name: Checkout AMRIT-Docs
7785
uses: actions/checkout@v4
@@ -87,14 +95,15 @@ jobs:
8795
cp inventory-api.json amrit-docs/docs/swagger/inventory-api.json
8896
8997
- name: Create Pull Request
90-
uses: peter-evans/create-pull-request@v6
98+
uses: peter-evans/create-pull-request@v8
9199
with:
92100
token: ${{ secrets.DOCS_REPO_TOKEN }}
93101
path: amrit-docs
94102
branch: auto/swagger-update-${{ github.run_id }}-${{ github.run_attempt }}
95103
base: main
96104
commit-message: "chore(docs): auto-update Inventory-API swagger"
97105
title: "chore(docs): auto-update Inventory-API swagger"
106+
delete-branch: true
98107
body: |
99108
This PR automatically updates Inventory-API Swagger JSON
100109
from the latest main branch build.

src/main/resources/application-swagger.properties

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
44
spring.jpa.hibernate.ddl-auto=create-drop
55

66
# Disable Redis if not needed for docs (optional)
7-
spring.data.redis.host=${REDIS_HOST:localhost}
8-
spring.data.redis.port=${REDIS_PORT:6379}
9-
7+
spring.session.store-type=none
8+
spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration,org.springframework.boot.autoconfigure.data.redis.RedisRepositoriesAutoConfiguration
109
# CORS for Swagger UI
1110
cors.allowed-origins=${CORS_ALLOWED_ORIGINS:http://localhost:9090,http://localhost:8080}
1211
# Logging
@@ -19,4 +18,4 @@ jwt.secret=${JWT_SECRET_KEY:#{T(java.util.UUID).randomUUID().toString()}}
1918
common-api-url-searchBeneficiary=http://localhost:8080/beneficiary/search
2019

2120
# Placeholder for required property
22-
common-api-url-searchuserbyid=http://localhost:8080/user/searchbyid
21+
common-api-url-searchuserbyid=http://localhost:8080/user/searchbyid

0 commit comments

Comments
 (0)