mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-04-24 19:32:48 +00:00
JFrog play
This commit is contained in:
parent
5fc75eb60a
commit
767fcab03c
1 changed files with 74 additions and 0 deletions
74
.github/workflows/caller-1.yml
vendored
74
.github/workflows/caller-1.yml
vendored
|
@ -31,3 +31,77 @@ jobs:
|
|||
with:
|
||||
greeting: 'Hi there'
|
||||
name: 'GitHub Actions User'
|
||||
playing-with-docker-jfrog:
|
||||
name: Docker Build and Publish
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup JFrog CLI
|
||||
uses: jfrog/setup-jfrog-cli@v4
|
||||
env:
|
||||
JF_URL: ${{ vars.ARTIFACTORY_URL }}
|
||||
JF_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
|
||||
|
||||
- name: Build Tag and push Docker Image
|
||||
env:
|
||||
IMAGE_NAME: triala5wxv6.jfrog.io/test-docker/jfrog-docker-example-image:${{ github.run_number }}
|
||||
run: |
|
||||
jf docker build -t $IMAGE_NAME .
|
||||
jf docker push $IMAGE_NAME
|
||||
|
||||
- name: Publish Build info With JFrog CLI
|
||||
env:
|
||||
# Generated and maintained by GitHub
|
||||
JFROG_CLI_BUILD_NAME: jfrog-docker-build-example
|
||||
# JFrog organization secret
|
||||
JFROG_CLI_BUILD_NUMBER : ${{ github.run_number }}
|
||||
run: |
|
||||
# Export the build name and build nuber
|
||||
# Collect environment variables for the build
|
||||
jf rt build-collect-env
|
||||
# Collect VCS details from git and add them to the build
|
||||
jf rt build-add-git
|
||||
# Publish build info
|
||||
jf rt build-publish
|
||||
|
||||
playing-with-artifact-jfrog:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '17' ]
|
||||
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v4
|
||||
name: Checkout code
|
||||
|
||||
- name: Set up JDK ${{matrix.java}}
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: ${{matrix.java}}
|
||||
distribution: 'temurin'
|
||||
cache: maven
|
||||
|
||||
- name: Add executable permissions
|
||||
run: chmod a+x mvnw
|
||||
|
||||
- name: Maven install dependencies
|
||||
run: ./mvnw clean package
|
||||
|
||||
|
||||
- name: Configure JFrog CLI with Access Token
|
||||
run: |
|
||||
jfrog rt config --url=$JFROG_URL \
|
||||
--access-token=$JFROG_ACCESS_TOKEN \
|
||||
--interactive=false
|
||||
env:
|
||||
JFROG_URL: ${{ secrets.ARTIFACTORY_URL }}
|
||||
JFROG_ACCESS_TOKEN: ${{ secrets.JFROG_ACCESS_TOKEN }}
|
||||
|
||||
- name: Upload Artifact
|
||||
run: |
|
||||
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
|
||||
jfrog rt u "target/*.jar" "my-repo-local/my-app/${VERSION}/"
|
||||
|
||||
|
|
Loading…
Reference in a new issue