added jfrog mvn config

This commit is contained in:
Jesse Houldsworth 2025-03-14 11:03:07 -07:00
parent fca0158054
commit d97fa011a8
2 changed files with 26 additions and 17 deletions

View file

@ -13,6 +13,7 @@ jobs:
################################################# #################################################
- name: Checkout - name: Checkout
uses: actions/checkout@v3 uses: actions/checkout@v3
################################################# #################################################
# 2) Set up Java # 2) Set up Java
################################################# #################################################
@ -21,6 +22,7 @@ jobs:
with: with:
java-version: '17' java-version: '17'
distribution: 'temurin' distribution: 'temurin'
################################################# #################################################
# 3) Install JFrog CLI # 3) Install JFrog CLI
################################################# #################################################
@ -29,31 +31,24 @@ 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) Clear the local Maven cache
#################################################
- 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 - name: Clear local Maven cache
run: rm -rf ~/.m2/repository 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 - name: Build with JFrog CLI
run: | run: |
jfrog rt mvn clean package \ jfrog rt mvn clean package \
--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 # 6) Upload the built artifact with JFrog CLI
################################################# #################################################
- name: Upload Maven Artifact to Artifactory - name: Upload Maven Artifact to Artifactory
run: | run: |
@ -63,14 +58,16 @@ jobs:
--flat=false \ --flat=false \
--build-name="spring-petclinic" \ --build-name="spring-petclinic" \
--build-number="${{ github.run_id }}" --build-number="${{ github.run_id }}"
################################################# #################################################
# 8) Build Docker image with local Docker # 7) 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 # 8) Push Docker image using JFrog CLI
################################################# #################################################
- name: Push Docker Image to Artifactory - name: Push Docker Image to Artifactory
run: | run: |
@ -79,8 +76,9 @@ 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 }}"
################################################# #################################################
# 10) Collect & Publish Build Info # 9) Collect & Publish Build Info
################################################# #################################################
- name: Publish Build Info - name: Publish Build Info
run: | run: |

View file

@ -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