mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
fixing mvn
This commit is contained in:
parent
cb6fba2310
commit
f66f7ea949
1 changed files with 39 additions and 19 deletions
58
.github/workflows/ci-pipeline.yml
vendored
58
.github/workflows/ci-pipeline.yml
vendored
|
@ -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 }}"
|
||||
|
|
Loading…
Reference in a new issue