mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-02-05 13:51:12 +00:00
73 lines
2.3 KiB
YAML
73 lines
2.3 KiB
YAML
name: Build and Publish with JFrog Artifactory
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
|
|
- name: Set build-info extractor version
|
|
run: echo "JFROG_CLI_BUILD_INFO_EXTRACTOR_VERSION=2.38.6" >> $GITHUB_ENV
|
|
|
|
- name: Install JFrog CLI
|
|
run: |
|
|
curl -fL https://getcli.jfrog.io | bash
|
|
chmod +x jfrog
|
|
mv jfrog /usr/local/bin/
|
|
|
|
- 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
|
|
|
|
- name: Configure Maven for Artifactory
|
|
run: |
|
|
jfrog rt mvnc \
|
|
--server-id-resolve=my-artifactory \
|
|
--repo-resolve-releases=maven-maven-remote \
|
|
--repo-resolve-snapshots=maven-maven-remote \
|
|
--server-id-deploy=my-artifactory \
|
|
--repo-deploy-releases=maven-libs-release-local \
|
|
--repo-deploy-snapshots=maven-libs-snapshot-local
|
|
|
|
- name: Clear local Maven cache
|
|
run: rm -rf ~/.m2/repository
|
|
|
|
- name: Debug Maven Settings
|
|
run: mvn help:effective-settings
|
|
|
|
- name: Maven Build & Publish
|
|
run: |
|
|
jfrog rt mvn clean install \
|
|
--build-name="spring-petclinic" \
|
|
--build-number="${{ github.run_id }}"
|
|
|
|
- name: Docker Build
|
|
run: |
|
|
docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} .
|
|
|
|
- name: Docker Push via JFrog CLI
|
|
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 }}"
|
|
|
|
- name: Publish Build Info
|
|
run: |
|
|
jfrog rt build-publish spring-petclinic "${{ github.run_id }}"
|