mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-16 12:45:48 +00:00
manually downloading the build extractor
This commit is contained in:
parent
cdf8fd25e2
commit
a794a8afcc
1 changed files with 51 additions and 29 deletions
80
.github/workflows/ci-pipeline.yml
vendored
80
.github/workflows/ci-pipeline.yml
vendored
|
@ -1,12 +1,15 @@
|
||||||
name: CI Pipeline (Simplified)
|
name: Build with JFrog CLI (Forcing New Extractor)
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
#################################################
|
#################################################
|
||||||
# 1) Check out the repository
|
# 1) Check out the repository
|
||||||
|
@ -20,14 +23,26 @@ jobs:
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
java-version: '17'
|
||||||
- name: Set build-info extractor version
|
|
||||||
run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 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
|
- name: Install JFrog CLI
|
||||||
run: |
|
run: |
|
||||||
|
@ -36,7 +51,7 @@ jobs:
|
||||||
mv jfrog /usr/local/bin/
|
mv jfrog /usr/local/bin/
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 4) Configure JFrog CLI using GitHub secrets
|
# 5) Configure JFrog CLI
|
||||||
#################################################
|
#################################################
|
||||||
- name: Configure JFrog CLI
|
- name: Configure JFrog CLI
|
||||||
run: |
|
run: |
|
||||||
|
@ -47,43 +62,52 @@ jobs:
|
||||||
--interactive=false
|
--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
|
- name: Clear local Maven cache
|
||||||
run: rm -rf ~/.m2/repository
|
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: |
|
run: |
|
||||||
jfrog rt mvn clean package -X -e \
|
jfrog rt mvn clean package -X -e \
|
||||||
--build-name="spring-petclinic" \
|
--build-name="spring-petclinic" \
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 7) Upload the built artifact with JFrog CLI
|
# 9) Build Docker Image
|
||||||
#################################################
|
|
||||||
- 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
|
|
||||||
#################################################
|
#################################################
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
run: |
|
run: |
|
||||||
docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} .
|
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: |
|
run: |
|
||||||
jfrog rt docker-push \
|
jfrog rt docker-push \
|
||||||
trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} \
|
trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} \
|
||||||
|
@ -92,10 +116,8 @@ jobs:
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 10) Collect & Publish Build Info
|
# 11) Publish Build Info
|
||||||
#################################################
|
#################################################
|
||||||
- name: Publish Build Info
|
- name: Publish Build Info
|
||||||
run: |
|
run: |
|
||||||
jfrog rt build-publish \
|
jfrog rt build-publish "spring-petclinic" "${{ github.run_id }}"
|
||||||
"spring-petclinic" \
|
|
||||||
"${{ github.run_id }}"
|
|
||||||
|
|
Loading…
Reference in a new issue