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

billing and collection #1453

Open
wants to merge 1 commit into
base: develop
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
48 changes: 48 additions & 0 deletions .github/workflows/billing-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Billing-Service Image Build workflow
on:
push:
branches:
- develop
paths:
- 'common/billing-service/**'
pull_request:
branches:
- develop
paths:
- 'common/billing-service/**'
workflow_dispatch:
workflow_call:

jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Docker
uses: docker/setup-buildx-action@v1

Comment on lines +16 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update action versions.

The static analysis hints suggest updating the action versions for actions/checkout@v2 and docker/setup-buildx-action@v1 to avoid issues with the runner.

Apply this diff to update the action versions:

- uses: actions/checkout@v2
+ uses: actions/checkout@v3

- uses: docker/setup-buildx-action@v1
+ uses: docker/setup-buildx-action@v2
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Docker
uses: docker/setup-buildx-action@v1
jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Docker
uses: docker/setup-buildx-action@v2
Tools
actionlint

22-22: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


25-25: the runner of "docker/setup-buildx-action@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

# Login to Azure Container Registry
- name: Login to Azure Container Registry
run: docker login -u pucarsdev -p ${{ secrets.ACR_PASSWORD }} pucardev.azurecr.io

- name: Build and Push Docker image for Billing-Service
run: |
docker build --build-arg WORK_DIR="common/billing-service" -t pucardev.azurecr.io/pucar_billing:v1.0.0-${{ github.sha }} -f build/maven/Dockerfile .
docker push pucardev.azurecr.io/pucar_billing:v1.0.0-${{ github.sha }}

- name: Build and Push Docker image for Billing-Service_DB
run: |
docker build -t pucardev.azurecr.io/pucar_billing_db:v1.0.0-${{ github.sha }} -f Dockerfile .
docker push pucardev.azurecr.io/pucar_billing_db:v1.0.0-${{ github.sha }}
working-directory: common/billing-service/src/main/resources/db
- name: Trigger Deployment Pipeline
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GHUB_TOKEN }}" \
https://api.github.com/repos/pucardotorg/pucar-Devops/actions/workflows/dev.yaml/dispatches \
-d '{"ref":"Dev-0"}'
48 changes: 48 additions & 0 deletions .github/workflows/collection-services.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Collection-Service Image Build workflow
on:
push:
branches:
- develop
paths:
- 'common/collection-services/**'
pull_request:
branches:
- develop
paths:
- 'common/collection-services/**'
workflow_dispatch:
workflow_call:

jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Docker
uses: docker/setup-buildx-action@v1

Comment on lines +16 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update action versions.

The static analysis hints suggest updating the action versions for actions/checkout@v2 and docker/setup-buildx-action@v1 to avoid issues with the runner.

Apply this diff to update the action versions:

- uses: actions/checkout@v2
+ uses: actions/checkout@v3

- uses: docker/setup-buildx-action@v1
+ uses: docker/setup-buildx-action@v2
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Setup Docker
uses: docker/setup-buildx-action@v1
jobs:
docker_image-build:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Docker
uses: docker/setup-buildx-action@v2
Tools
actionlint

22-22: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


25-25: the runner of "docker/setup-buildx-action@v1" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

# Login to Azure Container Registry
- name: Login to Azure Container Registry
run: docker login -u pucarsdev -p ${{ secrets.ACR_PASSWORD }} pucardev.azurecr.io

- name: Build and Push Docker image for Collection-Service
run: |
docker build --build-arg WORK_DIR="common/collection-services" -t pucardev.azurecr.io/pucar_collection:v1.0.0-${{ github.sha }} -f build/maven/Dockerfile .
docker push pucardev.azurecr.io/pucar_collection:v1.0.0-${{ github.sha }}

- name: Build and Push Docker image for Collection-Service_DB
run: |
docker build -t pucardev.azurecr.io/pucar_collection_db:v1.0.0-${{ github.sha }} -f Dockerfile .
docker push pucardev.azurecr.io/pucar_collection_db:v1.0.0-${{ github.sha }}
working-directory: common/collection-services/src/main/resources/db
- name: Trigger Deployment Pipeline
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GHUB_TOKEN }}" \
https://api.github.com/repos/pucardotorg/pucar-Devops/actions/workflows/dev.yaml/dispatches \
-d '{"ref":"Dev-0"}'
19 changes: 18 additions & 1 deletion build/maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
FROM egovio/amazoncorretto:17-alpine3.19 AS build

#FROM egovio/alpine-maven-builder-jdk-8:1-master-NA-6036091e AS build
#FROM ghcr.io/egovernments/alpine-maven-builder-jdk-8:1-master-na-6036091e AS build
FROM maven:3.8.4-openjdk-17-slim AS build
ARG WORK_DIR
WORKDIR /app

Expand All @@ -13,6 +16,20 @@ COPY ${WORK_DIR}/src ./src
RUN mvn -B -f /app/pom.xml package


# Create runtime image
#FROM egovio/8-openjdk-alpine
#FROM ghcr.io/egovernments/8-openjdk-alpine:latest
FROM openjdk:17-jdk-alpine

WORKDIR /opt/egov

COPY --from=build /app/target/*.jar /app/start.sh /opt/egov/

RUN chmod +x /opt/egov/start.sh

CMD ["/opt/egov/start.sh"]


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove redundant line.

The line FROM egovio/amazoncorretto:17-alpine3.19 is duplicated and should be removed to avoid confusion.

Apply this diff to remove the redundant line:

- FROM egovio/amazoncorretto:17-alpine3.19

Committable suggestion was skipped due to low confidence.

# Create runtime image
FROM egovio/amazoncorretto:17-alpine3.19

Expand Down