Merge branch 'develop'

This commit is contained in:
kittapath 2024-12-18 10:00:33 +07:00
commit 37e59199d2
3 changed files with 48 additions and 49 deletions

View file

@ -1,5 +1,5 @@
name: release-test name: release
run-name: release-test ${{ github.actor }} run-name: release ${{ github.actor }}
on: on:
push: push:
tags: tags:
@ -9,11 +9,11 @@ env:
REGISTRY: docker.frappet.com REGISTRY: docker.frappet.com
IMAGE_NAME: ehr/bma-ehr-development-service IMAGE_NAME: ehr/bma-ehr-development-service
DEPLOY_HOST: frappet.com DEPLOY_HOST: frappet.com
# COMPOSE_PATH: /home/frappet/docker/bma-ehr
COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-development COMPOSE_PATH: /home/frappet/docker/bma/bma-ehr-development
jobs: jobs:
# act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd # act workflow_dispatch -W .github/workflows/release.yaml --input IMAGE_VER=test-v1 -s DOCKER_USER=sorawit -s DOCKER_PASS=P@ssword -s SSH_PASSWORD=P@ssw0rd
release-test: release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -67,22 +67,41 @@ jobs:
docker compose pull docker compose pull
docker compose up -d docker compose up -d
echo "${{ steps.gen_ver.outputs.image_ver }}"> success echo "${{ steps.gen_ver.outputs.image_ver }}"> success
- uses: snow-actions/line-notify@v1.1.0 - name: Notify Discord Success
if: success() if: success()
with: run: |
access_token: ${{ secrets.TOKEN_LINE }} curl -H "Content-Type: application/json" \
message: | -X POST \
-Success✅✅✅ -d '{
Image: ${{env.IMAGE_NAME}} "embeds": [{
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} "title": "✅ Deployment Success!",
By: ${{github.actor}} "description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Deployed by: `${{github.actor}}`",
- uses: snow-actions/line-notify@v1.1.0 "color": 3066993,
if: failure() "footer": {
with: "text": "Release Notification",
access_token: ${{ secrets.TOKEN_LINE }} "icon_url": "https://example.com/success-icon.png"
message: | },
-Failure❌❌❌ "timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
Image: ${{env.IMAGE_NAME}} }]
Version: ${{ steps.gen_ver.outputs.IMAGE_VER }} }' \
By: ${{github.actor}} ${{ secrets.DISCORD_WEBHOOK }}
- name: Notify Discord Failure
if: failure()
run: |
curl -H "Content-Type: application/json" \
-X POST \
-d '{
"embeds": [{
"title": "❌ Deployment Failed!",
"description": "**Details:**\n- Image: `${{env.IMAGE_NAME}}`\n- Version: `${{ steps.gen_ver.outputs.image_ver }}`\n- Attempted by: `${{github.actor}}`",
"color": 15158332,
"footer": {
"text": "Release Notification",
"icon_url": "https://example.com/failure-icon.png"
},
"timestamp": "'$(date -u +%Y-%m-%dT%H:%M:%SZ)'"
}]
}' \
${{ secrets.DISCORD_WEBHOOK }}

View file

@ -240,6 +240,7 @@ export class DevelopmentScholarshipController extends Controller {
posType: item.posType ? item.posType.posTypeName : null, posType: item.posType ? item.posType.posTypeName : null,
posLevel: item.posLevel ? item.posLevel.posLevelName : null, posLevel: item.posLevel ? item.posLevel.posLevelName : null,
posExecutive: item.posExecutive, posExecutive: item.posExecutive,
status: item.status,
})); }));
return new HttpSuccess({ data: formattedData, total }); return new HttpSuccess({ data: formattedData, total });

View file

@ -193,35 +193,14 @@ class CheckAuth {
if (reply != null) { if (reply != null) {
reply = JSON.parse(reply); reply = JSON.parse(reply);
} else { } else {
// await new CallAPI() if (!keycloakId) throw "Error calling API No KeycloakId";
// .GetData(
// {
// headers: { authorization: token },
// }, `/org/permission/checkOrg/${keycloakId}`,false)
// .then((x) => {
// console.log("[In Then]");
// console.log("[res]",x);
// let data: any = {
// orgRootId: x.orgRootId,
// orgChild1Id: x.orgChild1Id,
// orgChild2Id: x.orgChild2Id,
// orgChild3Id: x.orgChild3Id,
// orgChild4Id: x.orgChild4Id,
// };
// console.log("[data]",data);
// return data;
// },
// )
// .catch((error) => {
// console.error("Error calling API:", error);
// });
try { try {
const x = await new CallAPI().GetData( const x = await new CallAPI().GetData(
{ {
headers: { authorization: token }, headers: { authorization: token },
}, },
`/org/permission/checkOrg/${keycloakId}`, `/org/permission/checkOrg/${keycloakId}`,
false false,
); );
const data = { const data = {