From 577fda370830a6ceeb3301f79b2a8a8d0d883f00 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 13 Mar 2025 13:09:37 -0700 Subject: [PATCH 01/99] adding ci file --- .github/workflows/ci-pipeline.yml | 48 +++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/ci-pipeline.yml diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml new file mode 100644 index 000000000..a47cd458c --- /dev/null +++ b/.github/workflows/ci-pipeline.yml @@ -0,0 +1,48 @@ +name: CI Pipeline with JFrog Artifactory + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '17' + + - name: Cache Maven dependencies + uses: actions/cache@v3 + with: + path: ~/.m2 + key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} + restore-keys: maven-${{ runner.os }}- + + - name: Compile the code + run: mvn clean compile + + - name: Run tests + run: mvn test + + - name: Build Docker image + run: | + docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest . + + - name: Log in to JFrog Artifactory using Identity Token + run: echo ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} | docker login trialt0zppb.jfrog.io -u ${{ secrets.ARTIFACTORY_USERNAME }} --password-stdin + + - name: Push Docker image to JFrog Artifactory + run: | + docker push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest + From 4f4a6a4d82232d0e551d63fe611e4700102188d3 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 13 Mar 2025 13:20:51 -0700 Subject: [PATCH 02/99] added dockerfile and updated ci pipeline --- .github/workflows/ci-pipeline.yml | 3 +++ Dockerfile | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index a47cd458c..1ec7b1ad1 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -35,6 +35,9 @@ jobs: - name: Run tests run: mvn test + - name: Package the application with Maven + run: mvn package -DskipTests + - name: Build Docker image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e3c8936d9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +# Use an official OpenJDK runtime as a parent image +FROM openjdk:17-jdk-slim + +# Set the working directory inside the container +WORKDIR /app + +# Copy the built JAR file from the target directory +COPY target/spring-petclinic-*.jar app.jar + +# Expose the application port +EXPOSE 8080 + +# Run the application +CMD ["java", "-jar", "app.jar"] + From dfa59004527ba816c3c325d686afe22204dcface Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 13 Mar 2025 14:57:57 -0700 Subject: [PATCH 03/99] updating ci-pipeline.yml so we proxy maven central thru artifactory --- .github/workflows/ci-pipeline.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 1ec7b1ad1..d1c871fac 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -22,6 +22,27 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Configure Maven to use JFrog Artifactory + run: | + mkdir -p ~/.m2 + echo ' + + + jfrog-artifactory + central + https://trialt0zppb.jfrog.io/artifactory/maven-maven-remote/ + true + + + + + jfrog-artifactory + ${{ secrets.ARTIFACTORY_USERNAME }} + ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} + + + ' > ~/.m2/settings.xml + - name: Cache Maven dependencies uses: actions/cache@v3 with: @@ -46,6 +67,5 @@ jobs: run: echo ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} | docker login trialt0zppb.jfrog.io -u ${{ secrets.ARTIFACTORY_USERNAME }} --password-stdin - name: Push Docker image to JFrog Artifactory - run: | - docker push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest + run: docker push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest From 03f24b63db69e2017509c4ed39321f26989dc20a Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 13 Mar 2025 15:26:54 -0700 Subject: [PATCH 04/99] don't cache dependencies in github so we proxy thru artifactory --- .github/workflows/ci-pipeline.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index d1c871fac..026afd4d7 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -43,13 +43,6 @@ jobs: ' > ~/.m2/settings.xml - - name: Cache Maven dependencies - uses: actions/cache@v3 - with: - path: ~/.m2 - key: maven-${{ runner.os }}-${{ hashFiles('**/pom.xml') }} - restore-keys: maven-${{ runner.os }}- - - name: Compile the code run: mvn clean compile From 8bc9d5ec05dd15b98997c2d56757ad749006e3f3 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 09:36:01 -0700 Subject: [PATCH 05/99] using jfrog cli so we publish maven artifact and build info --- .github/workflows/ci-pipeline.yml | 46 +++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 026afd4d7..1e56841b5 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -22,6 +22,20 @@ jobs: distribution: 'temurin' java-version: '17' + - name: Install JFrog CLI + run: | + curl -fL https://getcli.jfrog.io | bash + chmod +x jfrog + mv jfrog /usr/local/bin/ + + - name: Configure JFrog CLI + run: | + jfrog config add my-artifactory \ + --artifactory-url=https://trialt0zppb.jfrog.io/artifactory \ + --user=${{ secrets.ARTIFACTORY_USERNAME }} \ + --password=${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} \ + --interactive=false + - name: Configure Maven to use JFrog Artifactory run: | mkdir -p ~/.m2 @@ -43,22 +57,24 @@ jobs: ' > ~/.m2/settings.xml - - name: Compile the code - run: mvn clean compile - - - name: Run tests - run: mvn test - - - name: Package the application with Maven - run: mvn package -DskipTests - - - name: Build Docker image + - name: Compile and Package the Application run: | - docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest . + mvn clean package -DskipTests - - name: Log in to JFrog Artifactory using Identity Token - run: echo ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} | docker login trialt0zppb.jfrog.io -u ${{ secrets.ARTIFACTORY_USERNAME }} --password-stdin + - name: Publish Maven Artifact to JFrog Artifactory + run: | + jfrog rt mvn clean install --build-name=spring-petclinic --build-number=${{ github.run_id }} - - name: Push Docker image to JFrog Artifactory - run: docker push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest + - name: Build Docker Image + run: | + docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . + - name: Collect Docker Build Info with JFrog CLI + run: | + jfrog rt docker-push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} onboarding-docker-local \ + --build-name=spring-petclinic \ + --build-number=${{ github.run_id }} + + - name: Publish Build Info to JFrog Artifactory + run: | + jfrog rt build-publish spring-petclinic ${{ github.run_id }} From 4e85331f60d3a6b5d5e66d8d811e22b7f2f1a025 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 09:44:44 -0700 Subject: [PATCH 06/99] fixing mvn command --- .github/workflows/ci-pipeline.yml | 32 +++++++++++-------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 1e56841b5..b7ea925c9 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -36,26 +36,14 @@ jobs: --password=${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} \ --interactive=false - - name: Configure Maven to use JFrog Artifactory + - name: Configure JFrog CLI for Maven run: | - mkdir -p ~/.m2 - echo ' - - - jfrog-artifactory - central - https://trialt0zppb.jfrog.io/artifactory/maven-maven-remote/ - true - - - - - jfrog-artifactory - ${{ secrets.ARTIFACTORY_USERNAME }} - ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} - - - ' > ~/.m2/settings.xml + jfrog rt mvnc --server-id-resolve=my-artifactory \ + --repo-resolve-releases=maven-maven-remote \ + --repo-resolve-snapshots=maven-maven-remote \ + --server-id-deploy=my-artifactory \ + --repo-deploy-releases=maven-libs-release-local \ + --repo-deploy-snapshots=maven-libs-snapshot-local - name: Compile and Package the Application run: | @@ -63,13 +51,15 @@ jobs: - name: Publish Maven Artifact to JFrog Artifactory run: | - jfrog rt mvn clean install --build-name=spring-petclinic --build-number=${{ github.run_id }} + jfrog rt mvn clean install --config my-artifactory \ + --build-name=spring-petclinic \ + --build-number=${{ github.run_id }} - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - - name: Collect Docker Build Info with JFrog CLI + - name: Push Docker Image to JFrog Artifactory using JFrog CLI run: | jfrog rt docker-push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} onboarding-docker-local \ --build-name=spring-petclinic \ From 38f5cdea65bd4f4ca6bc1d4ba6430e02191a7194 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 09:49:07 -0700 Subject: [PATCH 07/99] removing --config flag from jfrog rt mvn --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index b7ea925c9..d11d9ce9e 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -51,7 +51,7 @@ jobs: - name: Publish Maven Artifact to JFrog Artifactory run: | - jfrog rt mvn clean install --config my-artifactory \ + jfrog rt mvn clean install \ --build-name=spring-petclinic \ --build-number=${{ github.run_id }} From f0e1652472068da77354715403a613f55d3e803d Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:01:50 -0700 Subject: [PATCH 08/99] setting proxy for mvn --- .github/workflows/ci-pipeline.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index d11d9ce9e..ba44c70a0 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -38,16 +38,20 @@ jobs: - name: Configure JFrog CLI for Maven run: | - jfrog rt mvnc --server-id-resolve=my-artifactory \ + jfrog rt mvnc \ + --server-id-resolve=my-artifactory \ --repo-resolve-releases=maven-maven-remote \ --repo-resolve-snapshots=maven-maven-remote \ --server-id-deploy=my-artifactory \ --repo-deploy-releases=maven-libs-release-local \ - --repo-deploy-snapshots=maven-libs-snapshot-local + --repo-deploy-snapshots=maven-libs-snapshot-local \ + --set-proxy + + - name: Debug Maven Settings + run: mvn help:effective-settings - name: Compile and Package the Application - run: | - mvn clean package -DskipTests + run: mvn clean package -DskipTests - name: Publish Maven Artifact to JFrog Artifactory run: | From cb6fba2310adefa1d758a881e46ee44de5941d72 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:06:54 -0700 Subject: [PATCH 09/99] fixing mvn config --- .github/workflows/ci-pipeline.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index ba44c70a0..13158697a 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -44,8 +44,7 @@ jobs: --repo-resolve-snapshots=maven-maven-remote \ --server-id-deploy=my-artifactory \ --repo-deploy-releases=maven-libs-release-local \ - --repo-deploy-snapshots=maven-libs-snapshot-local \ - --set-proxy + --repo-deploy-snapshots=maven-libs-snapshot-local - name: Debug Maven Settings run: mvn help:effective-settings From f66f7ea9499d570d8b45c4f9510dd3ef7071c7be Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:23:12 -0700 Subject: [PATCH 10/99] fixing mvn --- .github/workflows/ci-pipeline.yml | 58 +++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 13158697a..00958274b 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,27 +1,34 @@ -name: CI Pipeline with JFrog Artifactory +name: Build and Publish with JFrog Artifactory on: push: - branches: - - main + branches: [ "main" ] pull_request: - branches: - - main + branches: [ "main" ] jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout repository + ################################################################ + # 1) Check out your code + ################################################################ + - name: Checkout uses: actions/checkout@v3 + ################################################################ + # 2) Set up Java + ################################################################ - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'temurin' java-version: '17' + ################################################################ + # 3) Install & configure JFrog CLI + ################################################################ - name: Install JFrog CLI run: | curl -fL https://getcli.jfrog.io | bash @@ -32,10 +39,14 @@ jobs: run: | jfrog config add my-artifactory \ --artifactory-url=https://trialt0zppb.jfrog.io/artifactory \ - --user=${{ secrets.ARTIFACTORY_USERNAME }} \ - --password=${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} \ + --user="${{ secrets.ARTIFACTORY_USERNAME }}" \ + --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ --interactive=false + ################################################################ + # 4) Configure Maven to Use Artifactory + # (jfrog rt mvnc sets up the Maven resolver & deploy repos) + ################################################################ - name: Configure JFrog CLI for Maven run: | jfrog rt mvnc \ @@ -46,28 +57,37 @@ jobs: --repo-deploy-releases=maven-libs-release-local \ --repo-deploy-snapshots=maven-libs-snapshot-local - - name: Debug Maven Settings - run: mvn help:effective-settings + ################################################################ + # 5) Clear the local .m2 cache to avoid leftover references + ################################################################ + - name: Clear local Maven cache + run: rm -rf ~/.m2/repository - - name: Compile and Package the Application - run: mvn clean package -DskipTests - - - name: Publish Maven Artifact to JFrog Artifactory + ################################################################ + # 6) Maven build & publish artifact via JFrog CLI with build info + ################################################################ + - name: Build & Publish Maven Artifact run: | jfrog rt mvn clean install \ --build-name=spring-petclinic \ - --build-number=${{ github.run_id }} + --build-number="${{ github.run_id }}" + ################################################################ + # 7) Build and push Docker image with JFrog CLI (no 'docker push') + ################################################################ - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - - name: Push Docker Image to JFrog Artifactory using JFrog CLI + - name: Push Docker Image to Artifactory run: | jfrog rt docker-push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} onboarding-docker-local \ --build-name=spring-petclinic \ - --build-number=${{ github.run_id }} + --build-number="${{ github.run_id }}" - - name: Publish Build Info to JFrog Artifactory + ################################################################ + # 8) Publish the Build Info to Artifactory for full traceability + ################################################################ + - name: Publish Build Info run: | - jfrog rt build-publish spring-petclinic ${{ github.run_id }} + jfrog rt build-publish spring-petclinic "${{ github.run_id }}" From 160e9b3d75027f9e6189051e5588213dacf3ec31 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:28:25 -0700 Subject: [PATCH 11/99] fixing mvn --- .github/workflows/ci-pipeline.yml | 50 ++++++++++--------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 00958274b..3c71c4890 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -2,33 +2,26 @@ name: Build and Publish with JFrog Artifactory on: push: - branches: [ "main" ] + branches: [main] pull_request: - branches: [ "main" ] + branches: [main] jobs: build: runs-on: ubuntu-latest - steps: - ################################################################ - # 1) Check out your code - ################################################################ - name: Checkout uses: actions/checkout@v3 - ################################################################ - # 2) Set up Java - ################################################################ - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' java-version: '17' + distribution: 'temurin' + + - name: Set build-info extractor version + run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV - ################################################################ - # 3) Install & configure JFrog CLI - ################################################################ - name: Install JFrog CLI run: | curl -fL https://getcli.jfrog.io | bash @@ -43,11 +36,7 @@ jobs: --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ --interactive=false - ################################################################ - # 4) Configure Maven to Use Artifactory - # (jfrog rt mvnc sets up the Maven resolver & deploy repos) - ################################################################ - - name: Configure JFrog CLI for Maven + - name: Configure Maven for Artifactory run: | jfrog rt mvnc \ --server-id-resolve=my-artifactory \ @@ -57,37 +46,28 @@ jobs: --repo-deploy-releases=maven-libs-release-local \ --repo-deploy-snapshots=maven-libs-snapshot-local - ################################################################ - # 5) Clear the local .m2 cache to avoid leftover references - ################################################################ - name: Clear local Maven cache run: rm -rf ~/.m2/repository - ################################################################ - # 6) Maven build & publish artifact via JFrog CLI with build info - ################################################################ - - name: Build & Publish Maven Artifact + - name: Debug Maven Settings + run: mvn help:effective-settings + + - name: Maven Build & Publish run: | jfrog rt mvn clean install \ - --build-name=spring-petclinic \ + --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" - ################################################################ - # 7) Build and push Docker image with JFrog CLI (no 'docker push') - ################################################################ - - name: Build Docker Image + - name: Docker Build run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - - name: Push Docker Image to Artifactory + - name: Docker Push via JFrog CLI run: | jfrog rt docker-push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} onboarding-docker-local \ - --build-name=spring-petclinic \ + --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" - ################################################################ - # 8) Publish the Build Info to Artifactory for full traceability - ################################################################ - name: Publish Build Info run: | jfrog rt build-publish spring-petclinic "${{ github.run_id }}" From d7e09d4c17cd94edca7ff3b18b5311c66ef460d2 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:31:42 -0700 Subject: [PATCH 12/99] Delete .github/workflows/maven-build.yml Signed-off-by: Jesse Houldsworth --- .github/workflows/maven-build.yml | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 .github/workflows/maven-build.yml diff --git a/.github/workflows/maven-build.yml b/.github/workflows/maven-build.yml deleted file mode 100644 index a1ec4dab7..000000000 --- a/.github/workflows/maven-build.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ '17' ] - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK ${{matrix.java}} - uses: actions/setup-java@v4 - with: - java-version: ${{matrix.java}} - distribution: 'adopt' - cache: maven - - name: Build with Maven Wrapper - run: ./mvnw -B verify From 30dcaf6fc8e7ed423e23b7495aa35b029e3407c6 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:31:58 -0700 Subject: [PATCH 13/99] Delete .github/workflows/gradle-build.yml Signed-off-by: Jesse Houldsworth --- .github/workflows/gradle-build.yml | 31 ------------------------------ 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/gradle-build.yml diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml deleted file mode 100644 index c24c121b1..000000000 --- a/.github/workflows/gradle-build.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow will build a Java project with Gradle, and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://docs.github.com/en/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-gradle - -name: Java CI with Gradle - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ '17' ] - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK ${{matrix.java}} - uses: actions/setup-java@v4 - with: - java-version: ${{matrix.java}} - distribution: 'adopt' - cache: maven - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Build with Gradle - run: ./gradlew build From 6c454a21f95e029103d9423eb42a098f1f78ba07 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:32:21 -0700 Subject: [PATCH 14/99] fixing mvn --- .github/workflows/ci-pipeline.yml | 92 +++++++++++++++++++++++-------- 1 file changed, 69 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 3c71c4890..d7f2a6308 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,33 +1,43 @@ -name: Build and Publish with JFrog Artifactory +name: CI Pipeline (Simplified) on: push: - branches: [main] + branches: [ "main" ] pull_request: - branches: [main] + branches: [ "main" ] jobs: build: runs-on: ubuntu-latest + steps: + ################################################# + # 1) Check out the repository + ################################################# - name: Checkout uses: actions/checkout@v3 + ################################################# + # 2) Set up Java + ################################################# - name: Set up JDK 17 uses: actions/setup-java@v3 with: java-version: '17' distribution: 'temurin' - - name: Set build-info extractor version - run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV - + ################################################# + # 3) Install JFrog CLI + ################################################# - name: Install JFrog CLI run: | curl -fL https://getcli.jfrog.io | bash chmod +x jfrog mv jfrog /usr/local/bin/ + ################################################# + # 4) Configure JFrog CLI + ################################################# - name: Configure JFrog CLI run: | jfrog config add my-artifactory \ @@ -36,38 +46,74 @@ jobs: --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ --interactive=false - - name: Configure Maven for Artifactory - run: | - jfrog rt mvnc \ - --server-id-resolve=my-artifactory \ - --repo-resolve-releases=maven-maven-remote \ - --repo-resolve-snapshots=maven-maven-remote \ - --server-id-deploy=my-artifactory \ - --repo-deploy-releases=maven-libs-release-local \ - --repo-deploy-snapshots=maven-libs-snapshot-local + ################################################# + # 5) (Optional) Modify Maven Settings to Use Artifactory + # + # This is optional if your project's pom.xml references + # standard Maven Central. If you do want all dependencies + # to come from Artifactory, you can still do: + # + # jfrog rt mvnc --server-id-resolve=my-artifactory ... + # + # but it may not be strictly necessary if the goal + # is simply to upload the final artifact. + ################################################# + ################################################# + # 6) Clear the local Maven cache + ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository - - name: Debug Maven Settings - run: mvn help:effective-settings + ################################################# + # 7) Build with standard Maven (no build-info extraction) + ################################################# + - name: Maven Build + run: mvn clean package -DskipTests - - name: Maven Build & Publish + ################################################# + # 8) Upload the built artifact with JFrog CLI + # + # target/*.jar -> maven-libs-release-local (or whichever repo you prefer) + ################################################# + - name: Upload Maven Artifact to Artifactory run: | - jfrog rt mvn clean install \ + jfrog rt upload \ + "target/*.jar" \ + "maven-libs-release-local/spring-petclinic/" \ + --flat=false \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" - - name: Docker Build + ################################################# + # 9) Build Docker image with local Docker + ################################################# + - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - - name: Docker Push via JFrog CLI + ################################################# + # 10) Push Docker image using JFrog CLI + ################################################# + - name: Push Docker Image to Artifactory run: | - jfrog rt docker-push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} onboarding-docker-local \ + jfrog rt docker-push \ + trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} \ + onboarding-docker-local \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" + ################################################# + # 11) Collect & Publish Build Info + # + # This won't include the dependency graph from + # "jfrog rt mvn", but you'll still get: + # - The JAR(s) you uploaded + # - Docker image(s) + # - Environment info + ################################################# - name: Publish Build Info run: | - jfrog rt build-publish spring-petclinic "${{ github.run_id }}" + jfrog rt build-publish \ + "spring-petclinic" \ + "${{ github.run_id }}" From 17a59d1146998e8552a881e21dca5bd475dd6135 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:46:42 -0700 Subject: [PATCH 15/99] trying fix from jeffry --- .github/workflows/ci-pipeline.yml | 55 ++++++++----------------------- 1 file changed, 13 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index d7f2a6308..3adb305e1 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,22 +1,18 @@ name: CI Pipeline (Simplified) - on: push: branches: [ "main" ] pull_request: branches: [ "main" ] - jobs: build: runs-on: ubuntu-latest - steps: ################################################# # 1) Check out the repository ################################################# - name: Checkout uses: actions/checkout@v3 - ################################################# # 2) Set up Java ################################################# @@ -25,7 +21,6 @@ jobs: with: java-version: '17' distribution: 'temurin' - ################################################# # 3) Install JFrog CLI ################################################# @@ -34,7 +29,6 @@ jobs: curl -fL https://getcli.jfrog.io | bash chmod +x jfrog mv jfrog /usr/local/bin/ - ################################################# # 4) Configure JFrog CLI ################################################# @@ -45,36 +39,22 @@ jobs: --user="${{ secrets.ARTIFACTORY_USERNAME }}" \ --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ --interactive=false - ################################################# - # 5) (Optional) Modify Maven Settings to Use Artifactory - # - # This is optional if your project's pom.xml references - # standard Maven Central. If you do want all dependencies - # to come from Artifactory, you can still do: - # - # jfrog rt mvnc --server-id-resolve=my-artifactory ... - # - # but it may not be strictly necessary if the goal - # is simply to upload the final artifact. - ################################################# - - ################################################# - # 6) Clear the local Maven cache + # 5) Clear the local Maven cache ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository - ################################################# - # 7) Build with standard Maven (no build-info extraction) + # 6) Build with JFrog CLI wrapped around Maven ################################################# - - name: Maven Build - run: mvn clean package -DskipTests - + - name: Build with JFrog CLI + run: | + jfrog rt mvn clean package \ + --build-name="spring-petclinic" \ + --build-number="${{ github.run_id }}" \ + --fail-fast=true ################################################# - # 8) Upload the built artifact with JFrog CLI - # - # target/*.jar -> maven-libs-release-local (or whichever repo you prefer) + # 7) Upload the built artifact with JFrog CLI ################################################# - name: Upload Maven Artifact to Artifactory run: | @@ -84,16 +64,14 @@ jobs: --flat=false \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" - ################################################# - # 9) Build Docker image with local Docker + # 8) Build Docker image with local Docker ################################################# - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - ################################################# - # 10) Push Docker image using JFrog CLI + # 9) Push Docker image using JFrog CLI ################################################# - name: Push Docker Image to Artifactory run: | @@ -102,18 +80,11 @@ jobs: onboarding-docker-local \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" - ################################################# - # 11) Collect & Publish Build Info - # - # This won't include the dependency graph from - # "jfrog rt mvn", but you'll still get: - # - The JAR(s) you uploaded - # - Docker image(s) - # - Environment info + # 10) Collect & Publish Build Info ################################################# - name: Publish Build Info run: | jfrog rt build-publish \ "spring-petclinic" \ - "${{ github.run_id }}" + "${{ github.run_id }}" \ No newline at end of file From fca01580549f9fa8e0c561e2e39e1a3de63bba8c Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 10:49:47 -0700 Subject: [PATCH 16/99] trying fix from jeffry --- .github/workflows/ci-pipeline.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 3adb305e1..01f32cd01 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -52,7 +52,6 @@ jobs: jfrog rt mvn clean package \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" \ - --fail-fast=true ################################################# # 7) Upload the built artifact with JFrog CLI ################################################# From d97fa011a84dfb78a4a95031c3e55af62084f817 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 11:03:07 -0700 Subject: [PATCH 17/99] added jfrog mvn config --- .github/workflows/ci-pipeline.yml | 32 +++++++++++++++---------------- .jfrog/projects/maven.yaml | 11 +++++++++++ 2 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 .jfrog/projects/maven.yaml diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 01f32cd01..be86d8ed7 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -13,6 +13,7 @@ jobs: ################################################# - name: Checkout uses: actions/checkout@v3 + ################################################# # 2) Set up Java ################################################# @@ -21,6 +22,7 @@ jobs: with: java-version: '17' distribution: 'temurin' + ################################################# # 3) Install JFrog CLI ################################################# @@ -29,31 +31,24 @@ jobs: curl -fL https://getcli.jfrog.io | bash chmod +x jfrog mv jfrog /usr/local/bin/ + ################################################# - # 4) Configure JFrog CLI - ################################################# - - name: Configure JFrog CLI - run: | - jfrog config add my-artifactory \ - --artifactory-url=https://trialt0zppb.jfrog.io/artifactory \ - --user="${{ secrets.ARTIFACTORY_USERNAME }}" \ - --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ - --interactive=false - ################################################# - # 5) Clear the local Maven cache + # 4) Clear the local Maven cache ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository + ################################################# - # 6) Build with JFrog CLI wrapped around Maven + # 5) Build with JFrog CLI wrapped around Maven ################################################# - name: Build with JFrog CLI run: | jfrog rt mvn clean package \ --build-name="spring-petclinic" \ - --build-number="${{ github.run_id }}" \ + --build-number="${{ github.run_id }}" + ################################################# - # 7) Upload the built artifact with JFrog CLI + # 6) Upload the built artifact with JFrog CLI ################################################# - name: Upload Maven Artifact to Artifactory run: | @@ -63,14 +58,16 @@ jobs: --flat=false \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" + ################################################# - # 8) Build Docker image with local Docker + # 7) Build Docker image with local Docker ################################################# - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . + ################################################# - # 9) Push Docker image using JFrog CLI + # 8) Push Docker image using JFrog CLI ################################################# - name: Push Docker Image to Artifactory run: | @@ -79,8 +76,9 @@ jobs: onboarding-docker-local \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" + ################################################# - # 10) Collect & Publish Build Info + # 9) Collect & Publish Build Info ################################################# - name: Publish Build Info run: | diff --git a/.jfrog/projects/maven.yaml b/.jfrog/projects/maven.yaml new file mode 100644 index 000000000..fe69ad9d2 --- /dev/null +++ b/.jfrog/projects/maven.yaml @@ -0,0 +1,11 @@ +version: 1 +type: maven +resolver: + serverId: test3 + snapshotRepo: maven-libs-snapshot + releaseRepo: maven-libs-release +deployer: + serverId: test3 + snapshotRepo: maven-libs-snapshot-local + releaseRepo: maven-libs-release-local +useWrapper: true From daa414b93c6b310dbbf8b2ba28366e22c8875456 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 11:12:00 -0700 Subject: [PATCH 18/99] fix --- .github/workflows/ci-pipeline.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index be86d8ed7..8c7ce4032 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -33,13 +33,24 @@ jobs: mv jfrog /usr/local/bin/ ################################################# - # 4) Clear the local Maven cache + # 4) Configure JFrog CLI using GitHub secrets + ################################################# + - name: Configure JFrog CLI + run: | + jfrog config add my-artifactory \ + --artifactory-url=https://trialt0zppb.jfrog.io/artifactory \ + --user="${{ secrets.ARTIFACTORY_USERNAME }}" \ + --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ + --interactive=false + + ################################################# + # 5) Clear the local Maven cache ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository ################################################# - # 5) Build with JFrog CLI wrapped around Maven + # 6) Build with JFrog CLI wrapped around Maven ################################################# - name: Build with JFrog CLI run: | @@ -48,7 +59,7 @@ jobs: --build-number="${{ github.run_id }}" ################################################# - # 6) Upload the built artifact with JFrog CLI + # 7) Upload the built artifact with JFrog CLI ################################################# - name: Upload Maven Artifact to Artifactory run: | @@ -60,14 +71,14 @@ jobs: --build-number="${{ github.run_id }}" ################################################# - # 7) Build Docker image with local Docker + # 8) Build Docker image with local Docker ################################################# - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . ################################################# - # 8) Push Docker image using JFrog CLI + # 9) Push Docker image using JFrog CLI ################################################# - name: Push Docker Image to Artifactory run: | @@ -78,7 +89,7 @@ jobs: --build-number="${{ github.run_id }}" ################################################# - # 9) Collect & Publish Build Info + # 10) Collect & Publish Build Info ################################################# - name: Publish Build Info run: | From 7cedd752b9238dc360787fd41033e35926c7f479 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 11:21:06 -0700 Subject: [PATCH 19/99] fixing artifactory serverId --- .jfrog/projects/maven.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.jfrog/projects/maven.yaml b/.jfrog/projects/maven.yaml index fe69ad9d2..9eb98cc6c 100644 --- a/.jfrog/projects/maven.yaml +++ b/.jfrog/projects/maven.yaml @@ -1,11 +1,11 @@ version: 1 type: maven resolver: - serverId: test3 + serverId: my-artifactory snapshotRepo: maven-libs-snapshot releaseRepo: maven-libs-release deployer: - serverId: test3 + serverId: my-artifactory snapshotRepo: maven-libs-snapshot-local releaseRepo: maven-libs-release-local useWrapper: true From f206d23341264c82d955899f0bf47759f5e479a8 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 11:40:13 -0700 Subject: [PATCH 20/99] adding debug flags to mvn --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 8c7ce4032..11f3c8149 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -54,7 +54,7 @@ jobs: ################################################# - name: Build with JFrog CLI run: | - jfrog rt mvn clean package \ + jfrog rt mvn clean package -X -e \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" From cdf8fd25e2c5f7b3771365fd0800b6651e6e81b2 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:09:41 -0700 Subject: [PATCH 21/99] trying to force version of build info extractor --- .github/workflows/ci-pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 11f3c8149..9680cfd91 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -23,6 +23,9 @@ jobs: java-version: '17' distribution: 'temurin' + - name: Set build-info extractor version + run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV + ################################################# # 3) Install JFrog CLI ################################################# From a794a8afcc2e081504732231b484d6c9a4fb4890 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:13:59 -0700 Subject: [PATCH 22/99] manually downloading the build extractor --- .github/workflows/ci-pipeline.yml | 80 ++++++++++++++++++++----------- 1 file changed, 51 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 9680cfd91..5350e58de 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -1,12 +1,15 @@ -name: CI Pipeline (Simplified) +name: Build with JFrog CLI (Forcing New Extractor) + on: push: branches: [ "main" ] pull_request: branches: [ "main" ] + jobs: build: runs-on: ubuntu-latest + steps: ################################################# # 1) Check out the repository @@ -20,14 +23,26 @@ jobs: - name: Set up JDK 17 uses: actions/setup-java@v3 with: - java-version: '17' distribution: 'temurin' - - - name: Set build-info extractor version - run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV + java-version: '17' ################################################# - # 3) Install JFrog CLI + # 3) Download & Override Build-Info Extractor + # + # We manually download a newer build-info-extractor + # to overshadow the old 2.28.6 version. Adjust + # 2.39.6 to any newer version you prefer. + ################################################# + - name: Download & Override Build-Info Extractor + run: | + mkdir -p custom-extractor + curl -sSL -o custom-extractor/build-info-extractor-uber.jar \ + https://repo1.maven.org/maven2/org/jfrog/buildinfo/build-info-extractor-maven3/2.39.6/build-info-extractor-maven3-2.39.6-uber.jar + + echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_DOWNLOAD_URL=file://$(pwd)/custom-extractor/build-info-extractor-uber.jar" >> $GITHUB_ENV + + ################################################# + # 4) Install JFrog CLI ################################################# - name: Install JFrog CLI run: | @@ -36,7 +51,7 @@ jobs: mv jfrog /usr/local/bin/ ################################################# - # 4) Configure JFrog CLI using GitHub secrets + # 5) Configure JFrog CLI ################################################# - name: Configure JFrog CLI run: | @@ -47,43 +62,52 @@ jobs: --interactive=false ################################################# - # 5) Clear the local Maven cache + # 6) Configure Maven Repos (Optional) + # + # If you want to ensure dependencies are fetched + # through Artifactory, uncomment the jfrog rt mvnc + # step below. If you're just hooking the build-info + # for publishing, you can skip it. + ################################################# + # - name: Configure JFrog CLI for Maven + # run: | + # jfrog rt mvnc \ + # --server-id-resolve=my-artifactory \ + # --repo-resolve-releases=maven-maven-remote \ + # --repo-resolve-snapshots=maven-maven-remote \ + # --server-id-deploy=my-artifactory \ + # --repo-deploy-releases=maven-libs-release-local \ + # --repo-deploy-snapshots=maven-libs-snapshot-local + + ################################################# + # 7) Clear local Maven cache ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository ################################################# - # 6) Build with JFrog CLI wrapped around Maven + # 8) Build via jfrog rt mvn, using the new extractor jar + # + # Notice the flags: -X -e for debug; remove them once + # you confirm it’s working. ################################################# - - name: Build with JFrog CLI + - name: Maven Build With JFrog CLI run: | jfrog rt mvn clean package -X -e \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" ################################################# - # 7) Upload the built artifact with JFrog CLI - ################################################# - - name: Upload Maven Artifact to Artifactory - run: | - jfrog rt upload \ - "target/*.jar" \ - "maven-libs-release-local/spring-petclinic/" \ - --flat=false \ - --build-name="spring-petclinic" \ - --build-number="${{ github.run_id }}" - - ################################################# - # 8) Build Docker image with local Docker + # 9) Build Docker Image ################################################# - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . ################################################# - # 9) Push Docker image using JFrog CLI + # 10) Push Docker Image via JFrog CLI ################################################# - - name: Push Docker Image to Artifactory + - name: Docker Push to Artifactory run: | jfrog rt docker-push \ trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} \ @@ -92,10 +116,8 @@ jobs: --build-number="${{ github.run_id }}" ################################################# - # 10) Collect & Publish Build Info + # 11) Publish Build Info ################################################# - name: Publish Build Info run: | - jfrog rt build-publish \ - "spring-petclinic" \ - "${{ github.run_id }}" \ No newline at end of file + jfrog rt build-publish "spring-petclinic" "${{ github.run_id }}" From 62518a1e40f5f26ab1f9ff1721d6c50d6029bfad Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:19:50 -0700 Subject: [PATCH 23/99] checking mvn version --- .github/workflows/ci-pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 5350e58de..3a6c458a5 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -84,6 +84,9 @@ jobs: ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository + + - name: check mvn version + run: mvn -version ################################################# # 8) Build via jfrog rt mvn, using the new extractor jar From 3e5834ca862ed930055b4a3e7251cbff7ca0a536 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:33:15 -0700 Subject: [PATCH 24/99] trying mvn wrapper fix --- .mvn/wrapper/maven-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties index 654af46a7..38efa3057 100644 --- a/.mvn/wrapper/maven-wrapper.properties +++ b/.mvn/wrapper/maven-wrapper.properties @@ -15,5 +15,5 @@ # specific language governing permissions and limitations # under the License. wrapperVersion=3.3.2 -distributionType=only-script +#distributionType=only-script distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip From 5b6a819e2bc7d54ecba788b917ca4936ff4e4403 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:34:32 -0700 Subject: [PATCH 25/99] checking mvnw version --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 3a6c458a5..a1162fe21 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -86,7 +86,7 @@ jobs: run: rm -rf ~/.m2/repository - name: check mvn version - run: mvn -version + run: mvnw -version ################################################# # 8) Build via jfrog rt mvn, using the new extractor jar From a009dedb883e15261fe0d4aa6128b391054ceddf Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:40:18 -0700 Subject: [PATCH 26/99] checking mvnw version --- .github/workflows/ci-pipeline.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index a1162fe21..d032cf781 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -85,8 +85,14 @@ jobs: - name: Clear local Maven cache run: rm -rf ~/.m2/repository + - name: Ensure mvnw is executable + run: chmod +x mvnw + - name: check mvn version - run: mvnw -version + run: ./mvnw -version + + - name: Debug repository files + run: ls -lah ################################################# # 8) Build via jfrog rt mvn, using the new extractor jar From 6b215598368d786bccd54b48dfb2020d796d4c36 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:54:50 -0700 Subject: [PATCH 27/99] setting maven wrapper to false --- .jfrog/projects/maven.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jfrog/projects/maven.yaml b/.jfrog/projects/maven.yaml index 9eb98cc6c..259739a18 100644 --- a/.jfrog/projects/maven.yaml +++ b/.jfrog/projects/maven.yaml @@ -8,4 +8,4 @@ deployer: serverId: my-artifactory snapshotRepo: maven-libs-snapshot-local releaseRepo: maven-libs-release-local -useWrapper: true +useWrapper: false From 5ae6eb099887d9f095c43bd7f8371009d9eb7f93 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 12:57:41 -0700 Subject: [PATCH 28/99] mvn clean install --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index d032cf781..9a0fb3025 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -102,7 +102,7 @@ jobs: ################################################# - name: Maven Build With JFrog CLI run: | - jfrog rt mvn clean package -X -e \ + jfrog rt mvn clean install -X -e \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" From 3cf4c9193546843b53a90fa0ac948d2d074ce339 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:28:16 -0700 Subject: [PATCH 29/99] maharshi --- .github/workflows/ci-pipeline.yml | 73 +++++++------------------------ 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 9a0fb3025..f3d3b81bd 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -26,73 +26,31 @@ jobs: distribution: 'temurin' java-version: '17' - ################################################# - # 3) Download & Override Build-Info Extractor - # - # We manually download a newer build-info-extractor - # to overshadow the old 2.28.6 version. Adjust - # 2.39.6 to any newer version you prefer. - ################################################# - - name: Download & Override Build-Info Extractor - run: | - mkdir -p custom-extractor - curl -sSL -o custom-extractor/build-info-extractor-uber.jar \ - https://repo1.maven.org/maven2/org/jfrog/buildinfo/build-info-extractor-maven3/2.39.6/build-info-extractor-maven3-2.39.6-uber.jar - - echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_DOWNLOAD_URL=file://$(pwd)/custom-extractor/build-info-extractor-uber.jar" >> $GITHUB_ENV - ################################################# # 4) Install JFrog CLI ################################################# - - name: Install JFrog CLI - run: | - curl -fL https://getcli.jfrog.io | bash - chmod +x jfrog - mv jfrog /usr/local/bin/ + - name: Setup JFrog CLI + uses: jfrog/setup-jfrog-cli@v4 + id: setup-cli + env: + JF_URL: ${{env.JF_RT_URL}} + JFROG_CLI_RELEASES_REPO: '${{env.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' + JFROG_CLI_EXTRACTORS_REMOTE: '${{env.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' + JF_GIT_TOKEN: ${{secrets.GH_TOKEN}} + JF_USER: ${{secrets.ARTIFACTORY_USERNAME}} + JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}} - ################################################# - # 5) Configure JFrog CLI - ################################################# - - name: Configure JFrog CLI - run: | - jfrog config add my-artifactory \ - --artifactory-url=https://trialt0zppb.jfrog.io/artifactory \ - --user="${{ secrets.ARTIFACTORY_USERNAME }}" \ - --password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \ - --interactive=false - - ################################################# - # 6) Configure Maven Repos (Optional) - # - # If you want to ensure dependencies are fetched - # through Artifactory, uncomment the jfrog rt mvnc - # step below. If you're just hooking the build-info - # for publishing, you can skip it. - ################################################# - # - name: Configure JFrog CLI for Maven - # run: | - # jfrog rt mvnc \ - # --server-id-resolve=my-artifactory \ - # --repo-resolve-releases=maven-maven-remote \ - # --repo-resolve-snapshots=maven-maven-remote \ - # --server-id-deploy=my-artifactory \ - # --repo-deploy-releases=maven-libs-release-local \ - # --repo-deploy-snapshots=maven-libs-snapshot-local - - ################################################# - # 7) Clear local Maven cache - ################################################# - name: Clear local Maven cache run: rm -rf ~/.m2/repository - name: Ensure mvnw is executable run: chmod +x mvnw - - name: check mvn version - run: ./mvnw -version + - name: ping jfrog + run: jf rt ping - - name: Debug repository files - run: ls -lah + - name: configure maven + run: jf mvnc --global --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} ################################################# # 8) Build via jfrog rt mvn, using the new extractor jar @@ -102,7 +60,8 @@ jobs: ################################################# - name: Maven Build With JFrog CLI run: | - jfrog rt mvn clean install -X -e \ + jf rt mvn clean install -X -e \ + --DskipTests=true --Denforcer.skip=true \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" From fa82310323ddeb56412f04791c57309287ccb7ee Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:31:00 -0700 Subject: [PATCH 30/99] maharshi --- .github/workflows/ci-pipeline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index f3d3b81bd..97fd2b465 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -33,9 +33,9 @@ jobs: uses: jfrog/setup-jfrog-cli@v4 id: setup-cli env: - JF_URL: ${{env.JF_RT_URL}} - JFROG_CLI_RELEASES_REPO: '${{env.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' - JFROG_CLI_EXTRACTORS_REMOTE: '${{env.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' + JF_URL: ${{secrets.JF_RT_URL}} + JFROG_CLI_RELEASES_REPO: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' + JFROG_CLI_EXTRACTORS_REMOTE: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' JF_GIT_TOKEN: ${{secrets.GH_TOKEN}} JF_USER: ${{secrets.ARTIFACTORY_USERNAME}} JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}} From f692b04027d7b2455140985e05d56f33482a7066 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:32:18 -0700 Subject: [PATCH 31/99] maharshi --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 97fd2b465..5e05caed7 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -60,7 +60,7 @@ jobs: ################################################# - name: Maven Build With JFrog CLI run: | - jf rt mvn clean install -X -e \ + jf mvn clean install -X -e \ --DskipTests=true --Denforcer.skip=true \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" From e5460118c675cfc584bba495bbcbf1a8f26d5d3c Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:37:06 -0700 Subject: [PATCH 32/99] Delete .jfrog/projects directory Signed-off-by: Jesse Houldsworth --- .jfrog/projects/maven.yaml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .jfrog/projects/maven.yaml diff --git a/.jfrog/projects/maven.yaml b/.jfrog/projects/maven.yaml deleted file mode 100644 index 259739a18..000000000 --- a/.jfrog/projects/maven.yaml +++ /dev/null @@ -1,11 +0,0 @@ -version: 1 -type: maven -resolver: - serverId: my-artifactory - snapshotRepo: maven-libs-snapshot - releaseRepo: maven-libs-release -deployer: - serverId: my-artifactory - snapshotRepo: maven-libs-snapshot-local - releaseRepo: maven-libs-release-local -useWrapper: false From 575c2d7f0ced4a32333bf5552d9e2f5dd1e88b44 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:37:49 -0700 Subject: [PATCH 33/99] maharshi --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 5e05caed7..c317e32e6 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -57,7 +57,7 @@ jobs: # # Notice the flags: -X -e for debug; remove them once # you confirm it’s working. - ################################################# + ################################################## - name: Maven Build With JFrog CLI run: | jf mvn clean install -X -e \ From cd640ed3d6a96cd5860fddc0a7ebc1ec0dc4f593 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 13:41:32 -0700 Subject: [PATCH 34/99] maharshi --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index c317e32e6..36fe8ab32 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -61,7 +61,7 @@ jobs: - name: Maven Build With JFrog CLI run: | jf mvn clean install -X -e \ - --DskipTests=true --Denforcer.skip=true \ + -DskipTests=true -Denforcer.skip=true \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" From f12e6c376b0d21fce97bba8560881e2d8e454fa5 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 15:54:48 -0700 Subject: [PATCH 35/99] adding notes --- .github/workflows/ci-pipeline.yml | 80 ++++++++++++++++++------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 36fe8ab32..7e58356a3 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -2,78 +2,88 @@ name: Build with JFrog CLI (Forcing New Extractor) on: push: - branches: [ "main" ] + branches: [ "main" ] # Trigger workflow on push to the main branch pull_request: - branches: [ "main" ] + branches: [ "main" ] # Trigger workflow on pull requests targeting main jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Use the latest Ubuntu runner for execution steps: ################################################# - # 1) Check out the repository + # 1) Checkout the repository to the runner ################################################# - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v3 # Pulls the latest code from the repository ################################################# - # 2) Set up Java + # 2) Set up Java environment ################################################# - name: Set up JDK 17 uses: actions/setup-java@v3 with: - distribution: 'temurin' - java-version: '17' + distribution: 'temurin' # Use Eclipse Temurin JDK (OpenJDK) + java-version: '17' # Ensure Java 17 is installed ################################################# - # 4) Install JFrog CLI + # 3) Install and Configure JFrog CLI ################################################# - name: Setup JFrog CLI - uses: jfrog/setup-jfrog-cli@v4 + uses: jfrog/setup-jfrog-cli@v4 # Official JFrog CLI GitHub Action id: setup-cli env: - JF_URL: ${{secrets.JF_RT_URL}} + JF_URL: ${{secrets.JF_RT_URL}} # Artifactory base URL (stored as a GitHub secret) JFROG_CLI_RELEASES_REPO: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' JFROG_CLI_EXTRACTORS_REMOTE: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' - JF_GIT_TOKEN: ${{secrets.GH_TOKEN}} - JF_USER: ${{secrets.ARTIFACTORY_USERNAME}} - JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}} + JF_GIT_TOKEN: ${{secrets.GH_TOKEN}} # GitHub token for authentication + JF_USER: ${{secrets.ARTIFACTORY_USERNAME}} # Artifactory username + JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}} # Artifactory identity token + ################################################# + # 4) Clean the local Maven cache (optional but recommended) + ################################################# - name: Clear local Maven cache - run: rm -rf ~/.m2/repository + run: rm -rf ~/.m2/repository # Ensures a clean build by removing old dependencies - name: Ensure mvnw is executable - run: chmod +x mvnw - - - name: ping jfrog - run: jf rt ping - - - name: configure maven - run: jf mvnc --global --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} + run: chmod +x mvnw # Make the Maven wrapper script executable ################################################# - # 8) Build via jfrog rt mvn, using the new extractor jar - # - # Notice the flags: -X -e for debug; remove them once - # you confirm it’s working. - ################################################## + # 5) Verify JFrog connection + ################################################# + - name: ping jfrog + run: jf rt ping # Verify connectivity to JFrog Artifactory + + ################################################# + # 6) Configure Maven to use JFrog as a repository + ################################################# + - name: configure maven + run: jf mvnc --global \ + --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} \ + --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} + # This sets up JFrog CLI to resolve dependencies from Artifactory + + ################################################# + # 7) Build project using JFrog CLI with Maven + ################################################# - name: Maven Build With JFrog CLI run: | - jf mvn clean install -X -e \ - -DskipTests=true -Denforcer.skip=true \ - --build-name="spring-petclinic" \ - --build-number="${{ github.run_id }}" + jf mvn clean install \ + -DskipTests=true -Denforcer.skip=true \ # Skip tests & enforce Maven rules + --build-name="spring-petclinic" \ # Set JFrog build name + --build-number="${{ github.run_id }}" # Use GitHub Actions run ID as build number ################################################# - # 9) Build Docker Image + # 8) Build Docker Image ################################################# - name: Build Docker Image run: | docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . + # Builds the application into a Docker image and tags it with the GitHub run ID ################################################# - # 10) Push Docker Image via JFrog CLI + # 9) Push Docker Image to JFrog Artifactory ################################################# - name: Docker Push to Artifactory run: | @@ -82,10 +92,12 @@ jobs: onboarding-docker-local \ --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" + # Uploads the built Docker image to Artifactory for storage and deployment ################################################# - # 11) Publish Build Info + # 10) Publish Build Information to JFrog ################################################# - name: Publish Build Info run: | jfrog rt build-publish "spring-petclinic" "${{ github.run_id }}" + # Publishes build metadata (dependencies, artifacts, environment) to JFrog From d277b13f19e64adc021e5c3665060b23efc75626 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 16:01:43 -0700 Subject: [PATCH 36/99] adding notes --- .github/workflows/ci-pipeline.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 7e58356a3..be545f1f1 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -59,9 +59,7 @@ jobs: # 6) Configure Maven to use JFrog as a repository ################################################# - name: configure maven - run: jf mvnc --global \ - --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} \ - --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} + run: jf mvnc --global --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} # This sets up JFrog CLI to resolve dependencies from Artifactory ################################################# From 8a57ffa71f8cadadd91cace218bededcdc6f42b8 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 14 Mar 2025 16:04:59 -0700 Subject: [PATCH 37/99] adding notes --- .github/workflows/ci-pipeline.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index be545f1f1..222b6353c 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -53,7 +53,7 @@ jobs: # 5) Verify JFrog connection ################################################# - name: ping jfrog - run: jf rt ping # Verify connectivity to JFrog Artifactory + run: jf rt ping ################################################# # 6) Configure Maven to use JFrog as a repository @@ -68,9 +68,9 @@ jobs: - name: Maven Build With JFrog CLI run: | jf mvn clean install \ - -DskipTests=true -Denforcer.skip=true \ # Skip tests & enforce Maven rules - --build-name="spring-petclinic" \ # Set JFrog build name - --build-number="${{ github.run_id }}" # Use GitHub Actions run ID as build number + -DskipTests=true -Denforcer.skip=true \ + --build-name="spring-petclinic" \ + --build-number="${{ github.run_id }}" ################################################# # 8) Build Docker Image From 3e3c2afff8fefe755808cd350c8ec45b3f1bcb43 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 17 Mar 2025 11:50:18 -0700 Subject: [PATCH 38/99] adding xray scan --- .github/workflows/ci-pipeline.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 222b6353c..51e41e0a8 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -73,7 +73,14 @@ jobs: --build-number="${{ github.run_id }}" ################################################# - # 8) Build Docker Image + # 8) Scan with XRay + ################################################# + - name: Scan Artifact + run: | + jf scan /path/to/artifact + + ################################################# + # 9) Build Docker Image ################################################# - name: Build Docker Image run: | @@ -81,7 +88,7 @@ jobs: # Builds the application into a Docker image and tags it with the GitHub run ID ################################################# - # 9) Push Docker Image to JFrog Artifactory + # 10) Push Docker Image to JFrog Artifactory ################################################# - name: Docker Push to Artifactory run: | @@ -93,7 +100,7 @@ jobs: # Uploads the built Docker image to Artifactory for storage and deployment ################################################# - # 10) Publish Build Information to JFrog + # 11) Publish Build Information to JFrog ################################################# - name: Publish Build Info run: | From d6eba12b736fd1ad5db23b6918a5b36382da71d7 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 17 Mar 2025 13:03:40 -0700 Subject: [PATCH 39/99] fixing xray command --- .github/workflows/ci-pipeline.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 51e41e0a8..ad069cb1b 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -77,8 +77,10 @@ jobs: ################################################# - name: Scan Artifact run: | - jf scan /path/to/artifact - + latest_jar=$(find target -name "*.jar" | sort | tail -n 1) + echo "Scanning: $latest_jar" + jf scan "$latest_jar" + ################################################# # 9) Build Docker Image ################################################# From c77655e8cf2c52ae0be5ccca8e5d7b8a4757273c Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 18 Mar 2025 09:58:34 -0700 Subject: [PATCH 40/99] enhancing github actions build publish steps --- .github/workflows/ci-pipeline.yml | 32 +++++++++---------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index ad069cb1b..be640332d 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -2,7 +2,10 @@ name: Build with JFrog CLI (Forcing New Extractor) on: push: - branches: [ "main" ] # Trigger workflow on push to the main branch + branches: + - master + - develop + pull_request: branches: [ "main" ] # Trigger workflow on pull requests targeting main @@ -69,7 +72,7 @@ jobs: run: | jf mvn clean install \ -DskipTests=true -Denforcer.skip=true \ - --build-name="spring-petclinic" \ + --build-name="webgoat" \ --build-number="${{ github.run_id }}" ################################################# @@ -82,29 +85,12 @@ jobs: jf scan "$latest_jar" ################################################# - # 9) Build Docker Image - ################################################# - - name: Build Docker Image - run: | - docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} . - # Builds the application into a Docker image and tags it with the GitHub run ID - - ################################################# - # 10) Push Docker Image to JFrog Artifactory - ################################################# - - name: Docker Push to Artifactory - run: | - jfrog rt docker-push \ - trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} \ - onboarding-docker-local \ - --build-name="spring-petclinic" \ - --build-number="${{ github.run_id }}" - # Uploads the built Docker image to Artifactory for storage and deployment - - ################################################# - # 11) Publish Build Information to JFrog + # 9) Publish Build Information to JFrog ################################################# - name: Publish Build Info run: | + jfrog rt build-collect-env # Collect environment variables + jfrog rt build-add-dependencies . # Add dependencies found in the current directory + jfrog rt build-add-git # Add Git commit information jfrog rt build-publish "spring-petclinic" "${{ github.run_id }}" # Publishes build metadata (dependencies, artifacts, environment) to JFrog From a07b18c984225338c75aa67953afb7a4897a90bf Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 18 Mar 2025 09:59:44 -0700 Subject: [PATCH 41/99] fixing branch name in ci file --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index be640332d..a76236f1d 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -3,7 +3,7 @@ name: Build with JFrog CLI (Forcing New Extractor) on: push: branches: - - master + - main - develop pull_request: From 040af4ba1d51fe0cd4d59d918c119bb76cfc7a3f Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 18 Mar 2025 10:09:32 -0700 Subject: [PATCH 42/99] fixing ci --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index a76236f1d..76f74b7b8 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -72,7 +72,7 @@ jobs: run: | jf mvn clean install \ -DskipTests=true -Denforcer.skip=true \ - --build-name="webgoat" \ + --build-name="spring-petclinic" \ --build-number="${{ github.run_id }}" ################################################# From ee87f387ebe2c9c2de41a6ca7f351dc9b3614dec Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 19 Mar 2025 12:03:48 -0700 Subject: [PATCH 43/99] adding docker stuff back in --- .github/workflows/ci-pipeline.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 76f74b7b8..919f77f1f 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -83,6 +83,24 @@ jobs: latest_jar=$(find target -name "*.jar" | sort | tail -n 1) echo "Scanning: $latest_jar" jf scan "$latest_jar" + + ################################################# + # 9) Build Docker image with local Docker + ################################################# + - name: Build Docker Image + run: | + docker build -t trialt0zppb.jfrog.io/petclinic-docker-dev-local/spring-petclinic:${{ github.run_id }} . + + ################################################# + # 10) Push Docker image using JFrog CLI + ################################################# + - name: Push Docker Image to Artifactory + run: | + jfrog rt docker-push \ + trialt0zppb.jfrog.io/petclinic-docker-dev-local/spring-petclinic:${{ github.run_id }} \ + petclinic-docker-dev-local \ + --build-name="spring-petclinic" \ + --build-number="${{ github.run_id }}" ################################################# # 9) Publish Build Information to JFrog From 6930e6bac26693033c278b0dd33608c8c688b5c3 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 19 Mar 2025 12:21:41 -0700 Subject: [PATCH 44/99] adding docker stuff back in --- .github/workflows/ci-pipeline.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 919f77f1f..7bc2db95c 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -58,6 +58,9 @@ jobs: - name: ping jfrog run: jf rt ping + - name: confirm artifactory secret + run: echo $ARTIFACTORY_REPO_URL + ################################################# # 6) Configure Maven to use JFrog as a repository ################################################# From 26dfa90073e686b3379352685dcb218e3a69a46d Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 19 Mar 2025 12:37:33 -0700 Subject: [PATCH 45/99] adding docker stuff back in --- .github/workflows/ci-pipeline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 7bc2db95c..bbf36d1a7 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -37,8 +37,8 @@ jobs: id: setup-cli env: JF_URL: ${{secrets.JF_RT_URL}} # Artifactory base URL (stored as a GitHub secret) - JFROG_CLI_RELEASES_REPO: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' - JFROG_CLI_EXTRACTORS_REMOTE: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}' + JFROG_CLI_RELEASES_REPO: 'https://trialt0zppb.jfrog.io/artifactory/petclinic-maven-dev-virtual/' + JFROG_CLI_EXTRACTORS_REMOTE: 'https://trialt0zppb.jfrog.io/artifactory/petclinic-maven-dev-virtual/' JF_GIT_TOKEN: ${{secrets.GH_TOKEN}} # GitHub token for authentication JF_USER: ${{secrets.ARTIFACTORY_USERNAME}} # Artifactory username JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}} # Artifactory identity token From d206d820c69436e34240dc172e7cdcf4e5a9aa8d Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 19 Mar 2025 12:38:50 -0700 Subject: [PATCH 46/99] adding docker stuff back in --- .github/workflows/ci-pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index bbf36d1a7..5b58919da 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -65,7 +65,7 @@ jobs: # 6) Configure Maven to use JFrog as a repository ################################################# - name: configure maven - run: jf mvnc --global --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}} + run: jf mvnc --global --repo-resolve-releases petclinic-maven-dev-virtual/ --repo-resolve-snapshots petclinic-maven-dev-virtual/ # This sets up JFrog CLI to resolve dependencies from Artifactory ################################################# From 381e7d1f1419e2d5b41a1199a7febe84a67e9e05 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 24 Mar 2025 16:41:54 -0700 Subject: [PATCH 47/99] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 000000000..e8f3d6f54 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,22 @@ +# Maven +# Build your Java project and run tests with Apache Maven. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/java + +trigger: +- main + +pool: + vmImage: ubuntu-latest + +steps: +- task: Maven@3 + inputs: + mavenPomFile: 'pom.xml' + mavenOptions: '-Xmx3072m' + javaHomeOption: 'JDKVersion' + jdkVersionOption: '1.11' + jdkArchitectureOption: 'x64' + publishJUnitResults: true + testResultsFiles: '**/surefire-reports/TEST-*.xml' + goals: 'package' From efba1926cc3d8984bee3251fef2a90b48866d157 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 12:11:30 -0700 Subject: [PATCH 48/99] adding Jenkinsfile --- Jenkinsfile | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..bbcae9e57 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,60 @@ +pipeline { + agent any + + tools { + maven 'maven-3' // your Maven tool label + } + + environment { + ARTIFACTORY_URL = 'http://localhost:8081/artifactory' + BUILD_NAME = "spring-petclinic" + BUILD_NUMBER = "${BUILD_ID}" + DOCKER_IMAGE = "localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID}" + } + + stages { + stage('Clone Repo') { + steps { + git branch: 'main', url: 'https://github.com/your-org/your-repo.git' + } + } + + stage('Build with Maven') { + steps { + rtMavenRun ( + tool: 'maven-3', + pom: 'pom.xml', + goals: 'clean install -DskipTests=true -Denforcer.skip=true', + resolverId: 'maven-resolver', + deployerId: 'maven-deployer' + ) + } + } + + stage('Docker Build and Push') { + steps { + script { + docker.build("${DOCKER_IMAGE}") + def server = Artifactory.server('artifactory-creds') + server.dockerPush( + image: "${DOCKER_IMAGE}", + targetRepo: 'petclinic-docker-dev-local', + buildInfo: Artifactory.newBuildInfo().name("${BUILD_NAME}").number("${BUILD_NUMBER}") + ) + } + } + } + + stage('Publish Build Info') { + steps { + script { + def server = Artifactory.server('artifactory-creds') + def buildInfo = Artifactory.newBuildInfo() + buildInfo.name = "${BUILD_NAME}" + buildInfo.number = "${BUILD_NUMBER}" + server.publishBuildInfo(buildInfo) + } + } + } + } +} From 3f3d898daed403aa729cabe07bdd6b76a5ad2a2a Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 12:48:00 -0700 Subject: [PATCH 49/99] jenkinsfile --- Jenkinsfile | 69 +++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bbcae9e57..b3adfcd22 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,59 +1,60 @@ pipeline { agent any - tools { - maven 'maven-3' // your Maven tool label - } - environment { - ARTIFACTORY_URL = 'http://localhost:8081/artifactory' - BUILD_NAME = "spring-petclinic" - BUILD_NUMBER = "${BUILD_ID}" - DOCKER_IMAGE = "localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID}" + JFROG_CLI_BUILD_NAME = "spring-petclinic" + JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" } stages { - stage('Clone Repo') { + stage('Setup JFrog CLI') { steps { - git branch: 'main', url: 'https://github.com/your-org/your-repo.git' + jfrog rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local + } + } + + stage('Checkout') { + steps { + git branch: 'main', url: 'https://github.com/JesseHouldsworth/spring-petclinic.git' } } stage('Build with Maven') { steps { - rtMavenRun ( - tool: 'maven-3', - pom: 'pom.xml', - goals: 'clean install -DskipTests=true -Denforcer.skip=true', - resolverId: 'maven-resolver', - deployerId: 'maven-deployer' - ) + sh ''' + jf mvnc --global \ + --repo-resolve-releases=libs-release-local \ + --repo-resolve-snapshots=libs-snapshot-local + jf mvn clean install -DskipTests=true -Denforcer.skip=true + ''' } } - stage('Docker Build and Push') { + stage('Build Docker Image') { steps { - script { - docker.build("${DOCKER_IMAGE}") - def server = Artifactory.server('artifactory-creds') - server.dockerPush( - image: "${DOCKER_IMAGE}", - targetRepo: 'petclinic-docker-dev-local', - buildInfo: Artifactory.newBuildInfo().name("${BUILD_NAME}").number("${BUILD_NUMBER}") - ) - } + sh """ + docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} . + """ + } + } + + stage('Push Docker Image') { + steps { + sh """ + jf docker-push \ + localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} \ + petclinic-docker-dev-local + """ } } stage('Publish Build Info') { steps { - script { - def server = Artifactory.server('artifactory-creds') - def buildInfo = Artifactory.newBuildInfo() - buildInfo.name = "${BUILD_NAME}" - buildInfo.number = "${BUILD_NUMBER}" - server.publishBuildInfo(buildInfo) - } + sh ''' + jf rt build-collect-env + jf rt build-add-git + jf rt build-publish + ''' } } } From 37ff72eaee57bac57251c86c9047283f28e0241a Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 12:51:14 -0700 Subject: [PATCH 50/99] jenkinsfile --- Jenkinsfile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b3adfcd22..b648d6481 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,7 +9,9 @@ pipeline { stages { stage('Setup JFrog CLI') { steps { - jfrog rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local + sh ''' + jfrog rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false + ''' } } @@ -22,9 +24,11 @@ pipeline { stage('Build with Maven') { steps { sh ''' + chmod +x mvnw jf mvnc --global \ --repo-resolve-releases=libs-release-local \ --repo-resolve-snapshots=libs-snapshot-local + jf mvn clean install -DskipTests=true -Denforcer.skip=true ''' } @@ -32,19 +36,19 @@ pipeline { stage('Build Docker Image') { steps { - sh """ - docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} . - """ + sh ''' + docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID . + ''' } } stage('Push Docker Image') { steps { - sh """ + sh ''' jf docker-push \ - localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} \ + localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID \ petclinic-docker-dev-local - """ + ''' } } From c02878d7365666389941b292a047eeb8793ec019 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 13:04:57 -0700 Subject: [PATCH 51/99] jenkinsfile --- Jenkinsfile | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b648d6481..414fb2f2f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,9 +9,7 @@ pipeline { stages { stage('Setup JFrog CLI') { steps { - sh ''' - jfrog rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false - ''' + jf "rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false" } } @@ -23,42 +21,29 @@ pipeline { stage('Build with Maven') { steps { - sh ''' - chmod +x mvnw - jf mvnc --global \ - --repo-resolve-releases=libs-release-local \ - --repo-resolve-snapshots=libs-snapshot-local - - jf mvn clean install -DskipTests=true -Denforcer.skip=true - ''' + sh 'chmod +x mvnw' + jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local" + jf "mvn clean install -DskipTests=true -Denforcer.skip=true" } } stage('Build Docker Image') { steps { - sh ''' - docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID . - ''' + sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} ." } } stage('Push Docker Image') { steps { - sh ''' - jf docker-push \ - localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID \ - petclinic-docker-dev-local - ''' + jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} petclinic-docker-dev-local" } } stage('Publish Build Info') { steps { - sh ''' - jf rt build-collect-env - jf rt build-add-git - jf rt build-publish - ''' + jf "rt build-collect-env" + jf "rt build-add-git" + jf "rt build-publish" } } } From a0ac8e079f6744ad6ed7ede8d96de1f2899f635a Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 13:13:24 -0700 Subject: [PATCH 52/99] jenkinsfile --- Jenkinsfile | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 414fb2f2f..c66b0f41d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,41 +1,35 @@ pipeline { agent any + tools { + jfrog 'jfrog-cli' + } + environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" } stages { - stage('Setup JFrog CLI') { + stage('Setup') { steps { - jf "rt config --server-id-resolve jfrog-local --server-id-deploy jfrog-local --interactive=false" + jf 'c show' + jf 'rt ping' } } - stage('Checkout') { - steps { - git branch: 'main', url: 'https://github.com/JesseHouldsworth/spring-petclinic.git' - } - } - - stage('Build with Maven') { + stage('Build Maven') { steps { sh 'chmod +x mvnw' jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local" - jf "mvn clean install -DskipTests=true -Denforcer.skip=true" + jf "mvn clean install -DskipTests=true" } } - stage('Build Docker Image') { + stage('Docker') { steps { - sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} ." - } - } - - stage('Push Docker Image') { - steps { - jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:${BUILD_ID} petclinic-docker-dev-local" + sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID ." + jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID petclinic-docker-dev-local" } } From 164c47aae38c4d07f877d625b5552ad28330cf14 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 13:19:41 -0700 Subject: [PATCH 53/99] jenkinsfile --- Jenkinsfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Jenkinsfile b/Jenkinsfile index c66b0f41d..ebb4f70ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,6 +3,7 @@ pipeline { tools { jfrog 'jfrog-cli' + maven 'maven-3' } environment { From d8d6382d5eb89da5afc414e1628ef03d2f874737 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 13:30:10 -0700 Subject: [PATCH 54/99] jenkinsfile --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ebb4f70ff..7a9f8ec98 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -22,7 +22,9 @@ pipeline { stage('Build Maven') { steps { sh 'chmod +x mvnw' - jf "mvnc --global --repo-resolve-releases=libs-release-local --repo-resolve-snapshots=libs-snapshot-local" + jf '''mvnc --global \ + --repo-resolve-releases=petclinic-maven-dev-virtual \ + --repo-resolve-snapshots=petclinic-maven-dev-virtual''' jf "mvn clean install -DskipTests=true" } } From c1d00d997dff29b4478397ce99d832a6530828a4 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 14:48:18 -0700 Subject: [PATCH 55/99] mvn deploy --- Jenkinsfile | 2 +- pom.xml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7a9f8ec98..79aa63e7c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { jf '''mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ --repo-resolve-snapshots=petclinic-maven-dev-virtual''' - jf "mvn clean install -DskipTests=true" + jf "mvn clean deploy -DskipTests" } } diff --git a/pom.xml b/pom.xml index 27fb9a6bd..0258d2e88 100644 --- a/pom.xml +++ b/pom.xml @@ -452,4 +452,14 @@ + + + petclinic-maven-dev-local + http://artifactory.artifactory.svc.cluster.local:8081/artifactory/petclinic-maven-dev-local + + + petclinic-maven-dev-local + http://artifactory.artifactory.svc.cluster.local:8081/artifactory/petclinic-maven-dev-local + + From c030b8386a880e8d8a81178d627256bf9a602a97 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 14:56:19 -0700 Subject: [PATCH 56/99] jenkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 79aa63e7c..8826ad8ff 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ pipeline { jf '''mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ --repo-resolve-snapshots=petclinic-maven-dev-virtual''' - jf "mvn clean deploy -DskipTests" + jf "mvn clean deploy -DskipTests -Dcheckstyle.skip=true" } } From af797a30c4af9df758d273d5f448071de297fa5e Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:48:12 -0700 Subject: [PATCH 57/99] jenmkinsfile --- Jenkinsfile | 54 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 8826ad8ff..6989c574c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,39 +9,59 @@ pipeline { environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" } stages { - stage('Setup') { + stage('Configure JFrog CLI') { steps { - jf 'c show' - jf 'rt ping' + withCredentials([usernamePassword(credentialsId: 'artifactory-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + sh ''' + jf c show petclinic || jf c add petclinic \ + --url=${ARTIFACTORY_URL} \ + --user=${ARTIFACTORY_USER} \ + --password=${ARTIFACTORY_PASSWORD} \ + --interactive=false + jf use petclinic + ''' + } + } + } + + stage('Validate Connection') { + steps { + sh 'jf rt ping' } } stage('Build Maven') { steps { sh 'chmod +x mvnw' - jf '''mvnc --global \ - --repo-resolve-releases=petclinic-maven-dev-virtual \ - --repo-resolve-snapshots=petclinic-maven-dev-virtual''' - jf "mvn clean deploy -DskipTests -Dcheckstyle.skip=true" - } - } - - stage('Docker') { - steps { - sh "docker build -t localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID ." - jf "docker-push localhost:8081/petclinic-docker-dev-local/spring-petclinic:$BUILD_ID petclinic-docker-dev-local" + sh ''' + jf mvnc --global \ + --repo-resolve-releases=petclinic-maven-dev-virtual \ + --repo-resolve-snapshots=petclinic-maven-dev-virtual \ + --repo-deploy-releases=petclinic-maven-dev-local \ + --repo-deploy-snapshots=petclinic-maven-dev-local + ''' + sh 'jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } stage('Publish Build Info') { steps { - jf "rt build-collect-env" - jf "rt build-add-git" - jf "rt build-publish" + sh ''' + jf rt build-collect-env + jf rt build-add-git + jf rt build-publish + ''' } } } + + post { + always { + echo "Build complete: $JFROG_CLI_BUILD_NAME #$JFROG_CLI_BUILD_NUMBER" + } + } } From e0a5d2a2c54fb5748b9ec6b970bf5e1ca384053a Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:51:18 -0700 Subject: [PATCH 58/99] jenmkinsfile --- Jenkinsfile | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6989c574c..dbb1bc513 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,27 +9,26 @@ pipeline { environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" } stages { stage('Configure JFrog CLI') { steps { - withCredentials([usernamePassword(credentialsId: 'artifactory-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - sh ''' - jf c show petclinic || jf c add petclinic \ - --url=${ARTIFACTORY_URL} \ - --user=${ARTIFACTORY_USER} \ - --password=${ARTIFACTORY_PASSWORD} \ + withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + sh """ + jf c add petclinic \ + --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ + --user=\$ARTIFACTORY_USER \ + --password=\$ARTIFACTORY_PASSWORD \ --interactive=false - jf use petclinic - ''' + """ } } } stage('Validate Connection') { steps { + sh 'jf c use petclinic' sh 'jf rt ping' } } @@ -50,18 +49,16 @@ pipeline { stage('Publish Build Info') { steps { - sh ''' - jf rt build-collect-env - jf rt build-add-git - jf rt build-publish - ''' + sh 'jf rt build-collect-env' + sh 'jf rt build-add-git' + sh 'jf rt build-publish' } } } post { always { - echo "Build complete: $JFROG_CLI_BUILD_NAME #$JFROG_CLI_BUILD_NUMBER" + echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" } } } From 21b66a87154827b46ca15ae860e89b26356a6161 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:53:15 -0700 Subject: [PATCH 59/99] jenmkinsfile --- Jenkinsfile | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index dbb1bc513..700b188c3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,20 +11,22 @@ pipeline { JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" } - stages { - stage('Configure JFrog CLI') { - steps { - withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - sh """ - jf c add petclinic \ - --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ - --user=\$ARTIFACTORY_USER \ - --password=\$ARTIFACTORY_PASSWORD \ - --interactive=false - """ - } - } +stage('Configure JFrog CLI') { + steps { + withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + sh ''' + curl -fL https://install-cli.jfrog.io | sh + ./jf c add petclinic \ + --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ + --user=$ARTIFACTORY_USER \ + --password=$ARTIFACTORY_PASSWORD \ + --interactive=false + mv jf /usr/local/bin/jf || true + ''' } + } +} + stage('Validate Connection') { steps { From b22394b0ba92a37a622b5f5e712c8ce6017c40e9 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:55:05 -0700 Subject: [PATCH 60/99] jenmkinsfile --- Jenkinsfile | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 700b188c3..227dff563 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,22 +11,22 @@ pipeline { JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" } -stage('Configure JFrog CLI') { - steps { - withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - sh ''' - curl -fL https://install-cli.jfrog.io | sh - ./jf c add petclinic \ - --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ - --user=$ARTIFACTORY_USER \ - --password=$ARTIFACTORY_PASSWORD \ - --interactive=false - mv jf /usr/local/bin/jf || true - ''' + stages { + stage('Configure JFrog CLI') { + steps { + withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + sh ''' + curl -fL https://install-cli.jfrog.io | sh + ./jf c add petclinic \ + --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ + --user=$ARTIFACTORY_USER \ + --password=$ARTIFACTORY_PASSWORD \ + --interactive=false + mv jf /usr/local/bin/jf || true + ''' + } + } } - } -} - stage('Validate Connection') { steps { From b73b4978de92b4e9cb328b64141d97faf6e77590 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:57:03 -0700 Subject: [PATCH 61/99] jenmkinsfile --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 227dff563..e768b8753 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,12 +17,12 @@ pipeline { withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { sh ''' curl -fL https://install-cli.jfrog.io | sh + chmod +x jf ./jf c add petclinic \ --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ --user=$ARTIFACTORY_USER \ --password=$ARTIFACTORY_PASSWORD \ --interactive=false - mv jf /usr/local/bin/jf || true ''' } } @@ -30,8 +30,8 @@ pipeline { stage('Validate Connection') { steps { - sh 'jf c use petclinic' - sh 'jf rt ping' + sh './jf c use petclinic' + sh './jf rt ping' } } @@ -39,21 +39,21 @@ pipeline { steps { sh 'chmod +x mvnw' sh ''' - jf mvnc --global \ + ./jf mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ --repo-resolve-snapshots=petclinic-maven-dev-virtual \ --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' - sh 'jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' + sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } stage('Publish Build Info') { steps { - sh 'jf rt build-collect-env' - sh 'jf rt build-add-git' - sh 'jf rt build-publish' + sh './jf rt build-collect-env' + sh './jf rt build-add-git' + sh './jf rt build-publish' } } } From d8d3336d8008498bf13bb31aead7d3a4bb30d34f Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 16:59:54 -0700 Subject: [PATCH 62/99] jenmkinsfile --- Jenkinsfile | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e768b8753..0c97a93d4 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,24 +2,36 @@ pipeline { agent any tools { - jfrog 'jfrog-cli' + // You can still let Jenkins manage Maven, if you want maven 'maven-3' } environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + // Adjust URL if needed (HTTP vs. HTTPS) + ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" } stages { + + stage('Download JFrog CLI') { + steps { + // Download the CLI to "jf" + sh ''' + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/latest/jfrog-cli-linux-arm64/jf -o jf + chmod +x jf + ''' + } + } + stage('Configure JFrog CLI') { steps { withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + // Add the config called "petclinic" sh ''' - curl -fL https://install-cli.jfrog.io | sh - chmod +x jf ./jf c add petclinic \ - --url=http://artifactory.artifactory.svc.cluster.local:8081/artifactory \ + --url=${ARTIFACTORY_URL} \ --user=$ARTIFACTORY_USER \ --password=$ARTIFACTORY_PASSWORD \ --interactive=false @@ -38,6 +50,7 @@ pipeline { stage('Build Maven') { steps { sh 'chmod +x mvnw' + // Configure Maven's Artifactory resolver/deployer sh ''' ./jf mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ @@ -45,6 +58,7 @@ pipeline { --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' + // Run the actual build & deploy sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } From fa42c8b1e43d09ad0263edc8942b8943976aa338 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 17:02:13 -0700 Subject: [PATCH 63/99] jenmkinsfile --- Jenkinsfile | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0c97a93d4..a6f2b1072 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,24 +2,21 @@ pipeline { agent any tools { - // You can still let Jenkins manage Maven, if you want maven 'maven-3' } environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - // Adjust URL if needed (HTTP vs. HTTPS) ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" } stages { - stage('Download JFrog CLI') { steps { - // Download the CLI to "jf" + // Download a specific ARM64 version of the jf binary sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/latest/jfrog-cli-linux-arm64/jf -o jf + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.42.2/jfrog-cli-linux-arm64/jf -o jf chmod +x jf ''' } @@ -28,7 +25,6 @@ pipeline { stage('Configure JFrog CLI') { steps { withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - // Add the config called "petclinic" sh ''' ./jf c add petclinic \ --url=${ARTIFACTORY_URL} \ @@ -50,7 +46,6 @@ pipeline { stage('Build Maven') { steps { sh 'chmod +x mvnw' - // Configure Maven's Artifactory resolver/deployer sh ''' ./jf mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ @@ -58,7 +53,6 @@ pipeline { --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' - // Run the actual build & deploy sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } From a1fa74c029b6bf059bc7a34bd35a0c4f784a2e5b Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Tue, 25 Mar 2025 17:05:02 -0700 Subject: [PATCH 64/99] jenmkinsfile --- Jenkinsfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a6f2b1072..586d69f87 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,7 @@ pipeline { agent any tools { + // This is your Jenkins-managed Maven tool maven 'maven-3' } @@ -12,11 +13,12 @@ pipeline { } stages { + stage('Download JFrog CLI') { steps { - // Download a specific ARM64 version of the jf binary + // Download a *confirmed* ARM64 version – 2.44.0 sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.42.2/jfrog-cli-linux-arm64/jf -o jf + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.44.0/jfrog-cli-linux-arm64/jf -o jf chmod +x jf ''' } @@ -38,6 +40,7 @@ pipeline { stage('Validate Connection') { steps { + // Switch to "petclinic" config & ping Artifactory sh './jf c use petclinic' sh './jf rt ping' } @@ -46,6 +49,7 @@ pipeline { stage('Build Maven') { steps { sh 'chmod +x mvnw' + // Configure Maven resolution + deployment in Artifactory sh ''' ./jf mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ @@ -53,6 +57,7 @@ pipeline { --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' + // Perform the actual build + deploy sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } From 58efeb410c2541a1e1bccb68467459a77a88b324 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 09:35:03 -0700 Subject: [PATCH 65/99] jenmkinsfile --- Jenkinsfile | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 586d69f87..0f2b9259e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,6 @@ pipeline { agent any tools { - // This is your Jenkins-managed Maven tool maven 'maven-3' } @@ -10,16 +9,16 @@ pipeline { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" + JF = "${WORKSPACE}/jf" } stages { stage('Download JFrog CLI') { steps { - // Download a *confirmed* ARM64 version – 2.44.0 sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.44.0/jfrog-cli-linux-arm64/jf -o jf - chmod +x jf + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.44.0/jfrog-cli-linux-arm64/jf -o "$JF" + chmod +x "$JF" ''' } } @@ -28,10 +27,10 @@ pipeline { steps { withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { sh ''' - ./jf c add petclinic \ - --url=${ARTIFACTORY_URL} \ - --user=$ARTIFACTORY_USER \ - --password=$ARTIFACTORY_PASSWORD \ + "$JF" c add petclinic \ + --url="${ARTIFACTORY_URL}" \ + --user="$ARTIFACTORY_USER" \ + --password="$ARTIFACTORY_PASSWORD" \ --interactive=false ''' } @@ -40,33 +39,30 @@ pipeline { stage('Validate Connection') { steps { - // Switch to "petclinic" config & ping Artifactory - sh './jf c use petclinic' - sh './jf rt ping' + sh '"$JF" c use petclinic' + sh '"$JF" rt ping' } } stage('Build Maven') { steps { sh 'chmod +x mvnw' - // Configure Maven resolution + deployment in Artifactory sh ''' - ./jf mvnc --global \ + "$JF" mvnc --global \ --repo-resolve-releases=petclinic-maven-dev-virtual \ --repo-resolve-snapshots=petclinic-maven-dev-virtual \ --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' - // Perform the actual build + deploy - sh './jf mvn clean deploy -DskipTests -Dcheckstyle.skip=true' + sh '"$JF" mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } stage('Publish Build Info') { steps { - sh './jf rt build-collect-env' - sh './jf rt build-add-git' - sh './jf rt build-publish' + sh '"$JF" rt build-collect-env' + sh '"$JF" rt build-add-git' + sh '"$JF" rt build-publish' } } } From ac692e1eb5daecc4a481b91ca06e177616ab5e85 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 09:40:51 -0700 Subject: [PATCH 66/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0f2b9259e..17e8bfd51 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,7 @@ pipeline { stage('Download JFrog CLI') { steps { sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.44.0/jfrog-cli-linux-arm64/jf -o "$JF" + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-arm64/jf -o "$JF" chmod +x "$JF" ''' } From 6e96c6090adc7fa40664d323b077bf4c3134d7d2 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 09:43:38 -0700 Subject: [PATCH 67/99] jenmkinsfile --- Jenkinsfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 17e8bfd51..a2c3d024c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081/artifactory" + ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081" JF = "${WORKSPACE}/jf" } @@ -32,6 +32,7 @@ pipeline { --user="$ARTIFACTORY_USER" \ --password="$ARTIFACTORY_PASSWORD" \ --interactive=false + --enc-password=false ''' } } From 97bd3ea4c660b71abdfccfb655e50cf9ca036ba1 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 09:45:21 -0700 Subject: [PATCH 68/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index a2c3d024c..900def853 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,7 +31,7 @@ pipeline { --url="${ARTIFACTORY_URL}" \ --user="$ARTIFACTORY_USER" \ --password="$ARTIFACTORY_PASSWORD" \ - --interactive=false + --interactive=false \ --enc-password=false ''' } From 73d309a30aa89c3ed62b5723a27bcb9dae748acf Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 10:07:43 -0700 Subject: [PATCH 69/99] jenmkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 900def853..032ecd24f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,7 +8,7 @@ pipeline { environment { JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - ARTIFACTORY_URL = "http://artifactory.artifactory.svc.cluster.local:8081" + ARTIFACTORY_URL = "https://trialt0zppb.jfrog.io/" JF = "${WORKSPACE}/jf" } @@ -25,7 +25,7 @@ pipeline { stage('Configure JFrog CLI') { steps { - withCredentials([usernamePassword(credentialsId: 'jfrog-platform-creds', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + withCredentials([usernamePassword(credentialsId: 'jfrog-saas', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { sh ''' "$JF" c add petclinic \ --url="${ARTIFACTORY_URL}" \ From f85799c9180e97d2ae0bdbfe28b5392663878347 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 10:23:58 -0700 Subject: [PATCH 70/99] jenmkinsfile --- Jenkinsfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 032ecd24f..9a1a2babd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -42,6 +42,7 @@ pipeline { steps { sh '"$JF" c use petclinic' sh '"$JF" rt ping' + sh '"$JF" c show petclinic' } } @@ -55,7 +56,13 @@ pipeline { --repo-deploy-releases=petclinic-maven-dev-local \ --repo-deploy-snapshots=petclinic-maven-dev-local ''' - sh '"$JF" mvn clean deploy -DskipTests -Dcheckstyle.skip=true' + sh ''' + "$JF" mvn clean deploy \ + -DskipTests -Dcheckstyle.skip=true \ + --build-name=$JFROG_CLI_BUILD_NAME \ + --build-number=$JFROG_CLI_BUILD_NUMBER \ + --no-publish-build-info + ''' } } From 59770092322b5fc3263de13fd3a21a98084f8b79 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 10:26:56 -0700 Subject: [PATCH 71/99] jenmkinsfile --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a1a2babd..2534ac257 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,9 +59,8 @@ pipeline { sh ''' "$JF" mvn clean deploy \ -DskipTests -Dcheckstyle.skip=true \ - --build-name=$JFROG_CLI_BUILD_NAME \ - --build-number=$JFROG_CLI_BUILD_NUMBER \ - --no-publish-build-info + --build-name="$JFROG_CLI_BUILD_NAME" \ + --build-number="$JFROG_CLI_BUILD_NUMBER" ''' } } From 0da37b814d735233760fbc8ddefd9472aae76519 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Wed, 26 Mar 2025 11:04:41 -0700 Subject: [PATCH 72/99] jenmkinsfile --- pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pom.xml b/pom.xml index 0258d2e88..27fb9a6bd 100644 --- a/pom.xml +++ b/pom.xml @@ -452,14 +452,4 @@ - - - petclinic-maven-dev-local - http://artifactory.artifactory.svc.cluster.local:8081/artifactory/petclinic-maven-dev-local - - - petclinic-maven-dev-local - http://artifactory.artifactory.svc.cluster.local:8081/artifactory/petclinic-maven-dev-local - - From 3a321133af50dc24d93f8a48a7552ee63490b690 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 11:21:55 -0700 Subject: [PATCH 73/99] jenmkinsfile --- Jenkinsfile | 123 ++++++++++++++++++++-------------------------------- 1 file changed, 46 insertions(+), 77 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2534ac257..c3573eee7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,82 +1,51 @@ pipeline { - agent any - - tools { - maven 'maven-3' - } - - environment { - JFROG_CLI_BUILD_NAME = "spring-petclinic" - JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - ARTIFACTORY_URL = "https://trialt0zppb.jfrog.io/" - JF = "${WORKSPACE}/jf" - } - - stages { - - stage('Download JFrog CLI') { - steps { - sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-arm64/jf -o "$JF" - chmod +x "$JF" - ''' - } + agent any + tools { + maven 'maven-3' } - - stage('Configure JFrog CLI') { - steps { - withCredentials([usernamePassword(credentialsId: 'jfrog-saas', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - sh ''' - "$JF" c add petclinic \ - --url="${ARTIFACTORY_URL}" \ - --user="$ARTIFACTORY_USER" \ - --password="$ARTIFACTORY_PASSWORD" \ - --interactive=false \ - --enc-password=false - ''' + environment { + JFROG_URL = "https://trialt0zppb.jfrog.io/artifactory" + JFROG_REPO_RELEASES = "petclinic-maven-dev-local" + JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" + JFROG_CREDENTIALS_ID = 'jfrog-saas' + JFROG_CLI_BUILD_NAME = "spring-petclinic" + JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + } + stages { + stage('Build Maven') { + steps { + script { + // Using JFrog plugin to capture build info + artifactory.upload spec: """{ + "files": [ + { + "pattern": "target/*.jar", + "target": "${JFROG_REPO_RELEASES}/" + } + ] + }""" + + // Run Maven Build + sh 'mvn clean deploy -DskipTests -Dcheckstyle.skip=true' + } + } + } + stage('Publish Build Info') { + steps { + script { + // Publish build information to JFrog Artifactory + def buildInfo = Artifactory.newBuildInfo() + buildInfo.name = "${JFROG_CLI_BUILD_NAME}" + buildInfo.number = "${JFROG_CLI_BUILD_NUMBER}" + + Artifactory.publishBuildInfo(buildInfo) + } + } } - } } - - stage('Validate Connection') { - steps { - sh '"$JF" c use petclinic' - sh '"$JF" rt ping' - sh '"$JF" c show petclinic' - } + post { + always { + echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" + } } - - stage('Build Maven') { - steps { - sh 'chmod +x mvnw' - sh ''' - "$JF" mvnc --global \ - --repo-resolve-releases=petclinic-maven-dev-virtual \ - --repo-resolve-snapshots=petclinic-maven-dev-virtual \ - --repo-deploy-releases=petclinic-maven-dev-local \ - --repo-deploy-snapshots=petclinic-maven-dev-local - ''' - sh ''' - "$JF" mvn clean deploy \ - -DskipTests -Dcheckstyle.skip=true \ - --build-name="$JFROG_CLI_BUILD_NAME" \ - --build-number="$JFROG_CLI_BUILD_NUMBER" - ''' - } - } - - stage('Publish Build Info') { - steps { - sh '"$JF" rt build-collect-env' - sh '"$JF" rt build-add-git' - sh '"$JF" rt build-publish' - } - } - } - - post { - always { - echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" - } - } -} +} \ No newline at end of file From 8d83725287754de89fe170bba7fdbe2260d04370 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 11:31:53 -0700 Subject: [PATCH 74/99] jenmkinsfile --- Jenkinsfile | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c3573eee7..e056596e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,8 +15,13 @@ pipeline { stage('Build Maven') { steps { script { - // Using JFrog plugin to capture build info - artifactory.upload spec: """{ + def server = Artifactory.server(env.JFROG_CREDENTIALS_ID) + + // Run Maven Build + sh 'mvn clean install -DskipTests -Dcheckstyle.skip=true' + + // Upload artifacts to Artifactory + server.upload spec: """{ "files": [ { "pattern": "target/*.jar", @@ -24,21 +29,19 @@ pipeline { } ] }""" - - // Run Maven Build - sh 'mvn clean deploy -DskipTests -Dcheckstyle.skip=true' } } } stage('Publish Build Info') { steps { script { - // Publish build information to JFrog Artifactory + def server = Artifactory.server(env.JFROG_CREDENTIALS_ID) + def buildInfo = Artifactory.newBuildInfo() - buildInfo.name = "${JFROG_CLI_BUILD_NAME}" - buildInfo.number = "${JFROG_CLI_BUILD_NUMBER}" - - Artifactory.publishBuildInfo(buildInfo) + buildInfo.name = env.JFROG_CLI_BUILD_NAME + buildInfo.number = env.JFROG_CLI_BUILD_NUMBER + + server.publishBuildInfo(buildInfo) } } } @@ -48,4 +51,4 @@ pipeline { echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" } } -} \ No newline at end of file +} From cd4976f64e5629debaccf6d45e887f6b1dcc6071 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 11:36:36 -0700 Subject: [PATCH 75/99] jenmkinsfile --- Jenkinsfile | 117 ++++++++++++++++++++++++++++++---------------------- 1 file changed, 68 insertions(+), 49 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e056596e9..5fe06f707 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,54 +1,73 @@ pipeline { - agent any - tools { - maven 'maven-3' + agent any + tools { + maven 'maven-3' + } + environment { + JFROG_CLI_BUILD_NAME = "spring-petclinic" + JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + ARTIFACTORY_URL = "https://trialt0zppb.jfrog.io/" + JF = "${WORKSPACE}/jf" + } + stages { + stage('Download JFrog CLI') { + steps { + sh ''' + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-arm64/jf -o "$JF" + chmod +x "$JF" + ''' + } } - environment { - JFROG_URL = "https://trialt0zppb.jfrog.io/artifactory" - JFROG_REPO_RELEASES = "petclinic-maven-dev-local" - JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" - JFROG_CREDENTIALS_ID = 'jfrog-saas' - JFROG_CLI_BUILD_NAME = "spring-petclinic" - JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - } - stages { - stage('Build Maven') { - steps { - script { - def server = Artifactory.server(env.JFROG_CREDENTIALS_ID) - - // Run Maven Build - sh 'mvn clean install -DskipTests -Dcheckstyle.skip=true' - - // Upload artifacts to Artifactory - server.upload spec: """{ - "files": [ - { - "pattern": "target/*.jar", - "target": "${JFROG_REPO_RELEASES}/" - } - ] - }""" - } - } - } - stage('Publish Build Info') { - steps { - script { - def server = Artifactory.server(env.JFROG_CREDENTIALS_ID) - - def buildInfo = Artifactory.newBuildInfo() - buildInfo.name = env.JFROG_CLI_BUILD_NAME - buildInfo.number = env.JFROG_CLI_BUILD_NUMBER - - server.publishBuildInfo(buildInfo) - } - } + stage('Configure JFrog CLI') { + steps { + withCredentials([usernamePassword(credentialsId: 'jfrog-saas', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { + sh ''' + "$JF" c add petclinic \ + --url="${ARTIFACTORY_URL}" \ + --user="$ARTIFACTORY_USER" \ + --password="$ARTIFACTORY_PASSWORD" \ + --interactive=false \ + --enc-password=false + ''' } + } } - post { - always { - echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" - } + stage('Validate Connection') { + steps { + sh '"$JF" c use petclinic' + sh '"$JF" rt ping' + sh '"$JF" c show petclinic' + } } -} + stage('Build Maven') { + steps { + sh 'chmod +x mvnw' + sh ''' + "$JF" mvnc --global \ + --repo-resolve-releases=petclinic-maven-dev-virtual \ + --repo-resolve-snapshots=petclinic-maven-dev-virtual \ + --repo-deploy-releases=petclinic-maven-dev-local \ + --repo-deploy-snapshots=petclinic-maven-dev-local + ''' + sh ''' + "$JF" mvn clean deploy \ + -DskipTests -Dcheckstyle.skip=true \ + --build-name="$JFROG_CLI_BUILD_NAME" \ + --build-number="$JFROG_CLI_BUILD_NUMBER" + ''' + } + } + stage('Publish Build Info') { + steps { + sh '"$JF" rt build-collect-env' + sh '"$JF" rt build-add-git' + sh '"$JF" rt build-publish' + } + } + } + post { + always { + echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" + } + } +} \ No newline at end of file From d3143ba0ce495afbb6b14b2ebf85a3a43f1988be Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:04:44 -0700 Subject: [PATCH 76/99] jenmkinsfile --- Jenkinsfile | 121 +++++++++++++++++++++++----------------------------- 1 file changed, 53 insertions(+), 68 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5fe06f707..62e1e04a0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,73 +1,58 @@ pipeline { - agent any - tools { - maven 'maven-3' - } - environment { - JFROG_CLI_BUILD_NAME = "spring-petclinic" - JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - ARTIFACTORY_URL = "https://trialt0zppb.jfrog.io/" - JF = "${WORKSPACE}/jf" - } - stages { - stage('Download JFrog CLI') { - steps { - sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-arm64/jf -o "$JF" - chmod +x "$JF" - ''' - } + agent any + tools { + maven 'maven-3' } - stage('Configure JFrog CLI') { - steps { - withCredentials([usernamePassword(credentialsId: 'jfrog-saas', usernameVariable: 'ARTIFACTORY_USER', passwordVariable: 'ARTIFACTORY_PASSWORD')]) { - sh ''' - "$JF" c add petclinic \ - --url="${ARTIFACTORY_URL}" \ - --user="$ARTIFACTORY_USER" \ - --password="$ARTIFACTORY_PASSWORD" \ - --interactive=false \ - --enc-password=false - ''' + environment { + JFROG_URL = "https://trialt0zppb.jfrog.io" + JFROG_REPO_RELEASES = "petclinic-maven-dev-local" + JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" + JFROG_CREDENTIALS_ID = 'jfrog-saas' // Jenkins credential ID (username + API key or password) + JFROG_CLI_BUILD_NAME = "spring-petclinic" + JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + } + stages { + stage('Configure JFrog CLI') { + steps { + withCredentials([usernamePassword(credentialsId: "${env.JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { + sh """ + jfrog config add jenkins-config \\ + --url=${JFROG_URL} \\ + --user=$JFROG_USER \\ + --apikey=$JFROG_API_KEY \\ + --interactive=false + """ + } + } + } + + stage('Build Maven') { + steps { + sh 'mvn clean install -DskipTests -Dcheckstyle.skip=true' + } + } + + stage('Upload to Artifactory') { + steps { + sh """ + jfrog rt u "target/*.jar" ${JFROG_REPO_RELEASES}/ \\ + --build-name=${JFROG_CLI_BUILD_NAME} \\ + --build-number=${JFROG_CLI_BUILD_NUMBER} + """ + } + } + + stage('Publish Build Info') { + steps { + sh """ + jfrog rt bp ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} + """ + } } - } } - stage('Validate Connection') { - steps { - sh '"$JF" c use petclinic' - sh '"$JF" rt ping' - sh '"$JF" c show petclinic' - } + post { + always { + echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" + } } - stage('Build Maven') { - steps { - sh 'chmod +x mvnw' - sh ''' - "$JF" mvnc --global \ - --repo-resolve-releases=petclinic-maven-dev-virtual \ - --repo-resolve-snapshots=petclinic-maven-dev-virtual \ - --repo-deploy-releases=petclinic-maven-dev-local \ - --repo-deploy-snapshots=petclinic-maven-dev-local - ''' - sh ''' - "$JF" mvn clean deploy \ - -DskipTests -Dcheckstyle.skip=true \ - --build-name="$JFROG_CLI_BUILD_NAME" \ - --build-number="$JFROG_CLI_BUILD_NUMBER" - ''' - } - } - stage('Publish Build Info') { - steps { - sh '"$JF" rt build-collect-env' - sh '"$JF" rt build-add-git' - sh '"$JF" rt build-publish' - } - } - } - post { - always { - echo "Build complete: ${env.JFROG_CLI_BUILD_NAME} #${env.BUILD_NUMBER}" - } - } -} \ No newline at end of file +} From b5e0c219cfe7bc78bff0c6fe2713c790feae6f36 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:17:07 -0700 Subject: [PATCH 77/99] jenmkinsfile --- Jenkinsfile | 57 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 62e1e04a0..36368dcd6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -7,46 +7,59 @@ pipeline { JFROG_URL = "https://trialt0zppb.jfrog.io" JFROG_REPO_RELEASES = "petclinic-maven-dev-local" JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" - JFROG_CREDENTIALS_ID = 'jfrog-saas' // Jenkins credential ID (username + API key or password) + JFROG_CREDENTIALS_ID = 'jfrog-saas' JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" + JF = "${WORKSPACE}/jfrog" // Local CLI path } stages { + stage('Download JFrog CLI') { + steps { + sh ''' + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-amd64/jf -o "$JF" + chmod +x "$JF" + ''' + } + } + stage('Configure JFrog CLI') { steps { - withCredentials([usernamePassword(credentialsId: "${env.JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { - sh """ - jfrog config add jenkins-config \\ - --url=${JFROG_URL} \\ - --user=$JFROG_USER \\ - --apikey=$JFROG_API_KEY \\ + withCredentials([usernamePassword(credentialsId: "${JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { + sh ''' + "$JF" config add jenkins-config \ + --url="${JFROG_URL}" \ + --user="$JFROG_USER" \ + --apikey="$JFROG_API_KEY" \ --interactive=false - """ + ''' } } } stage('Build Maven') { steps { - sh 'mvn clean install -DskipTests -Dcheckstyle.skip=true' - } - } - - stage('Upload to Artifactory') { - steps { - sh """ - jfrog rt u "target/*.jar" ${JFROG_REPO_RELEASES}/ \\ - --build-name=${JFROG_CLI_BUILD_NAME} \\ - --build-number=${JFROG_CLI_BUILD_NUMBER} - """ + sh ''' + "$JF" mvnc --global \ + --repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \ + --repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \ + --repo-deploy-releases=${JFROG_REPO_RELEASES} \ + --repo-deploy-snapshots=${JFROG_REPO_RELEASES} + ''' + sh ''' + "$JF" mvn clean deploy -DskipTests -Dcheckstyle.skip=true \ + --build-name="$JFROG_CLI_BUILD_NAME" \ + --build-number="$JFROG_CLI_BUILD_NUMBER" + ''' } } stage('Publish Build Info') { steps { - sh """ - jfrog rt bp ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} - """ + sh ''' + "$JF" rt build-collect-env + "$JF" rt build-add-git + "$JF" rt build-publish + ''' } } } From 0eae0a510c9de32e7a31c70a5549b43ecd41d6f5 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:25:09 -0700 Subject: [PATCH 78/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 36368dcd6..ae530ae61 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -27,7 +27,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: "${JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { sh ''' "$JF" config add jenkins-config \ - --url="${JFROG_URL}" \ + --artifactory-url="${JFROG_URL}" \ --user="$JFROG_USER" \ --apikey="$JFROG_API_KEY" \ --interactive=false From 9044ab498cee98c07f53824cbb04a8d88ecbb996 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:37:08 -0700 Subject: [PATCH 79/99] jenmkinsfile --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae530ae61..7119d5cfe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,13 +25,13 @@ pipeline { stage('Configure JFrog CLI') { steps { withCredentials([usernamePassword(credentialsId: "${JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { - sh ''' - "$JF" config add jenkins-config \ - --artifactory-url="${JFROG_URL}" \ - --user="$JFROG_USER" \ - --apikey="$JFROG_API_KEY" \ + sh """ + ${JF} config add jenkins-config \ + --artifactory-url=${JFROG_URL}/artifactory \ + --user=${JFROG_USER} \ + --apikey=${JFROG_API_KEY} \ --interactive=false - ''' + """ } } } From 1af91b47084b4c292e556ca32b1f0350ac9120af Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:49:31 -0700 Subject: [PATCH 80/99] jenmkinsfile --- Jenkinsfile | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 7119d5cfe..573a30e4c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,15 +10,15 @@ pipeline { JFROG_CREDENTIALS_ID = 'jfrog-saas' JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - JF = "${WORKSPACE}/jfrog" // Local CLI path + JF = "${WORKSPACE}/jfrog" } stages { stage('Download JFrog CLI') { steps { - sh ''' - curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-amd64/jf -o "$JF" - chmod +x "$JF" - ''' + sh """ + curl -fL https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/2.74.1/jfrog-cli-linux-amd64/jf -o "${JF}" + chmod +x "${JF}" + """ } } @@ -30,7 +30,8 @@ pipeline { --artifactory-url=${JFROG_URL}/artifactory \ --user=${JFROG_USER} \ --apikey=${JFROG_API_KEY} \ - --interactive=false + --interactive=false \ + --overwrite=true """ } } @@ -38,28 +39,28 @@ pipeline { stage('Build Maven') { steps { - sh ''' - "$JF" mvnc --global \ + sh """ + ${JF} mvnc --global \ --repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \ --repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \ --repo-deploy-releases=${JFROG_REPO_RELEASES} \ --repo-deploy-snapshots=${JFROG_REPO_RELEASES} - ''' - sh ''' - "$JF" mvn clean deploy -DskipTests -Dcheckstyle.skip=true \ - --build-name="$JFROG_CLI_BUILD_NAME" \ - --build-number="$JFROG_CLI_BUILD_NUMBER" - ''' + """ + sh """ + ${JF} mvn clean deploy -DskipTests -Dcheckstyle.skip=true \ + --build-name=${JFROG_CLI_BUILD_NAME} \ + --build-number=${JFROG_CLI_BUILD_NUMBER} + """ } } stage('Publish Build Info') { steps { - sh ''' - "$JF" rt build-collect-env - "$JF" rt build-add-git - "$JF" rt build-publish - ''' + sh """ + ${JF} rt build-collect-env + ${JF} rt build-add-git + ${JF} rt build-publish + """ } } } From 2f3787c33ae3563b00ee376a0f0f0becb7748acc Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 12:52:16 -0700 Subject: [PATCH 81/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 573a30e4c..93a2e85bd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -29,7 +29,7 @@ pipeline { ${JF} config add jenkins-config \ --artifactory-url=${JFROG_URL}/artifactory \ --user=${JFROG_USER} \ - --apikey=${JFROG_API_KEY} \ + --password=${JFROG_API_KEY} \ --interactive=false \ --overwrite=true """ From a920cc6c83351fa684231570c0b2d3a3fff6a214 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 13:15:44 -0700 Subject: [PATCH 82/99] jenmkinsfile --- Jenkinsfile | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 93a2e85bd..429a26eea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,13 +4,16 @@ pipeline { maven 'maven-3' } environment { + // ----------------------------- + // Adjust these values as needed + // ----------------------------- JFROG_URL = "https://trialt0zppb.jfrog.io" JFROG_REPO_RELEASES = "petclinic-maven-dev-local" JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" JFROG_CREDENTIALS_ID = 'jfrog-saas' JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - JF = "${WORKSPACE}/jfrog" + JF = "${WORKSPACE}/jfrog" // local path to the downloaded CLI } stages { stage('Download JFrog CLI') { @@ -37,23 +40,34 @@ pipeline { } } - stage('Build Maven') { + stage('Build with Maven') { steps { sh """ - ${JF} mvnc --global \ - --repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \ - --repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \ - --repo-deploy-releases=${JFROG_REPO_RELEASES} \ + ${JF} mvnc --global \\ + --repo-resolve-releases=${JFROG_REPO_SNAPSHOTS} \\ + --repo-resolve-snapshots=${JFROG_REPO_SNAPSHOTS} \\ + --repo-deploy-releases=${JFROG_REPO_RELEASES} \\ --repo-deploy-snapshots=${JFROG_REPO_RELEASES} """ sh """ - ${JF} mvn clean deploy -DskipTests -Dcheckstyle.skip=true \ - --build-name=${JFROG_CLI_BUILD_NAME} \ + ${JF} mvn clean deploy -DskipTests -Dcheckstyle.skip=true \\ + --build-name=${JFROG_CLI_BUILD_NAME} \\ --build-number=${JFROG_CLI_BUILD_NUMBER} """ } } + stage('Xray Scan') { + steps { + // Scan the build you just deployed using Xray + // Fail the build if there's a severity of "High" or above + sh """ + ${JF} xray scan --build="${JFROG_CLI_BUILD_NAME}" ${JFROG_CLI_BUILD_NUMBER} \ + --fail-on-severity=High + """ + } + } + stage('Publish Build Info') { steps { sh """ From 8d7e062a2f6cd4e27ce151fe45eb0e3ae514525d Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 13:30:27 -0700 Subject: [PATCH 83/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 429a26eea..f8f3c7f93 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { // Scan the build you just deployed using Xray // Fail the build if there's a severity of "High" or above sh """ - ${JF} xray scan --build="${JFROG_CLI_BUILD_NAME}" ${JFROG_CLI_BUILD_NUMBER} \ + ${JF} xr scan --build="${JFROG_CLI_BUILD_NAME}" ${JFROG_CLI_BUILD_NUMBER} \ --fail-on-severity=High """ } From 882babf87e8ef6e0fd2b88f626762d57c3ec5bc5 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 13:42:52 -0700 Subject: [PATCH 84/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f8f3c7f93..03693eedc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -62,7 +62,7 @@ pipeline { // Scan the build you just deployed using Xray // Fail the build if there's a severity of "High" or above sh """ - ${JF} xr scan --build="${JFROG_CLI_BUILD_NAME}" ${JFROG_CLI_BUILD_NUMBER} \ + ${JF} xr build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \ --fail-on-severity=High """ } From cff156cdca3991c8e26f9de2086547dc23a02fc1 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 15:03:09 -0700 Subject: [PATCH 85/99] jenmkinsfile --- Jenkinsfile | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 03693eedc..b86d237c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,16 +4,14 @@ pipeline { maven 'maven-3' } environment { - // ----------------------------- - // Adjust these values as needed - // ----------------------------- JFROG_URL = "https://trialt0zppb.jfrog.io" JFROG_REPO_RELEASES = "petclinic-maven-dev-local" JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" JFROG_CREDENTIALS_ID = 'jfrog-saas' JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - JF = "${WORKSPACE}/jfrog" // local path to the downloaded CLI + // Downloaded JFrog CLI path + JF = "${WORKSPACE}/jfrog" } stages { stage('Download JFrog CLI') { @@ -59,10 +57,9 @@ pipeline { stage('Xray Scan') { steps { - // Scan the build you just deployed using Xray - // Fail the build if there's a severity of "High" or above + // Changed to modern syntax: jf x s sh """ - ${JF} xr build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \ + ${JF} x s ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \\ --fail-on-severity=High """ } From eae14dc2362c0a7cad81ac0ce6d5e9b7eb0306c4 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 15:09:16 -0700 Subject: [PATCH 86/99] jenmkinsfile --- Jenkinsfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b86d237c8..9f0ac71fb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,7 +10,6 @@ pipeline { JFROG_CREDENTIALS_ID = 'jfrog-saas' JFROG_CLI_BUILD_NAME = "spring-petclinic" JFROG_CLI_BUILD_NUMBER = "${BUILD_ID}" - // Downloaded JFrog CLI path JF = "${WORKSPACE}/jfrog" } stages { @@ -57,9 +56,9 @@ pipeline { stage('Xray Scan') { steps { - // Changed to modern syntax: jf x s + // Use the Artifactory command to scan the build with Xray: sh """ - ${JF} x s ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \\ + ${JF} rt build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \\ --fail-on-severity=High """ } From c635ba3ac27de06840fa61876538aabae908b210 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 15:20:28 -0700 Subject: [PATCH 87/99] jenmkinsfile --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9f0ac71fb..fcf4fce99 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -56,10 +56,10 @@ pipeline { stage('Xray Scan') { steps { - // Use the Artifactory command to scan the build with Xray: + // Use the new "jf build-scan" command + // "Fail Build" is decided by your Xray policy if severity >= High sh """ - ${JF} rt build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} \\ - --fail-on-severity=High + ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail """ } } From 0fd1f798da9b6e8d830aa66a9fd8e84b5bb38559 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 15:35:14 -0700 Subject: [PATCH 88/99] jenmkinsfile --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index fcf4fce99..5c73407be 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,7 @@ pipeline { maven 'maven-3' } environment { - JFROG_URL = "https://trialt0zppb.jfrog.io" + JFROG_URL = "https://trialt0zppb.jfrog.io/" JFROG_REPO_RELEASES = "petclinic-maven-dev-local" JFROG_REPO_SNAPSHOTS = "petclinic-maven-dev-virtual" JFROG_CREDENTIALS_ID = 'jfrog-saas' @@ -27,7 +27,7 @@ pipeline { withCredentials([usernamePassword(credentialsId: "${JFROG_CREDENTIALS_ID}", usernameVariable: 'JFROG_USER', passwordVariable: 'JFROG_API_KEY')]) { sh """ ${JF} config add jenkins-config \ - --artifactory-url=${JFROG_URL}/artifactory \ + --url=${JFROG_URL} \ --user=${JFROG_USER} \ --password=${JFROG_API_KEY} \ --interactive=false \ From eae237d45c55b3fdc02d609e0eeb6e45b0ddc462 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 15:54:47 -0700 Subject: [PATCH 89/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5c73407be..95eec1605 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,7 +59,7 @@ pipeline { // Use the new "jf build-scan" command // "Fail Build" is decided by your Xray policy if severity >= High sh """ - ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail + ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail=false """ } } From aa9dae07d57559e41e21da52dfc1aab0ae006410 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 16:01:49 -0700 Subject: [PATCH 90/99] jenmkinsfile --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 95eec1605..4a938c7ab 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,7 +59,7 @@ pipeline { // Use the new "jf build-scan" command // "Fail Build" is decided by your Xray policy if severity >= High sh """ - ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail=false + ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail false """ } } From 9bdd3bfd0285d041844cffb3a023c53beef256d5 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 16:12:33 -0700 Subject: [PATCH 91/99] jenmkinsfile --- Jenkinsfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4a938c7ab..a21565a35 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,9 +58,7 @@ pipeline { steps { // Use the new "jf build-scan" command // "Fail Build" is decided by your Xray policy if severity >= High - sh """ - ${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail false - """ + sh "${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail=false" } } From 7171a843bef664acd399304e9242794778b9d092 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Thu, 27 Mar 2025 17:00:36 -0700 Subject: [PATCH 92/99] jenmkinsfile --- Jenkinsfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a21565a35..0eb8314a8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -54,14 +54,6 @@ pipeline { } } - stage('Xray Scan') { - steps { - // Use the new "jf build-scan" command - // "Fail Build" is decided by your Xray policy if severity >= High - sh "${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail=false" - } - } - stage('Publish Build Info') { steps { sh """ @@ -71,6 +63,14 @@ pipeline { """ } } + + stage('Xray Scan') { + steps { + // Use the new "jf build-scan" command + // "Fail Build" is decided by your Xray policy if severity >= High + sh "${JF} build-scan ${JFROG_CLI_BUILD_NAME} ${JFROG_CLI_BUILD_NUMBER} --fail=false" + } + } } post { always { From 7da9fba39370153d3fd16e215b5b76e4226b388e Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Fri, 28 Mar 2025 12:06:58 -0700 Subject: [PATCH 93/99] bumped actions version --- .github/workflows/ci-pipeline.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-pipeline.yml b/.github/workflows/ci-pipeline.yml index 5b58919da..f0e19ee36 100644 --- a/.github/workflows/ci-pipeline.yml +++ b/.github/workflows/ci-pipeline.yml @@ -18,7 +18,7 @@ jobs: # 1) Checkout the repository to the runner ################################################# - name: Checkout - uses: actions/checkout@v3 # Pulls the latest code from the repository + uses: actions/checkout@v4 # Pulls the latest code from the repository ################################################# # 2) Set up Java environment @@ -58,9 +58,6 @@ jobs: - name: ping jfrog run: jf rt ping - - name: confirm artifactory secret - run: echo $ARTIFACTORY_REPO_URL - ################################################# # 6) Configure Maven to use JFrog as a repository ################################################# From 9cb5fc54faf6716d11755f6365ca570580ea06c4 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 10:10:00 -0700 Subject: [PATCH 94/99] fixing vuln --- .../samples/petclinic/owner/OwnerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index fa3506456..d111e553a 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -81,7 +81,7 @@ class OwnerController { this.owners.save(owner); redirectAttributes.addFlashAttribute("message", "New Owner Created"); - return "redirect:/owners/" + owner.getId(); + return "redirect

