From dce3bbd1fbe123715a3729dae770c8bbfc40634d Mon Sep 17 00:00:00 2001 From: 3dwardch3ng Date: Mon, 9 Sep 2024 02:05:32 +0000 Subject: [PATCH 01/10] Update for next development version [skip ci] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9c7157e..323d450 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ ec-config-server - 1.0.7 + 1.0.8-SNAPSHOT From 7ff7534d05e21d44a371bcab2d75cf4653a74460 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 9 Sep 2024 20:09:38 +1000 Subject: [PATCH 02/10] testing GHA pipelines --- .github/workflows/build-and-publish-develop.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-publish-develop.yml b/.github/workflows/build-and-publish-develop.yml index 8f4c565..c1ca3fd 100644 --- a/.github/workflows/build-and-publish-develop.yml +++ b/.github/workflows/build-and-publish-develop.yml @@ -62,6 +62,9 @@ jobs: "username": "${env.NEXUS_USERNAME}", "password": "${env.NEXUS_PASSWORD}" }] + - name: Display Maven Settings + run: | + cat /home/runner/.m2/settings.xml - name: Maven Publish run: | mvn -B deploy -P homelab From c746c8fb8afabe498684de60293ac0568b2e5f56 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 9 Sep 2024 20:12:57 +1000 Subject: [PATCH 03/10] Revert "testing GHA pipelines" This reverts commit 7ff7534d05e21d44a371bcab2d75cf4653a74460. --- .github/workflows/build-and-publish-develop.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-and-publish-develop.yml b/.github/workflows/build-and-publish-develop.yml index c1ca3fd..8f4c565 100644 --- a/.github/workflows/build-and-publish-develop.yml +++ b/.github/workflows/build-and-publish-develop.yml @@ -62,9 +62,6 @@ jobs: "username": "${env.NEXUS_USERNAME}", "password": "${env.NEXUS_PASSWORD}" }] - - name: Display Maven Settings - run: | - cat /home/runner/.m2/settings.xml - name: Maven Publish run: | mvn -B deploy -P homelab From e27ca000445f2c03d2fe69f73ae124b80c9b63e5 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 9 Sep 2024 21:06:03 +1000 Subject: [PATCH 04/10] add GHA pipeline for sonarqube test --- .github/workflows/sonarqube.yaml | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/sonarqube.yaml diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml new file mode 100644 index 0000000..7d5ab39 --- /dev/null +++ b/.github/workflows/sonarqube.yaml @@ -0,0 +1,37 @@ +name: Build + +on: + workflow_dispatch: + push: + + +jobs: + build: + name: Build and analyze + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + - name: Set up JDK 17 + uses: actions/setup-java@v1 + with: + java-version: 17 + - name: Cache SonarQube packages + uses: actions/cache@v1 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + - name: Cache Maven packages + uses: actions/cache@v1 + with: + path: ~/.m2 + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + restore-keys: ${{ runner.os }}-m2 + - name: Build and analyze + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ec-microservice-commons -Dsonar.projectName='ec-microservice-commons' \ No newline at end of file From 37f8d6a250cc33430f2edd182c82d2033fe84f3a Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 9 Sep 2024 21:07:06 +1000 Subject: [PATCH 05/10] Revert "add GHA pipeline for sonarqube test" This reverts commit e27ca000445f2c03d2fe69f73ae124b80c9b63e5. --- .github/workflows/sonarqube.yaml | 37 -------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 .github/workflows/sonarqube.yaml diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml deleted file mode 100644 index 7d5ab39..0000000 --- a/.github/workflows/sonarqube.yaml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build - -on: - workflow_dispatch: - push: - - -jobs: - build: - name: Build and analyze - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Cache SonarQube packages - uses: actions/cache@v1 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v1 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - - name: Build and analyze - env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} - run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=ec-microservice-commons -Dsonar.projectName='ec-microservice-commons' \ No newline at end of file From 2ee6a3ffeca730acfdf05826411d2f17b6465f0d Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 9 Sep 2024 16:32:58 +0000 Subject: [PATCH 06/10] chore(deps): update actions/setup-java action to v4.3.0 --- .github/workflows/build-and-publish-develop.yml | 6 +++--- .github/workflows/build-and-publish-release.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-publish-develop.yml b/.github/workflows/build-and-publish-develop.yml index 8f4c565..6bcfeb5 100644 --- a/.github/workflows/build-and-publish-develop.yml +++ b/.github/workflows/build-and-publish-develop.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 @@ -77,7 +77,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 @@ -162,7 +162,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 diff --git a/.github/workflows/build-and-publish-release.yml b/.github/workflows/build-and-publish-release.yml index 998567b..c3a73d6 100644 --- a/.github/workflows/build-and-publish-release.yml +++ b/.github/workflows/build-and-publish-release.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 @@ -95,7 +95,7 @@ jobs: with: ref: main fetch-depth: 1 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 @@ -181,7 +181,7 @@ jobs: with: ref: main fetch-depth: 1 - - uses: actions/setup-java@v4.2.2 + - uses: actions/setup-java@v4.3.0 if: ${{ hashFiles('**/pom.xml') }} with: java-version: 17 From 97b272d5c851bd3f01c5b02260330ec1f7d16d51 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 11 Sep 2024 21:12:33 +1000 Subject: [PATCH 07/10] add commons security library --- pom.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pom.xml b/pom.xml index 323d450..a1a4fd0 100644 --- a/pom.xml +++ b/pom.xml @@ -53,6 +53,16 @@ + + sydney.cheng + ec-microservice-commons-security + 1.0.1-SNAPSHOT + + + sydney.cheng + ec-microservice-commons-swagger + 1.0.1-SNAPSHOT + org.springframework.boot spring-boot-starter-actuator From 4a89510fc866b7d85f2a546f43bdd3c04d337acd Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 11 Sep 2024 21:31:41 +1000 Subject: [PATCH 08/10] add config server user creds --- pom.xml | 5 ----- src/main/resources/application.yml | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index a1a4fd0..bea7029 100644 --- a/pom.xml +++ b/pom.xml @@ -53,11 +53,6 @@ - - sydney.cheng - ec-microservice-commons-security - 1.0.1-SNAPSHOT - sydney.cheng ec-microservice-commons-swagger diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7ed3885..5f1c12f 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -37,6 +37,12 @@ spring: name: ${application.name} profiles: active: native + security: + basic: + enabled: true + user: + name: ${CONFIG_SERVER_USERNAME:configuser} + password: ${CONFIG_SERVER_PASSWORD:configPass$1234} cloud: config: server: From 917db3eafb3d437f6a4b3b5d6ea12d31e86e956b Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 11 Sep 2024 21:34:33 +1000 Subject: [PATCH 09/10] update super pom version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index bea7029..345c65d 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ sydney.cheng ec-super-pom - 1.0.4 + 1.0.5 ec-config-server From cd5ef6bf02fbdc02df605fd18c2da8815bef8862 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 11 Sep 2024 21:36:44 +1000 Subject: [PATCH 10/10] add springdoc config --- src/main/resources/application.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 5f1c12f..0d42816 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -53,4 +53,12 @@ spring: eureka: client: - enabled: false \ No newline at end of file + enabled: false + +springdoc: + swagger-ui: + path: /swagger-ui.html + displayRequestDuration: true + api-docs: + path: /api-docs + show-actuator: true \ No newline at end of file