spring-petclinic/.github/workflows/ci-pipeline.yml
Jesse Houldsworth cd640ed3d6 maharshi
2025-03-14 13:41:32 -07:00

91 lines
3.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 its 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 }}"