mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-16 04:35:49 +00:00
fixing mvn
This commit is contained in:
parent
f66f7ea949
commit
160e9b3d75
1 changed files with 15 additions and 35 deletions
50
.github/workflows/ci-pipeline.yml
vendored
50
.github/workflows/ci-pipeline.yml
vendored
|
@ -2,33 +2,26 @@ name: Build and Publish with JFrog Artifactory
|
||||||
|
|
||||||
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 your code
|
|
||||||
################################################################
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
################################################################
|
|
||||||
# 2) Set up Java
|
|
||||||
################################################################
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
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
|
- name: Install JFrog CLI
|
||||||
run: |
|
run: |
|
||||||
curl -fL https://getcli.jfrog.io | bash
|
curl -fL https://getcli.jfrog.io | bash
|
||||||
|
@ -43,11 +36,7 @@ jobs:
|
||||||
--password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \
|
--password="${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }}" \
|
||||||
--interactive=false
|
--interactive=false
|
||||||
|
|
||||||
################################################################
|
- name: Configure Maven for Artifactory
|
||||||
# 4) Configure Maven to Use Artifactory
|
|
||||||
# (jfrog rt mvnc sets up the Maven resolver & deploy repos)
|
|
||||||
################################################################
|
|
||||||
- name: Configure JFrog CLI for Maven
|
|
||||||
run: |
|
run: |
|
||||||
jfrog rt mvnc \
|
jfrog rt mvnc \
|
||||||
--server-id-resolve=my-artifactory \
|
--server-id-resolve=my-artifactory \
|
||||||
|
@ -57,37 +46,28 @@ jobs:
|
||||||
--repo-deploy-releases=maven-libs-release-local \
|
--repo-deploy-releases=maven-libs-release-local \
|
||||||
--repo-deploy-snapshots=maven-libs-snapshot-local
|
--repo-deploy-snapshots=maven-libs-snapshot-local
|
||||||
|
|
||||||
################################################################
|
|
||||||
# 5) Clear the local .m2 cache to avoid leftover references
|
|
||||||
################################################################
|
|
||||||
- name: Clear local Maven cache
|
- name: Clear local Maven cache
|
||||||
run: rm -rf ~/.m2/repository
|
run: rm -rf ~/.m2/repository
|
||||||
|
|
||||||
################################################################
|
- name: Debug Maven Settings
|
||||||
# 6) Maven build & publish artifact via JFrog CLI with build info
|
run: mvn help:effective-settings
|
||||||
################################################################
|
|
||||||
- name: Build & Publish Maven Artifact
|
- name: Maven Build & Publish
|
||||||
run: |
|
run: |
|
||||||
jfrog rt mvn clean install \
|
jfrog rt mvn clean install \
|
||||||
--build-name=spring-petclinic \
|
--build-name="spring-petclinic" \
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
################################################################
|
- name: Docker Build
|
||||||
# 7) Build and push Docker image with JFrog CLI (no 'docker push')
|
|
||||||
################################################################
|
|
||||||
- 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 }} .
|
||||||
|
|
||||||
- name: Push Docker Image to Artifactory
|
- name: Docker Push via JFrog CLI
|
||||||
run: |
|
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-name="spring-petclinic" \
|
||||||
--build-number="${{ github.run_id }}"
|
--build-number="${{ github.run_id }}"
|
||||||
|
|
||||||
################################################################
|
|
||||||
# 8) Publish the Build Info to Artifactory for full traceability
|
|
||||||
################################################################
|
|
||||||
- name: Publish Build Info
|
- name: Publish Build Info
|
||||||
run: |
|
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