From e545040c15a6ba715f62826eed840ed1c6909c6a Mon Sep 17 00:00:00 2001 From: Venushka Perera Date: Sun, 23 Jan 2022 12:05:05 +0000 Subject: [PATCH] Switching to github actions --- .github/workflows/build.yaml | 13 ++++++++++ .github/workflows/release.yaml | 44 ++++++++++++++++++++++++++++++++++ .travis.yml | 38 ----------------------------- README.md | 3 --- pom.xml | 30 +++-------------------- 5 files changed, 60 insertions(+), 68 deletions(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .github/workflows/release.yaml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..4e2ee55 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,13 @@ +name: Build +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: maven + - run: mvn --batch-mode --update-snapshots verify \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..0efe446 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,44 @@ +name: Release +on: + push: + tags: + - 'release_*' +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'adopt' + cache: maven + - run: mvn --batch-mode --update-snapshots package + - run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\/release_/}" >> $GITHUB_ENV + - uses: actions/create-release@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ env.RELEASE_VERSION }} + draft: false + prerelease: false + - uses: actions/upload-release-asset@v1 + id: upload-release-zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/jmxeval.zip + asset_name: jmxeval-${{ env.RELEASE_VERSION }}-bin.zip + asset_content_type: application/zip + - uses: actions/upload-release-asset@v1 + id: upload-release-tar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./target/jmxeval.tar.gz + asset_name: jmxeval-${{ env.RELEASE_VERSION }}-bin.tar.gz + asset_content_type: application/gzip \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8d1f5c6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: java -jdk: - - openjdk8 -install: true -addons: - sonarcloud: - organization: "default" - token: - secure: "daUaZjl1D20W7mA1N9uSTSASqDdDS6ALawW6DfPnm70CP2aYXvXt2JAW/x9t0vLm9oHv4YVa+rM7kmeODNwVtjiB2ZHJCk/Yp37sIUvnWMuhEvJVWmegOMBLDfRSCLoUPkGCAtafcu32neLJEx66mQXMV2qKfuJFP0i2DhbGvIbASEPGw/IDgbUh4z3LmUK5O0uny8VZazIZ3vHGD6BENaBLO7gB2RyRL0fMB4twHxf649pGoeM7ZxbQqmy5Fcuo/wfnUJ9ErXj0SH0zDB2pfbRHoxZoBTCQ8g4AQOzVQjnlg5u5ttJXw11Oaw3+ee3uaoFxwUjjp7v16XkEZ5UYIWadvmnOcfCf0c7KOmmbywSCGQcQGs6ximTmfmHHXOd4BdveeOjzZc/YIWuaKlT69G1M6MJWmUJ5YycE1fBJkLvYoS15/ljDcqlYkgcJXF1SN1kgZxFtcrLCrIE/oqaiC1y8UIVOFIcOB4o0pKfdj2XZg5tq0icS+DnJUUH2YlfoCgtwuSwEGL3r+MlrNzCABVSBpEUZ1CcDOyhV4T3NKxyJhfQ1dsF/Jwi3MFqHwAU7rkIP6nPGrVPNrhOGwWtVDhPYkAv8X8AF6XlzjlAvPcUIF3zK9zMQSvl3zrnZURsVma4zxdqs/BuOv0P0iD9wwu8l1qIQSoT6Xgx57zYT8HY=" -jobs: - include: - - if: repo = venushka/jmxeval AND branch = master AND NOT type = pull_request - name: "Test" - script: - - git fetch --unshallow --quiet - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test sonar:sonar -B -U - - if: repo = venushka/jmxeval AND NOT branch = master AND NOT type = pull_request - name: "Test" - script: - - git fetch --unshallow --quiet - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test sonar:sonar -B -U -Dsonar.branch.name=$TRAVIS_BRANCH - - if: repo = venushka/jmxeval AND head_repo = venushka/jmxeval AND type = pull_request - name: "Test" - script: - - git fetch --unshallow --quiet - - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test sonar:sonar -B -U -Dsonar.pullrequest.key=$TRAVIS_PULL_REQUEST -Dsonar.pullrequest.branch=$TRAVIS_PULL_REQUEST_BRANCH -Dsonar.pullrequest.base=$TRAVIS_BRANCH - - if: (repo = venushka/jmxeval AND NOT head_repo = venushka/jmxeval AND type = pull_request) OR NOT repo = venushka/jmxeval - name: "Test" - script: - - mvn clean test -B -U -matrix: - fast_finish: true - include: - - jdk: openjdk8 -cache: - directories: - - '$HOME/.m2/repository' - - '$HOME/.sonar/cache' diff --git a/README.md b/README.md index dd53a55..5f98470 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ jmxeval ======= -[![Build Status](https://travis-ci.org/venushka/jmxeval.svg?branch=master)](https://travis-ci.org/venushka/jmxeval) -[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=com.adahas%3Ajmxeval&metric=alert_status)](https://sonarcloud.io/dashboard/index/com.adahas:jmxeval) - *jmxeval* is a highly flexible Nagios/NRPE plugin for monitoring Java applications via JMX. Instead of just checking just an attribute of an MBean, JMXEval allows you to query multiple MBean attributes as well as results of MBean method invocations, and also perform mathematical computations to derive much more meaningful figures for monitoring. JMXEval can also provide all the information captured from MBeans as well as any computed figures as performance data allowing you to capture and visualise trends in Nagios. # Setting up diff --git a/pom.xml b/pom.xml index 91a8ccd..1d78db0 100644 --- a/pom.xml +++ b/pom.xml @@ -33,19 +33,11 @@ 2.5 2.5 2.18 - 3.1.1 3.0 2.2.2 - - - src/main - src/test - target/surefire-reports - target/jacoco.exec - install @@ -58,11 +50,6 @@ asciidoctor-maven-plugin ${plugin.asciidoctor.version} - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${plugin.sonar.version} - @@ -92,6 +79,8 @@ src/main/assembly/descriptor.xml + jmxeval + false @@ -155,20 +144,7 @@ jdk.tools jdk1.8.0 system - ${toolsjar} + ${java.home}/../lib/tools.jar - - - - sonar - - true - - - https://sonarqube.com - ${java.home}/../lib/tools.jar - - -