diff --git a/.onedev-buildspec.yml b/.onedev-buildspec.yml index 91d7f220..bd58b796 100644 --- a/.onedev-buildspec.yml +++ b/.onedev-buildspec.yml @@ -1,6 +1,6 @@ version: 37 jobs: -- name: CI for Checkin [UAT] +- name: CI for UAT steps: - !CheckoutStep name: checkout code @@ -33,32 +33,44 @@ jobs: dotnet test -l trx --collect:"XPlat Code Coverage" #/root/.dotnet/tools/roslynator analyze -o roslynator-analysis.xml useTTY: true - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL + condition: NEVER - !PublishTRXReportStep name: publish unit test report reportName: Unit Test filePatterns: '**/*.trx' - condition: ALWAYS + condition: NEVER - !PublishCoberturaReportStep name: publish code coverage report reportName: Code Coverage filePatterns: '**/coverage.cobertura.xml' - condition: ALWAYS + condition: NEVER - !PublishRoslynatorReportStep name: publish code problem report reportName: Code Problems filePatterns: roslynator-analysis.xml failThreshold: HIGH - condition: ALWAYS + condition: NEVER - !SetBuildVersionStep name: set build version buildVersion: '@tag@' condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - !BuildImageStep - name: build docker image + name: build docker image - Leave + dockerfile: ./BMA.EHR.Leave/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-api-leave:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-leave:latest + condition: NEVER + - !BuildImageStep + name: build docker image - Checkin dockerfile: ./BMA.EHR.CheckInConsumer/Dockerfile output: !RegistryOutput tags: hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-checkin:latest + condition: NEVER + - !BuildImageStep + name: build docker image - Insignia + dockerfile: ./BMA.EHR.Insignia/Dockerfile + output: !RegistryOutput + tags: hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:@build_version@ hrms-git.chin.in.th/bma-hrms/hrms-api-insignia:latest condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL triggers: - !TagCreateTrigger @@ -68,53 +80,3 @@ jobs: maxRetries: 3 retryDelay: 30 timeout: 14400 -- name: CI for PROD - steps: - - !CheckoutStep - name: checkout code - cloneCredential: !DefaultCredential {} - withLfs: false - withSubmodules: false - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !GenerateChecksumStep - name: generate package checksum - files: package-lock.json yarn.lock - targetFile: checksum - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !SetupCacheStep - name: set up npm cache - key: node_modules_@file:checksum@ - loadKeys: - - node_modules - paths: - - node_modules - uploadStrategy: UPLOAD_IF_NOT_HIT - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !SetBuildVersionStep - name: set build version - buildVersion: '@tag@' - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !CommandStep - name: build & test - runInContainer: true - image: node - interpreter: !DefaultInterpreter - commands: | - npm install - npm run build - useTTY: true - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - - !BuildImageStep - name: build docker image - dockerfile: ./docker/Dockerfile - output: !RegistryOutput - tags: hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:@build_version@ hrms-git.bangkok.go.th/bma-hrms/hrms-api-checkin:latest - condition: ALL_PREVIOUS_STEPS_WERE_SUCCESSFUL - triggers: - - !TagCreateTrigger - tags: prod-* - branches: main - retryCondition: never - maxRetries: 3 - retryDelay: 30 - timeout: 14400 diff --git a/BMA.EHR.CheckInConsumer/Dockerfile b/BMA.EHR.CheckInConsumer/Dockerfile index 5bab7aad..1c90d6f2 100644 --- a/BMA.EHR.CheckInConsumer/Dockerfile +++ b/BMA.EHR.CheckInConsumer/Dockerfile @@ -42,6 +42,8 @@ RUN dotnet restore # คัดลอกไฟล์ทั้งหมดและ build COPY . ./ RUN dotnet build -c Release -o /app/build +# WORKDIR "/src/BMA.EHR.CheckInConsumer" +# RUN dotnet build "BMA.EHR.CheckInConsumer.csproj" -c Release -o /app/build # ใช้ stage ใหม่สำหรับการ runtime FROM mcr.microsoft.com/dotnet/runtime:8.0 AS runtime @@ -53,4 +55,4 @@ WORKDIR /app COPY --from=build /app/build . # ระบุ entry point ของแอปพลิเคชัน -ENTRYPOINT ["dotnet", "BMA.EHR.CheckInConsumer.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "BMA.EHR.CheckInConsumer.dll"] diff --git a/BMA.EHR.Leave/Dockerfile b/BMA.EHR.Leave/Dockerfile index a6899e01..3c211ab3 100644 --- a/BMA.EHR.Leave/Dockerfile +++ b/BMA.EHR.Leave/Dockerfile @@ -13,7 +13,7 @@ COPY ["BMA.EHR.Application/BMA.EHR.Application.csproj", "BMA.EHR.Application/"] COPY ["BMA.EHR.Infrastructure/BMA.EHR.Infrastructure.csproj", "BMA.EHR.Infrastructure/"] COPY ["BMA.EHR.Leave/BMA.EHR.Leave.csproj", "BMA.EHR.Leave/"] -RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" +RUN dotnet restore "BMA.EHR.Leave/BMA.EHR.Leave.csproj" COPY . . WORKDIR "/src/BMA.EHR.Leave" RUN dotnet build "BMA.EHR.Leave.csproj" -c Release -o /app/build @@ -24,4 +24,4 @@ RUN dotnet publish "BMA.EHR.Leave.csproj" -c Release -o /app/publish /p:UseAppHo FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "BMA.EHR.Leave.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "BMA.EHR.Leave.dll"]