mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 20:25:50 +00:00
using jfrog cli so we publish maven artifact and build info
This commit is contained in:
parent
03f24b63db
commit
8bc9d5ec05
1 changed files with 31 additions and 15 deletions
46
.github/workflows/ci-pipeline.yml
vendored
46
.github/workflows/ci-pipeline.yml
vendored
|
@ -22,6 +22,20 @@ jobs:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
|
|
||||||
|
- 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 to use JFrog Artifactory
|
- name: Configure Maven to use JFrog Artifactory
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/.m2
|
mkdir -p ~/.m2
|
||||||
|
@ -43,22 +57,24 @@ jobs:
|
||||||
</servers>
|
</servers>
|
||||||
</settings>' > ~/.m2/settings.xml
|
</settings>' > ~/.m2/settings.xml
|
||||||
|
|
||||||
- name: Compile the code
|
- name: Compile and Package the Application
|
||||||
run: mvn clean compile
|
|
||||||
|
|
||||||
- name: Run tests
|
|
||||||
run: mvn test
|
|
||||||
|
|
||||||
- name: Package the application with Maven
|
|
||||||
run: mvn package -DskipTests
|
|
||||||
|
|
||||||
- name: Build Docker image
|
|
||||||
run: |
|
run: |
|
||||||
docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest .
|
mvn clean package -DskipTests
|
||||||
|
|
||||||
- name: Log in to JFrog Artifactory using Identity Token
|
- name: Publish Maven Artifact to JFrog Artifactory
|
||||||
run: echo ${{ secrets.ARTIFACTORY_IDENTITY_TOKEN }} | docker login trialt0zppb.jfrog.io -u ${{ secrets.ARTIFACTORY_USERNAME }} --password-stdin
|
run: |
|
||||||
|
jfrog rt mvn clean install --build-name=spring-petclinic --build-number=${{ github.run_id }}
|
||||||
|
|
||||||
- name: Push Docker image to JFrog Artifactory
|
- name: Build Docker Image
|
||||||
run: docker push trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:latest
|
run: |
|
||||||
|
docker build -t trialt0zppb.jfrog.io/onboarding-docker-local/spring-petclinic:${{ github.run_id }} .
|
||||||
|
|
||||||
|
- name: Collect Docker Build Info with 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 to JFrog Artifactory
|
||||||
|
run: |
|
||||||
|
jfrog rt build-publish spring-petclinic ${{ github.run_id }}
|
||||||
|
|
Loading…
Reference in a new issue