mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-02-05 05:41:11 +00:00
Create Petclinic2Artifactory
Signed-off-by: nirpel-sys <nirpel@jfrog.com>
This commit is contained in:
parent
18388c7fc9
commit
fb49bb063d
1 changed files with 64 additions and 0 deletions
64
.github/workflows/Petclinic2Artifactory
vendored
Normal file
64
.github/workflows/Petclinic2Artifactory
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
name: PetClinic to Artifactory
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
pull_request: # Added to allow Frogbot to scan incoming PRs
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
pull-requests: write # Required for Frogbot to comment on PRs
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 17
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '17'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Set up JFrog CLI
|
||||
uses: jfrog/setup-jfrog-cli@v4
|
||||
env:
|
||||
JF_URL: ${{ secrets.JF_URL }}
|
||||
with:
|
||||
version: latest
|
||||
oidc-provider-name: github-oidc
|
||||
oidc-audience: jfrog-github
|
||||
|
||||
# --- START FROGBOT SCAN ---
|
||||
- name: Frogbot Scan
|
||||
uses: jfrog/frogbot@v2
|
||||
env:
|
||||
JF_URL: ${{ secrets.JF_URL }}
|
||||
# Frogbot uses the OIDC configuration from the setup-jfrog-cli step
|
||||
JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
# --- END FROGBOT SCAN ---
|
||||
|
||||
- name: Build and Test
|
||||
run: ./mvnw clean test
|
||||
|
||||
- name: Build Docker Image
|
||||
run: |
|
||||
./mvnw spring-boot:build-image \
|
||||
-Dspring-boot.build-image.imageName=petclinic-app:${{ github.run_number }}
|
||||
|
||||
- name: Publish to JFrog
|
||||
run: |
|
||||
JF_HOST=$(echo "${{ secrets.JF_URL }}" | sed 's|https://||' | sed 's|/||g')
|
||||
DOCKER_REPO="docker-local"
|
||||
IMAGE_NAME="petclinic-app:${{ github.run_number }}"
|
||||
REMOTE_TAG="$JF_HOST/$DOCKER_REPO/$IMAGE_NAME"
|
||||
|
||||
docker tag "$IMAGE_NAME" "$REMOTE_TAG"
|
||||
jf docker push "$REMOTE_TAG" --build-name=petclinic-trial --build-number=${{ github.run_number }}
|
||||
jf rt bp petclinic-trial ${{ github.run_number }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue