mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-01-23 20:01:12 +00:00
91 lines
3.2 KiB
YAML
91 lines
3.2 KiB
YAML
name: Build with JFrog CLI (Forcing New Extractor)
|
||
|
||
on:
|
||
push:
|
||
branches: [ "main" ]
|
||
pull_request:
|
||
branches: [ "main" ]
|
||
|
||
jobs:
|
||
build:
|
||
runs-on: ubuntu-latest
|
||
|
||
steps:
|
||
#################################################
|
||
# 1) Check out the repository
|
||
#################################################
|
||
- 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'
|
||
|
||
#################################################
|
||
# 4) Install JFrog CLI
|
||
#################################################
|
||
- name: Setup JFrog CLI
|
||
uses: jfrog/setup-jfrog-cli@v4
|
||
id: setup-cli
|
||
env:
|
||
JF_URL: ${{secrets.JF_RT_URL}}
|
||
JFROG_CLI_RELEASES_REPO: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}'
|
||
JFROG_CLI_EXTRACTORS_REMOTE: '${{secrets.JF_RT_URL}}/artifactory/${{secrets.RT_REPO_MVN_VIRTUAL}}'
|
||
JF_GIT_TOKEN: ${{secrets.GH_TOKEN}}
|
||
JF_USER: ${{secrets.ARTIFACTORY_USERNAME}}
|
||
JF_PASSWORD: ${{secrets.ARTIFACTORY_IDENTITY_TOKEN}}
|
||
|
||
- name: Clear local Maven cache
|
||
run: rm -rf ~/.m2/repository
|
||
|
||
- name: Ensure mvnw is executable
|
||
run: chmod +x mvnw
|
||
|
||
- name: ping jfrog
|
||
run: jf rt ping
|
||
|
||
- name: configure maven
|
||
run: jf mvnc --global --repo-resolve-releases ${{secrets.RT_REPO_MVN_VIRTUAL}} --repo-resolve-snapshots ${{secrets.RT_REPO_MVN_VIRTUAL}}
|
||
|
||
#################################################
|
||
# 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: Maven Build With JFrog CLI
|
||
run: |
|
||
jf mvn clean install -X -e \
|
||
-DskipTests=true -Denforcer.skip=true \
|
||
--build-name="spring-petclinic" \
|
||
--build-number="${{ github.run_id }}"
|
||
|
||
#################################################
|
||
# 9) Build Docker Image
|
||
#################################################
|
||
- name: Build Docker Image
|
||
run: |
|
||
docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} .
|
||
|
||
#################################################
|
||
# 10) Push Docker Image via JFrog CLI
|
||
#################################################
|
||
- name: Docker Push 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 }}"
|
||
|
||
#################################################
|
||
# 11) Publish Build Info
|
||
#################################################
|
||
- name: Publish Build Info
|
||
run: |
|
||
jfrog rt build-publish "spring-petclinic" "${{ github.run_id }}"
|