:/owners/" + owner.getId(); } @GetMapping("/owners/find") From 4b3444bc60cb6a842fdbfc05ed29308023e49047 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 10:27:47 -0700 Subject: [PATCH 95/99] fixing vuln --- .../samples/petclinic/owner/OwnerController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java index d111e553a..fa3506456 100644 --- a/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java +++ b/src/main/java/org/springframework/samples/petclinic/owner/OwnerController.java @@ -81,7 +81,7 @@ class OwnerController { this.owners.save(owner); redirectAttributes.addFlashAttribute("message", "New Owner Created"); - return "redirect

:/owners/" + owner.getId(); + return "redirect:/owners/" + owner.getId(); } @GetMapping("/owners/find") From 4a7a6918213cfa5c65c2e1c1d7612c0a61759d04 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 11:53:30 -0700 Subject: [PATCH 96/99] frogbot --- .../workflows/frogbot-scan-pull-request.yml | 42 ++++++++++++++++ .github/workflows/frogbot-scan-repository.yml | 50 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 .github/workflows/frogbot-scan-pull-request.yml create mode 100644 .github/workflows/frogbot-scan-repository.yml diff --git a/.github/workflows/frogbot-scan-pull-request.yml b/.github/workflows/frogbot-scan-pull-request.yml new file mode 100644 index 000000000..39aa281e4 --- /dev/null +++ b/.github/workflows/frogbot-scan-pull-request.yml @@ -0,0 +1,42 @@ +name: "Frogbot Scan Pull Request" +on: + pull_request_target: + types: [opened, synchronize] +permissions: + pull-requests: write + contents: read + # [Mandatory If using OIDC authentication protocol instead of JF_ACCESS_TOKEN] + # id-token: write +jobs: + scan-pull-request: + runs-on: ubuntu-latest + # A pull request needs to be approved before Frogbot scans it. Any GitHub user who is associated with the + # "frogbot" GitHub environment can approve the pull request to be scanned. + environment: frogbot + steps: + - uses: jfrog/frogbot@v2 + env: + # [Mandatory] + # JFrog platform URL + JF_URL: ${{ secrets.JF_URL }} + + # [Mandatory if JF_USER and JF_PASSWORD are not provided] + # JFrog access token with 'read' permissions on Xray service + JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} + + # [Mandatory if JF_ACCESS_TOKEN is not provided] + # JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD + # JF_USER: ${{ secrets.JF_USER }} + + # [Mandatory if JF_ACCESS_TOKEN is not provided] + # JFrog password. Must be provided with JF_USER + # JF_PASSWORD: ${{ secrets.JF_PASSWORD }} + + # [Mandatory] + # The GitHub token is automatically generated for the job + JF_GIT_TOKEN: ${{ secrets.JF_GIT_TOKEN }} + + # [Mandatory if using OIDC authentication protocol instead of JF_ACCESS_TOKEN] + # Insert to oidc-provider-name the 'Provider Name' defined in the OIDC integration configured in the JPD + # with: + # oidc-provider-name: "" \ No newline at end of file diff --git a/.github/workflows/frogbot-scan-repository.yml b/.github/workflows/frogbot-scan-repository.yml new file mode 100644 index 000000000..9e852cf89 --- /dev/null +++ b/.github/workflows/frogbot-scan-repository.yml @@ -0,0 +1,50 @@ +name: "Frogbot Scan Repository" +on: + workflow_dispatch: + schedule: + # The repository will be scanned once a day at 00:00 GMT. + - cron: "0 0 * * *" +permissions: + contents: write + pull-requests: write + security-events: write + # [Mandatory If using OIDC authentication protocol instead of JF_ACCESS_TOKEN] + # id-token: write +jobs: + scan-repository: + runs-on: ubuntu-latest + strategy: + matrix: + # The repository scanning will be triggered periodically on the following branches. + branch: ["dev"] + steps: + - uses: jfrog/frogbot@v2 + env: + # [Mandatory] + # JFrog platform URL + JF_URL: ${{ secrets.JF_URL }} + + # [Mandatory if JF_USER and JF_PASSWORD are not provided] + # JFrog access token with 'read' permissions on Xray service + JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} + + # [Mandatory if JF_ACCESS_TOKEN is not provided] + # JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD + # JF_USER: ${{ secrets.JF_USER }} + + # [Mandatory if JF_ACCESS_TOKEN is not provided] + # JFrog password. Must be provided with JF_USER + # JF_PASSWORD: ${{ secrets.JF_PASSWORD }} + + # [Mandatory] + # The GitHub token is automatically generated for the job + JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # [Mandatory] + # The name of the branch on which Frogbot will perform the scan + JF_GIT_BASE_BRANCH: ${{ matrix.branch }} + + # [Mandatory if using OIDC authentication protocol instead of JF_ACCESS_TOKEN] + # Insert to oidc-provider-name the 'Provider Name' defined in the OIDC integration configured in the JPD + # with: + # oidc-provider-name: "" \ No newline at end of file From 0c5fcd090934ecd2db4762113018ec8a61382847 Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 12:10:56 -0700 Subject: [PATCH 97/99] readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index e34511b86..6342fbe52 100644 --- a/README.md +++ b/README.md @@ -161,3 +161,4 @@ For additional details, please refer to the blog post [Hello DCO, Goodbye CLA: S ## License The Spring PetClinic sample application is released under version 2.0 of the [Apache License](https://www.apache.org/licenses/LICENSE-2.0). +frogbot test 1 \ No newline at end of file From 169eee925e952630c0cf4a0eec1d7b5b303ec2fd Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 12:33:30 -0700 Subject: [PATCH 98/99] fixing frogbot --- .github/workflows/frogbot-scan-pull-request.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/frogbot-scan-pull-request.yml b/.github/workflows/frogbot-scan-pull-request.yml index 39aa281e4..d5063a0fc 100644 --- a/.github/workflows/frogbot-scan-pull-request.yml +++ b/.github/workflows/frogbot-scan-pull-request.yml @@ -22,15 +22,15 @@ jobs: # [Mandatory if JF_USER and JF_PASSWORD are not provided] # JFrog access token with 'read' permissions on Xray service - JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} + # JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }} # [Mandatory if JF_ACCESS_TOKEN is not provided] # JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD - # JF_USER: ${{ secrets.JF_USER }} + JF_USER: ${{ secrets.JF_USER }} # [Mandatory if JF_ACCESS_TOKEN is not provided] # JFrog password. Must be provided with JF_USER - # JF_PASSWORD: ${{ secrets.JF_PASSWORD }} + JF_PASSWORD: ${{ secrets.JF_ACCESS_TOKEN }} # [Mandatory] # The GitHub token is automatically generated for the job From 776faecee46476cb6eab0cd04afed3bea941a3ac Mon Sep 17 00:00:00 2001 From: Jesse Houldsworth Date: Mon, 7 Apr 2025 12:34:50 -0700 Subject: [PATCH 99/99] fixing frogbot repositories config --- .github/workflows/frogbot-scan-repository.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/frogbot-scan-repository.yml b/.github/workflows/frogbot-scan-repository.yml index 9e852cf89..198487578 100644 --- a/.github/workflows/frogbot-scan-repository.yml +++ b/.github/workflows/frogbot-scan-repository.yml @@ -30,11 +30,11 @@ jobs: # [Mandatory if JF_ACCESS_TOKEN is not provided] # JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD - # JF_USER: ${{ secrets.JF_USER }} + JF_USER: ${{ secrets.JF_USER }} # [Mandatory if JF_ACCESS_TOKEN is not provided] # JFrog password. Must be provided with JF_USER - # JF_PASSWORD: ${{ secrets.JF_PASSWORD }} + JF_PASSWORD: ${{ secrets.JF_ACCESS_TOKEN }} # [Mandatory] # The GitHub token is automatically generated for the job