mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-16 04:45:49 +00:00
trying fix from jeffry
This commit is contained in:
parent
6c454a21f9
commit
17a59d1146
1 changed files with 13 additions and 42 deletions
53
.github/workflows/ci-pipeline.yml
vendored
53
.github/workflows/ci-pipeline.yml
vendored
|
@ -1,22 +1,18 @@
|
||||||
name: CI Pipeline (Simplified)
|
name: CI Pipeline (Simplified)
|
||||||
|
|
||||||
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
|
||||||
#################################################
|
#################################################
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 2) Set up Java
|
# 2) Set up Java
|
||||||
#################################################
|
#################################################
|
||||||
|
@ -25,7 +21,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 3) Install JFrog CLI
|
# 3) Install JFrog CLI
|
||||||
#################################################
|
#################################################
|
||||||
|
@ -34,7 +29,6 @@ jobs:
|
||||||
curl -fL https://getcli.jfrog.io | bash
|
curl -fL https://getcli.jfrog.io | bash
|
||||||
chmod +x jfrog
|
chmod +x jfrog
|
||||||
mv jfrog /usr/local/bin/
|
mv jfrog /usr/local/bin/
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 4) Configure JFrog CLI
|
# 4) Configure JFrog CLI
|
||||||
#################################################
|
#################################################
|
||||||
|
@ -45,36 +39,22 @@ jobs:
|
||||||
--user="${{ secrets.ARTIFACTORY_USERNAME }}" \
|
--user="${{ secrets.ARTIFACTORY_USERNAME }}" \
|
||||||
--password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \
|
--password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \
|
||||||
--interactive=false
|
--interactive=false
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 5) (Optional) Modify Maven Settings to Use Artifactory
|
# 5) Clear the local Maven cache
|
||||||
#
|
|
||||||
# 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
|
- name: Clear local Maven cache
|
||||||
run: rm -rf ~/.m2/repository
|
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
|
- name: Build with JFrog CLI
|
||||||
run: mvn clean package -DskipTests
|
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
|
# 7) Upload the built artifact with JFrog CLI
|
||||||
#
|
|
||||||
# target/*.jar -> maven-libs-release-local (or whichever repo you prefer)
|
|
||||||
#################################################
|
#################################################
|
||||||
- name: Upload Maven Artifact to Artifactory
|
- name: Upload Maven Artifact to Artifactory
|
||||||
run: |
|
run: |
|
||||||
|
@ -84,16 +64,14 @@ jobs:
|
||||||
--flat=false \
|
--flat=false \
|
||||||
--build-name="spring-petclinic" \
|
--build-name="spring-petclinic" \
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 9) Build Docker image with local Docker
|
# 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 }} .
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 10) Push Docker image using JFrog CLI
|
# 9) Push Docker image using JFrog CLI
|
||||||
#################################################
|
#################################################
|
||||||
- name: Push Docker Image to Artifactory
|
- name: Push Docker Image to Artifactory
|
||||||
run: |
|
run: |
|
||||||
|
@ -102,15 +80,8 @@ jobs:
|
||||||
onboarding-docker-local \
|
onboarding-docker-local \
|
||||||
--build-name="spring-petclinic" \
|
--build-name="spring-petclinic" \
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# 11) Collect & Publish Build Info
|
# 10) 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
|
- name: Publish Build Info
|
||||||
run: |
|
run: |
|
||||||
|
|
Loading…
Reference in a new issue