Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
jacopocarlini committed Apr 9, 2024
1 parent 977a0a5 commit 622d22d
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 344 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/anchore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v3

- name: Build the Docker image
run: docker build --build-arg APP_NAME=anchoreimage . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest
run: docker build . --file ${{ env.DOCKERFILE }} --tag localbuild/testimage:latest

- name: Run the Anchore scan action itself with GitHub Advanced Security code scanning integration enabled
uses: anchore/scan-action@v3
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.release.outputs.version }}
build_args: |
'QUARKUS_PROFILE=prod'
'APP_NAME=pagopa-gpd-payments-pull'

deploy_aks:
name: Deploy on AKS
Expand Down
9 changes: 2 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ WORKDIR /code
RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline
COPY src /code/src
COPY agent /code/agent
ARG QUARKUS_PROFILE
ARG APP_NAME

USER root
RUN echo $(ls -1 /code/src)
Expand All @@ -23,7 +21,7 @@ RUN cd /code && \
curl -o 'applicationinsights-agent.jar' -L 'https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.17/applicationinsights-agent-3.4.17.jar'

# build the application
RUN ./mvnw package -DskipTests=true -Dquarkus.application.name=$APP_NAME -Dquarkus.profile=$QUARKUS_PROFILE
RUN ./mvnw package -DskipTests=true

RUN mkdir -p /code/target/otel && \
chmod 777 /code/opentelemetry-javaagent.jar && \
Expand Down Expand Up @@ -56,8 +54,5 @@ EXPOSE 8080
EXPOSE 12345
USER 185

ARG QUARKUS_PROFILE
ARG APP_NAME

ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Dquarkus.application.name=$APP_NAME -Dquarkus.profile=$QUARKUS_PROFILE -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ Expose APIs that will be used by IO to retrieve the PDF receipts
- [Api Documentation 📖](#api-documentation-)
- [Technology Stack 📚](#technology-stack-)
- [Start Project Locally 🚀](#start-project-locally-)
* [Run locally with Docker](#run-locally-with-docker)
+ [Prerequisites](#prerequisites)
+ [Run docker container](#run-docker-container)
* [Running the application in dev mode](#running-the-application-in-dev-mode)
* [Run locally with Docker](#run-locally-with-docker)
+ [Prerequisites](#prerequisites)
+ [Run docker container](#run-docker-container)
* [Running the application in dev mode](#running-the-application-in-dev-mode)
- [Develop Locally 💻](#develop-locally-)
* [Prerequisites](#prerequisites)
* [Testing 🧪](#testing-)
+ [Unit test](#unit-test)
+ [Integration test [WIP]](#integration-test-wip)
+ [Performance test [WIP]](#performance-test-wip)
* [Prerequisites](#prerequisites)
* [Testing 🧪](#testing-)
+ [Unit test](#unit-test)
+ [Integration test [WIP]](#integration-test-wip)
+ [Performance test [WIP]](#performance-test-wip)
- [Contributors 👥](#contributors-)
* [Maintainers](#maintainers)
* [Maintainers](#maintainers)

---

Expand Down Expand Up @@ -55,6 +55,7 @@ or that for `json` version ```http://localhost:8080/q/openapi?format=json```
- lombok (provided)

---

## Start Project Locally 🚀

### Running the application in dev mode
Expand All @@ -76,7 +77,7 @@ You can run your application in dev mode that enables live coding using:

#### Set environment variables

`docker build --build-arg QUARKUS_PROFILE=prod --build-arg APP_NAME=pagopa-receipt-pdf-service -t pagopa-receipt -pdf-service .`
`docker build -t pagopa-receipt -pdf-service .`

`cp .env.example .env`

Expand Down
15 changes: 7 additions & 8 deletions helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -67,9 +67,8 @@ microservice-chart:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "70"
fileConfig: {}
fileConfig: { }
envConfig:
APP_NAME: "gpd-payments-pull"
APP_ENVIRONMENT: "dev"
WEBSITE_SITE_NAME: 'gpd-payments-pull' # required to show cloud role name in application insights
APP_LOGGING_LEVEL: 'DEBUG'
Expand All @@ -89,8 +88,8 @@ microservice-chart:
keyvault:
name: "pagopa-d-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -117,5 +116,5 @@ microservice-chart:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "0.0.1"
pullPolicy: Always
envConfig: {}
envSecret: {}
envConfig: { }
envSecret: { }
15 changes: 7 additions & 8 deletions helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -67,9 +67,8 @@ microservice-chart:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "70"
fileConfig: {}
fileConfig: { }
envConfig:
APP_NAME: "gpd-payments-pull"
APP_ENVIRONMENT: "prod"
WEBSITE_SITE_NAME: 'gpd-payments-pull' # required to show cloud role name in application insights
APP_LOGGING_LEVEL: 'DEBUG'
Expand All @@ -89,8 +88,8 @@ microservice-chart:
keyvault:
name: "pagopa-p-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -117,5 +116,5 @@ microservice-chart:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "0.0.1"
pullPolicy: Always
envConfig: {}
envSecret: {}
envConfig: { }
envSecret: { }
15 changes: 7 additions & 8 deletions helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ microservice-chart:
servicePort: 8080
serviceAccount:
create: false
annotations: {}
annotations: { }
name: ""
podAnnotations: {}
podAnnotations: { }
podSecurityContext:
seccompProfile:
type: RuntimeDefault
Expand Down Expand Up @@ -67,9 +67,8 @@ microservice-chart:
# Required
type: Utilization # Allowed types are 'Utilization' or 'AverageValue'
value: "70"
fileConfig: {}
fileConfig: { }
envConfig:
APP_NAME: "gpd-payments-pull"
APP_ENVIRONMENT: "uat"
WEBSITE_SITE_NAME: 'gpd-payments-pull' # required to show cloud role name in application insights
APP_LOGGING_LEVEL: 'DEBUG'
Expand All @@ -89,8 +88,8 @@ microservice-chart:
keyvault:
name: "pagopa-u-gps-kv"
tenantId: "7788edaf-0346-4068-9d79-c868aed15b3d"
nodeSelector: {}
tolerations: []
nodeSelector: { }
tolerations: [ ]
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
Expand All @@ -117,5 +116,5 @@ microservice-chart:
repository: ghcr.io/pagopa/pagopa-gpd-payments-pull
tag: "0.0.1"
pullPolicy: Always
envConfig: {}
envSecret: {}
envConfig: { }
envSecret: { }
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>gpd-payments-pull</artifactId>
<name>GPD Payments Pull Services</name>
<version>1.0.5</version>

<properties>
Expand Down
93 changes: 0 additions & 93 deletions src/main/docker/Dockerfile.jvm

This file was deleted.

Loading

0 comments on commit 622d22d

Please sign in to comment.