Skip to content

Commit

Permalink
Merge pull request #441 from bcgov/release/0.5.0
Browse files Browse the repository at this point in the history
Release/0.5.0
  • Loading branch information
KFloodBCGov authored Apr 17, 2024
2 parents 7f685e5 + 034b8bf commit 3bb0b21
Show file tree
Hide file tree
Showing 83 changed files with 759 additions and 810 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dev-email-worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: "Set up JDK 8"
- name: "Set up JDK 17"
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 8
java-version: 17

- name: Get Java Project Version
id: get-version
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/dev-libs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
with:
working-directory: src
profile: libs
java_version: 17
secrets:
nexus_snapshot_username: "${{ secrets.NEXUS_SNAPSHOT_USERNAME }}"
nexus_snapshot_password: "${{ secrets.NEXUS_SNAPSHOT_PASSWORD }}"
Expand Down
72 changes: 51 additions & 21 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,61 @@ on:
- prod

jobs:
# unit-test:
# uses: SierraSystems/reusable-workflows/.github/workflows/java-unit-tests.yml@main
# with:
# working_directory: "src"
# profile: ${{ github.event.inputs.app_name }}
# secrets:
# nexus_url: ${{ secrets.NEXUS_URL }}
# unit-test:
# uses: SierraSystems/reusable-workflows/.github/workflows/java-unit-tests.yml@main
# with:
# working_directory: "src"
# profile: ${{ github.event.inputs.app_name }}
# java_version: 17
# secrets:
# nexus_url: ${{ secrets.NEXUS_URL }}

# app-version disabled since "Error: Process completed with exit code 1.", not sure exit code 1 is because of echo 1 (${version)
# app-version:
# uses: SierraSystems/reusable-workflows/.github/workflows/java-maven-app-version.yml@main
# with:
# working_directory: "src/${{ github.event.inputs.app_name }}"
app-version:
name: Get the app-version from the POM file
runs-on: ubuntu-latest
defaults:
run:
working-directory: "."
outputs:
app-version: ${{ steps.get-app-version.outputs.version }}

steps:
- uses: actions/checkout@v2

- name: Build Vips Client
working-directory: "./src/libs"
run: git submodule update --init

- name: "Set up JDK 17"
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Get Project Version
id: get-app-version
working-directory: "./src"
run: |
_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -P${{ github.event.inputs.app_name }})
echo "version=$_version " >> "$GITHUB_OUTPUT"
echo $_version
build-and-push-image:
# needs:
# - unit-test
# - app-version
needs:
- app-version
uses: SierraSystems/reusable-workflows/.github/workflows/docker-build-and-push-image.yml@main
with:
app_name: ${{ github.event.inputs.app_name }}
working_directory: .
# image_tags: "dev,${{ needs.app-version.outputs.app-version }}"
image_tags: "dev,1"
image_tags: "dev,${{ needs.app-version.outputs.app-version }}"
env: tools
build_args: |-
DPS_SERVICE_NAME=${{ github.event.inputs.app_name }}
Expand All @@ -65,17 +96,16 @@ jobs:

trivy:
needs:
# - app-version
- app-version
- build-and-push-image
uses: SierraSystems/reusable-workflows/.github/workflows/trivy-scan-openshift-image.yml@main
with:
imagestream_name: ${{ github.event.inputs.app_name }}
# image_tag: "${{ needs.app-version.outputs.app-version }}"
image_tag: "latest"
image_tag: "${{ needs.app-version.outputs.app-version }}"
secrets:
openshift_external_repository: "${{ secrets.OPENSHIFT_EXTERNAL_REPOSITORY_SILVER }}"
openshift_namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools"
openshift_sa_name: "${{ secrets.OPENSHIFT_SA_PIPELINE_PASSWORD_SILVER }}"
openshift_sa_password: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"
openshift_server_url: "${{ secrets.OPENSHIFT_SERVER_URL_SILVER }}"
openshift_token: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"
openshift_token: "${{ secrets.OPENSHIFT_SA_PIPELINE_TOKEN_SILVER }}"
4 changes: 2 additions & 2 deletions .github/workflows/maven-sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- uses: actions/cache@v1
with:
path: ~/.m2/repository
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/maven-test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,20 @@ jobs:

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17

