This commit is contained in:
Rodolphe Fontaine 2024-10-17 21:11:26 +02:00
parent b75d8d483e
commit cb88dd9a7e

View file

@ -46,29 +46,72 @@ jobs:
- name: Run Tests - name: Run Tests
run: ./mvnw -B test run: ./mvnw -B test
Run_Jmeter_test_plan:
runs-on: ubuntu-latest
needs: Run_test Build_and_push:
strategy: runs-on: ubuntu-latest
matrix: needs: Run_test
java: [ '21' ] steps:
steps: - name: checkout Git repository
- uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up JDK ${{matrix.java}} - name: Set up JDK 21
uses: actions/setup-java@v4 uses: actions/setup-java@v4
with: with:
java-version: ${{matrix.java}} distribution: 'temurin' # See 'Supported distributions' for available options
distribution: 'adopt' java-version: '21'
cache: maven - name: Login to Jfrog Artifactory
- name: run docker uses: docker/login-action@v3
uses: docker-practice/actions-setup-docker@master with:
- name: Build Docker Image registry: rodi26.jfrog.io
run: docker build -t spring-petclinic . username: 'rodolphe.fontaine@orange.fr'
- name: Run Docker Container password: ${{ secrets.JF_ACCESS_TOKEN }}
run: docker run -d -p 8080:8080 spring-petclinic - name: Build and push
- name: Run JMeter Action on a test uses: docker/build-push-action@v6
uses: rbhadti94/apache-jmeter-action@v0.5.0 with:
with: push: true
testFilePath: src/test/jmeter/petclinic_test_plan.jmx tags: rodi26.jfrog.io/rodi26-docker/spring-petclinic:latest
outputReportsFolder: reports/
args: "--loglevel INFO" scan-repository:
runs-on: ubuntu-latest
needs: Build_and_push
strategy:
matrix:
# The repository scanning will be triggered periodically on the following branches.
branch: ["main"]
steps:
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '21'
- uses: jfrog/frogbot@v2.9.2
env:
# [Mandatory]
# JFrog platform URL
JF_URL: ${{ secrets.JF_URL }}
# [Mandatory if JF_USER and JF_PASSWORD are not provided]
# JFrog access token with 'read' permissions on Xray service
JF_ACCESS_TOKEN: ${{ secrets.JF_ACCESS_TOKEN }}
# [Mandatory if JF_ACCESS_TOKEN is not provided]
# JFrog username with 'read' permissions for Xray. Must be provided with JF_PASSWORD
# JF_USER: ${{ secrets.JF_USER }}
# [Mandatory if JF_ACCESS_TOKEN is not provided]
# JFrog password. Must be provided with JF_USER
# JF_PASSWORD: ${{ secrets.JF_PASSWORD }}
# [Mandatory]
# The GitHub token is automatically generated for the job
JF_GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# [Mandatory]
# The name of the branch on which Frogbot will perform the scan
JF_GIT_BASE_BRANCH: ${{ matrix.branch }}
# [Mandatory if using OIDC authentication protocol instead of JF_ACCESS_TOKEN]
# Insert to oidc-provider-name the 'Provider Name' defined in the OIDC integration configured in the JPD
# with:
# oidc-provider-name: ""
#JF_PATH_EXCLUSIONS: "*gradle*"