- uses: whelk-io/maven-settings-xml-action@v20
with:
servers: >-
[{
"id":"nexus-snapshots",
"username": "${{ secrets.NEXUS_SNAPSHOT_USERNAME }}",
"password": "${{ secrets.NEXUS_SNAPSHOT_PASSWORD }}"
},{
"id":"nexus-releases",
"username": "${{ secrets.NEXUS_RELEASES_USERNAME }}",
"password": "${{ secrets.NEXUS_RELEASES_PASSWORD }}"
}]
- name: Pull & update submodules recursively
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
java-version: '17'
cache: 'maven'
- name: Build with Maven
run: mvn -B test --file src/pom.xml -P all
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/openshift-imagetagging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
image_stream_name: "${{ github.event.inputs.app_name }}"
source_image_tag: "${{ github.event.inputs.source_image_tag }}"
image_tags: "${{ github.event.inputs.environment }}"
image_tags: "${{ github.event.inputs.target_environment }}"
secrets:
openshift_namespace: "${{ secrets.OPENSHIFT_LICENSE_PLATE_SILVER }}-tools"
openshift_server_url: "${{ secrets.OPENSHIFT_SERVER_URL_SILVER }}"
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/libs/jag-vips-client"]
path = src/libs/jag-vips-client
url = https://github.com/bcgov/jag-vips-client.git
37 changes: 25 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
##############################################################################################
#### Stage where the git submodules are updated ###
##############################################################################################
## Defining Arguments and env vars
ARG DPS_SERVICE_NAME

FROM alpine/git as libraries
WORKDIR /libs
COPY . .
RUN git submodule update --init

#############################################################################################
### Stage where Docker is caching the dependencies spring boot app using maven ###
#############################################################################################
#FROM image-registry.apps.silver.devops.gov.bc.ca/043918-tools/maven:3.8.6-eclipse-temurin-8 as dependencies
FROM maven:3.8.6-eclipse-temurin-8 as dependencies
FROM maven:3.8.6-eclipse-temurin-17 as dependencies

## Defining Arguments and env vars
ARG NEXUS_URL=https://nexus-043918-tools.apps.silver.devops.gov.bc.ca
ARG DPS_SERVICE_NAME

ENV NEXUS_URL=${NEXUS_URL}

## Definig home folder
ENV HOME=/opt/app
RUN mkdir -p $HOME
Expand All @@ -28,6 +36,9 @@ COPY src/figaro-validation-service/pom.xml figaro-validation-service/pom.xml

COPY src/spd-notification-worker/pom.xml spd-notification-worker/pom.xml
COPY src/vips-notification-worker/pom.xml vips-notification-worker/pom.xml
COPY src/report/pom.xml report/pom.xml

COPY --from=libraries /libs/src/libs/jag-vips-client/src/jag-vips-client/pom.xml libs/jag-vips-client/src/jag-vips-client/pom.xml

COPY src/libs/dps-bom/pom.xml libs/dps-bom/pom.xml
COPY src/libs/dfcms-ords-client/pom.xml libs/dfcms-ords-client/pom.xml
Expand All @@ -48,38 +59,40 @@ RUN mvn dependency:go-offline \
--batch-mode \
--fail-never


#############################################################################################
### Stage where Docker is building spring boot app using maven ###
#############################################################################################
FROM dependencies as build

ARG NEXUS_URL=https://nexus-043918-tools.apps.silver.devops.gov.bc.ca

ARG DPS_SERVICE_NAME
ARG MVN_PROFILES=${DPS_SERVICE_NAME}
ARG SKIP_TESTS=true

ENV NEXUS_URL=${NEXUS_URL}

ENV HOME=/opt/app
RUN mkdir -p $HOME
WORKDIR $HOME

COPY src .

COPY --from=libraries /libs/src/libs/jag-vips-client/src/jag-vips-client libs/jag-vips-client/src/jag-vips-client

RUN mvn -B clean install \
--no-transfer-progress \
--batch-mode \
-DskipTests=${SKIP_TESTS} \
-P libs

RUN mvn clean package \
--no-transfer-progress \
--batch-mode \
-DskipTests=${SKIP_TESTS} \
-P ${MVN_PROFILES}


##############################################################################################
#### Stage where Docker is running a java process to run a service built in previous stage ###
##############################################################################################
#FROM image-registry.apps.silver.devops.gov.bc.ca/043918-tools/eclipse-temurin:8-jre-jammy
FROM eclipse-temurin:8-jre-jammy
FROM eclipse-temurin:17-jre-jammy

ARG DPS_SERVICE_NAME

Expand All @@ -90,4 +103,4 @@ WORKDIR $HOME
COPY --from=build ${HOME}/${DPS_SERVICE_NAME}/target/${DPS_SERVICE_NAME}-*.jar ${HOME}/service.jar

CMD ["java", "-jar", "service.jar"]
#############################################################################################
#############################################################################################
52 changes: 26 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,33 +82,33 @@ docker-compose up --build -d

## Endpoints

| URL | Method | Description |
| --- | --- | --- |
| **Payment Service** | --- | --- |
| [http://localhost:5050/paymentservice/bamboraconfiguration](http://localhost:5050/paymentservice/bamboraconfiguration) | GET | Bambora configuration url |
| [http://localhost:5050/paymentservice/getSinglePaymentURL](http://localhost:5050/paymentservice/getSinglePaymentURL) | GET | Single Payment Url |
| [http://localhost:8081/paymentservice/actuator/health](http://localhost:8081/paymentservice/actuator/health) | GET | Payment Service Health |
| [http://localhost:8081/paymentservice/swagger-ui.html](http://localhost:8081/paymentservice/swagger-ui.html) | GET | Figaro Validator Swagger-UI |
| [http://localhost:8081/paymentservice/v2/api-docs](http://localhost:8081/paymentservice/v2/api-docs) | GET | Figaro Validator Api docs |
| **Figaro Validation** | --- | --- |
| [http://localhost:5050/figvalidationservice/locateMatchingApplicants](http://localhost:5050/figvalidationservice/locateMatchingApplicants) | GET | Locate Matching Applicants |
| [http://localhost:5050/figvalidationservice/validateApplicantService](http://localhost:5050/figvalidationservice/validateApplicantService) | GET | Validate Applicant Service |
| URL | Method | Description |
|--------------------------------------------------------------------------------------------------------------------------------------------------| --- | --- |
| **Payment Service** | --- | --- |
| [http://localhost:5050/paymentservice/bamboraconfiguration](http://localhost:5050/paymentservice/bamboraconfiguration) | GET | Bambora configuration url |
| [http://localhost:5050/paymentservice/getSinglePaymentURL](http://localhost:5050/paymentservice/getSinglePaymentURL) | GET | Single Payment Url |
| [http://localhost:8081/paymentservice/actuator/health](http://localhost:8084/paymentservice/actuator/health) | GET | Payment Service Health |
| [http://localhost:8081/paymentservice/swagger-ui.html](http://localhost:8084/paymentservice/swagger-ui.html) | GET | Figaro Validator Swagger-UI |
| [http://localhost:8081/paymentservice/v2/api-docs](http://localhost:8084/paymentservice/v3/api-docs) | GET | Figaro Validator Api docs |
| **Figaro Validation** | --- | --- |
| [http://localhost:5050/figvalidationservice/locateMatchingApplicants](http://localhost:5050/figvalidationservice/locateMatchingApplicants) | GET | Locate Matching Applicants |
| [http://localhost:5050/figvalidationservice/validateApplicantService](http://localhost:5050/figvalidationservice/validateApplicantService) | GET | Validate Applicant Service |
| [http://localhost:5050/figvalidationservice/validateApplicantForSharing](http://localhost:5050/figvalidationservice/validateApplicantForSharing) | GET | Validate Applicant Sharing |
| [http://localhost:5050/figvalidationservice/validateApplicantPartyId](http://localhost:5050/figvalidationservice/validateApplicantPartyId) | GET | Validate Applicant Party ID |
| [http://localhost:8082/figvalidationservice/actuator/health](http://localhost:8082/figvalidationservice/actuator/health) | GET | Figaro Validator Health |
| [http://localhost:8082/figvalidationservice/swagger-ui.html](http://localhost:8082/figvalidationservice/swagger-ui.html) | GET | Figaro Validator Swagger-UI |
| **DPS Validation** | --- | --- |
| [http://localhost:5050/dpsvalidationservice/getValidOpenDFCMCase](http://localhost:5050/dpsvalidationservice/getValidOpenDFCMCase) | GET | Valid Open DFCM Case |
| [http://localhost:8083/dpsvalidationservice/actuator/health](http://localhost:8083/dpsvalidationservice/actuator/health) | GET | DPS Validation Service Health |
| [http://localhost:8083/dpsvalidationservice/swagger-ui.html](http://localhost:8083/dpsvalidationservice/swagger-ui.html) | GET | DPS Validation Service Swagger-UI |
| [http://localhost:8083/dpsvalidationservice/v2/api-docs](http://localhost:8083/dpsvalidationservice/v2/api-docs) | GET | DPS Validation Service Swagger |
| **DPS Output Notification** | --- | --- |
| [http://localhost:5054/dpsnotificationservice/actuator/health](http://localhost:5054/dpsnotificationservice/actuator/health) | GET | DPS Notification Service Health |
| [http://localhost:5050/ws/dpsOutputNotification.wsdl](http://localhost:5050/ws/dpsOutputNotification.wsdl) | GET | DPS Output Notification Service WSDL |
| **CRRP Notification Worker** | --- | --- |
| [http://localhost:5055/crrpnotificationworker/actuator/health](http://localhost:5054/crrpnotificationworker/actuator/health) | GET | CRRP Notification
| **CRRP Notification Worker** | --- | --- |
| [http://localhost:5056/vipsnotificationworker/actuator/health](http://localhost:5056/vipsnotificationworker/actuator/health) | GET | CRRP Notification
| [http://localhost:5050/figvalidationservice/validateApplicantPartyId](http://localhost:5050/figvalidationservice/validateApplicantPartyId) | GET | Validate Applicant Party ID |
| [http://localhost:8082/figvalidationservice/actuator/health](http://localhost:8082/figvalidationservice/actuator/health) | GET | Figaro Validator Health |
| [http://localhost:8082/figvalidationservice/swagger-ui.html](http://localhost:8082/figvalidationservice/swagger-ui.html) | GET | Figaro Validator Swagger-UI |
| **DPS Validation** | --- | --- |
| [http://localhost:5050/dpsvalidationservice/getValidOpenDFCMCase](http://localhost:5050/dpsvalidationservice/getValidOpenDFCMCase) | GET | Valid Open DFCM Case |
| [http://localhost:8083/dpsvalidationservice/actuator/health](http://localhost:8083/dpsvalidationservice/actuator/health) | GET | DPS Validation Service Health |
| [http://localhost:8083/dpsvalidationservice/swagger-ui.html](http://localhost:8083/dpsvalidationservice/swagger-ui.html) | GET | DPS Validation Service Swagger-UI |
| [http://localhost:8083/dpsvalidationservice/v2/api-docs](http://localhost:8083/dpsvalidationservice/v3/api-docs) | GET | DPS Validation Service Swagger |
| **DPS Output Notification** | --- | --- |
| [http://localhost:5054/dpsnotificationservice/actuator/health](http://localhost:5054/dpsnotificationservice/actuator/health) | GET | DPS Notification Service Health |
| [http://localhost:5050/ws/dpsOutputNotification.wsdl](http://localhost:5050/ws/dpsOutputNotification.wsdl) | GET | DPS Output Notification Service WSDL |
| **CRRP Notification Worker** | --- | --- |
| [http://localhost:5055/crrpnotificationworker/actuator/health](http://localhost:5054/crrpnotificationworker/actuator/health) | GET | CRRP Notification
| **CRRP Notification Worker** | --- | --- |
| [http://localhost:5056/vipsnotificationworker/actuator/health](http://localhost:5056/vipsnotificationworker/actuator/health) | GET | CRRP Notification


Worker Health |
Expand Down
16 changes: 10 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
- SPLUNK_TOKEN=${SPLUNK_TOKEN}
- SWAGGER_UI_ENABLED=true
ports:
- "8081:8080"
- "8084:8080"
networks:
- dps-net

Expand All @@ -71,9 +71,9 @@ services:
- DPS_SERVICE_NAME=figaro-validation-service
environment:
- SWAGGER_UI_ENABLED=true
- FIGCR_BASE_PATH=$FIGCR_BASE_PATH
- FIGCR_BASE_PATH=${FIGCR_BASE_PATH}
ports:
- "8082:8081"
- "8082:8080"
networks:
- dps-net

Expand All @@ -88,9 +88,10 @@ services:
- DPS_SERVICE_NAME=dps-validation-service
environment:
- SWAGGER_UI_ENABLED=true
- DFCMS_BASE_PATH=$DFCMS_BASE_PATH
- DFCMS_BASE_PATH=${DFCMS_BASE_PATH}
- DFCMS_EIGHT_DIGIT_LICENSE=${DFCMS_EIGHT_DIGIT_LICENSE}
ports:
- "8083:8081"
- "8083:8080"
networks:
- dps-net

Expand Down Expand Up @@ -136,7 +137,10 @@ services:
- "5056:8080"
environment:
- RABBITMQ_HOST=rabbitmq
- FIGCR_BASE_PATH=$FIGCR_BASE_PATH
- FIGCR_BASE_PATH=${FIGCR_BASE_PATH}
- VIPS_BASE_PATH=${VIPS_BASE_PATH}
- VIPS_USERNAME=${VIPS_USERNAME}
- VIPS_PASSWORD=${VIPS_PASSWORD}
networks:
- dps-net

Expand Down
2 changes: 1 addition & 1 deletion openshift/templates/dps-payment-service.bc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ spec:
value: 'http://nexus:8081/repository/dps-group/'
from:
kind: ImageStreamTag
name: 'java:8'
name: 'java:17'
namespace: openshift
type: Source
successfulBuildsHistoryLimit: 5
Expand Down
Loading

0 comments on commit 3bb0b21

Please sign in to comment.