TSK-1497: introduced GitHub Actions
This commit is contained in:
parent
ed5d262138
commit
d773869779
|
@ -0,0 +1,453 @@
|
|||
name: CI
|
||||
on:
|
||||
workflow_dispatch:
|
||||
create:
|
||||
tags:
|
||||
- v*
|
||||
push:
|
||||
branches-ignore:
|
||||
- dependabot/**
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
env:
|
||||
JAVA_VERSION: 11
|
||||
NODE_VERSION: 14.15.4
|
||||
|
||||
ARTIFACTS_CYPRESS_TESTS_NAME: cypress-tests
|
||||
ARTIFACTS_CYPRESS_TESTS_PATH: web/cypress
|
||||
ARTIFACTS_TASKANA_JARS_NAME: taskana-jars
|
||||
ARTIFACTS_TASKANA_JARS_PATH: ~/.m2/repository/pro/taskana
|
||||
ARTIFACTS_TASKANA_WEB_NAME: taskana-web
|
||||
ARTIFACTS_TASKANA_WEB_PATH: web/dist
|
||||
ARTIFACTS_JACOCO_REPORTS_NAME: jacoco-reports
|
||||
ARTIFACTS_JACOCO_REPORTS_PATH: '**/jacoco.exec'
|
||||
|
||||
CACHE_WEB_NAME: web
|
||||
CACHE_MAVEN_FOR_WEB_NAME: maven-for-web
|
||||
CACHE_MAVEN_NAME: maven
|
||||
CACHE_SONAR_NAME: sonar
|
||||
|
||||
jobs:
|
||||
compile_frontend:
|
||||
name: Compile taskana-web
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Cache web dependencies
|
||||
id: web-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: web/node_modules
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}
|
||||
- name: Cache maven dependencies (for web)
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_MAVEN_FOR_WEB_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.OS }}-${{ env.CACHE_MAVEN_FOR_WEB_NAME }}
|
||||
- name: Install Dependencies
|
||||
if: steps.web-cache.outputs.cache-hit != 'true'
|
||||
working-directory: web
|
||||
run: npm ci
|
||||
- name: Compile & build
|
||||
working-directory: web
|
||||
run: |
|
||||
npm run lint
|
||||
npm run build:prod
|
||||
- name: Build maven artifact
|
||||
run: ./mvnw -B install -pl :taskana-web -am
|
||||
- name: Upload taskana-web artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
if-no-files-found: error
|
||||
- name: Remove taskana artifacts from cache
|
||||
run: rm -rf ~/.m2/repository/pro/taskana
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
compile_backend:
|
||||
name: Compile all maven modules
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
id: cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Compile & build
|
||||
run: ./mvnw -B install -DskipTests -Dasciidoctor.skip -Djacoco.skip
|
||||
- name: Populate cache
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
./mvnw -B dependency:go-offline
|
||||
./mvnw -B dependency:go-offline -f rest/taskana-rest-spring-example-wildfly
|
||||
./mvnw -B test -Dtest=GibtEsNet -DfailIfNoTests=false
|
||||
- name: Upload taskana artifacts
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
if-no-files-found: error
|
||||
- name: Remove taskana artifacts from cache
|
||||
run: rm -rf ~/.m2/repository/pro/taskana
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
compile_taskana-rest-spring-example-wildfly:
|
||||
name: Compile taskana-rest-spring-example-wildfly
|
||||
needs: compile_backend
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Compile
|
||||
run: ./mvnw -B test-compile -f rest/taskana-rest-spring-example-wildfly -DskipTests
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
test_frontend:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Test taskana-web
|
||||
needs: [ compile_frontend, compile_backend ]
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
- name: Cache web dependencies
|
||||
id: web-cache
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: web/node_modules
|
||||
key: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: ${{ runner.OS }}-${{ env.CACHE_WEB_NAME }}
|
||||
# Theoretically this is not necessary because we reuse the cache from the 'compile_frontend' job.
|
||||
# Sometimes the cache is not created, therefore this is a fallback.
|
||||
- name: Install Dependencies
|
||||
if: steps.web-cache.outputs.cache-hit != 'true'
|
||||
working-directory: web
|
||||
run: npm ci
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Test
|
||||
working-directory: web
|
||||
run: npm run test -- --coverageReporters text-summary
|
||||
# TODO: new frontend breaks our cypress tests.
|
||||
# - name: Cypress tests
|
||||
# working-directory: web
|
||||
# run: |
|
||||
# ../mvnw -B spring-boot:run -P history.plugin -f .. -pl :taskana-rest-spring-example-boot &
|
||||
# npx wait-port -t 30000 localhost:8080 && npm run e2e -- --config-file ../ci/cypress.json
|
||||
- name: Upload Cypress tests
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_CYPRESS_TESTS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_CYPRESS_TESTS_PATH }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
test_backend:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Test ${{ matrix.module }} on ${{ matrix.database }}
|
||||
needs: [ compile_taskana-rest-spring-example-wildfly ]
|
||||
strategy:
|
||||
matrix:
|
||||
module:
|
||||
- taskana-common
|
||||
- taskana-common-data
|
||||
- taskana-common-test
|
||||
- taskana-core
|
||||
- taskana-cdi
|
||||
- taskana-cdi-example
|
||||
- taskana-spring
|
||||
- taskana-spring-example
|
||||
- taskana-rest-spring
|
||||
- taskana-rest-spring-example-common
|
||||
- taskana-loghistory-provider
|
||||
- taskana-simplehistory-provider
|
||||
- taskana-simplehistory-rest-spring
|
||||
database:
|
||||
- H2
|
||||
include:
|
||||
- module: taskana-core
|
||||
database: POSTGRES_10
|
||||
- module: taskana-core
|
||||
database: DB2_11_1
|
||||
- module: taskana-rest-spring-example-boot
|
||||
database: DB2_11_1
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Prepare database
|
||||
run: ci/prepare_db.sh ${{ matrix.database }}
|
||||
- name: Generate JavaDoc for Rest Documentation
|
||||
if: matrix.module == 'taskana-simplehistory-rest-spring'
|
||||
run: ./mvnw -B validate -pl :taskana-rest-spring
|
||||
- name: Test
|
||||
run: ./mvnw -B verify -pl :${{matrix.module}}
|
||||
- name: Upload JaCoCo Report
|
||||
if: matrix.database == 'H2'
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_JACOCO_REPORTS_PATH }}
|
||||
if-no-files-found: ignore
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
# As soon as we can upgrade the JDK to 11 we can add wildfly to the test matrix
|
||||
test_taskana-rest-spring-example-wildfly:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Test taskana-rest-spring-example-wildfly on POSTGRES_10
|
||||
needs: [ compile_taskana-rest-spring-example-wildfly ]
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 8
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Start database
|
||||
run: ci/prepare_db.sh POSTGRES_10
|
||||
- name: Test
|
||||
run: ./mvnw -B verify -f rest/taskana-rest-spring-example-wildfly
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
|
||||
release_artifacts:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Release artifacts to OSS Sonatype
|
||||
if: github.repository == 'Taskana/taskana' && ( startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master' ) && github.head_ref == ''
|
||||
needs: [ test_frontend, test_backend, test_taskana-rest-spring-example-wildfly ]
|
||||
# as documented in the gpg manual (https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html)
|
||||
# we should execute this command before interacting with gpg (otherwise gpg won't work)
|
||||
env:
|
||||
GPG_TTY: $(tty)
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # necessary for push back
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana-web artifact
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
- name: Import GPG Key
|
||||
run: echo -n "$GPG_KEY" | base64 --decode | gpg --batch --import
|
||||
env:
|
||||
GPG_KEY: ${{ secrets.GPG_KEY }}
|
||||
- name: Change versions to match tag
|
||||
run: ci/change_version.sh -m .
|
||||
- name: Release artifacts to OSS Sonatype
|
||||
run: |
|
||||
./mvnw -B deploy -P $([[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot") \
|
||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip \
|
||||
-pl :taskana-parent,\
|
||||
:taskana-common-parent,:taskana-common,:taskana-common-data,:taskana-common-test,\
|
||||
:taskana-lib-parent,:taskana-core,:taskana-cdi,:taskana-spring,\
|
||||
:taskana-rest-parent,:taskana-web,:taskana-rest-spring,\
|
||||
:taskana-history-parent,:taskana-simplehistory-provider,:taskana-simplehistory-rest-spring,:taskana-loghistory-provider
|
||||
env:
|
||||
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
OSSRH_JIRA_USERNAME: ${{ secrets.OSSRH_JIRA_USERNAME }}
|
||||
OSSRH_JIRA_PASSWORD: ${{ secrets.OSSRH_JIRA_PASSWORD }}
|
||||
- name: Update version to next snapshot and push back
|
||||
run: |
|
||||
ci/change_version.sh -i -m .
|
||||
ci/update_taskana_dependency_for_wildfly.sh
|
||||
ci/commitPoms.sh
|
||||
env:
|
||||
GH_EMAIL: ${{ secrets.GH_EMAIL }}
|
||||
GH_USERNAME: ${{ secrets.GH_USERNAME }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
deploy_to_bluemix:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Deploy demo app to IBM Cloud Foundry
|
||||
if: github.repository == 'Taskana/taskana' && github.ref == 'refs/heads/master' && github.head_ref == ''
|
||||
needs: [ test_frontend, test_backend, test_taskana-rest-spring-example-wildfly ]
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download taskana artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_JARS_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_JARS_PATH }}
|
||||
- name: Download taskana-web artifacts
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_TASKANA_WEB_NAME }}
|
||||
path: ${{ env.ARTIFACTS_TASKANA_WEB_PATH }}
|
||||
- name: Build taskana-web
|
||||
run: ./mvnw -B install -pl :taskana-web
|
||||
- name: Generate Javadoc
|
||||
run: ./mvnw -B clean javadoc:jar -pl :taskana-core,:taskana-cdi,:taskana-spring
|
||||
- name: Generate Rest Documentation
|
||||
run: ./mvnw -B test asciidoctor:process-asciidoc -Dtest=*DocTest -pl :taskana-rest-spring,:taskana-simplehistory-rest-spring
|
||||
- name: Build Example Application
|
||||
run: ./mvnw -B install -P history.plugin -pl :taskana-rest-spring-example-boot -DskipTests -Dcheckstyle.skip
|
||||
- name: Verify Example Application contains documentation
|
||||
run: ci/verify_docs_jar.sh
|
||||
- name: Deploy to IBM Cloud Foundry
|
||||
uses: IBM/cloudfoundry-deploy@v1.0
|
||||
with:
|
||||
IBM_CLOUD_API_KEY: ${{ secrets.IBM_CLOUD_API_KEY }}
|
||||
IBM_CLOUD_CF_API: ${{ secrets.IBM_CLOUD_CF_API }}
|
||||
IBM_CLOUD_CF_ORG: ${{ secrets.IBM_CLOUD_CF_ORG }}
|
||||
IBM_CLOUD_CF_SPACE: ${{ secrets.IBM_CLOUD_CF_SPACE }}
|
||||
- name: Smoke test documentation
|
||||
run: ci/verify_docs_alive.sh
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
||||
|
||||
upload_to_sonar:
|
||||
runs-on: ubuntu-20.04
|
||||
name: Upload SonarQube analysis to sonarcloud
|
||||
needs: [ test_frontend, test_backend, test_taskana-rest-spring-example-wildfly ]
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
|
||||
- name: Set up JDK ${{ env.JAVA_VERSION }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: ${{ env.JAVA_VERSION }}
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-${{ env.CACHE_SONAR_NAME }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_SONAR_NAME }}
|
||||
- name: Cache maven dependencies
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.m2
|
||||
key: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-${{ env.CACHE_MAVEN_NAME }}
|
||||
- name: Download JaCoCo reports
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: ${{ env.ARTIFACTS_JACOCO_REPORTS_NAME }}
|
||||
- name: Install taskana
|
||||
run: ./mvnw -B install -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
- name: Upload SonarQube analysis
|
||||
run: ./mvnw -B sonar:sonar
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
SONAR_PROJECT_KEY: ${{ secrets.SONAR_PROJECT_KEY }}
|
||||
SONAR_ORGANIZATION: ${{ secrets.SONAR_ORGANIZATION }}
|
||||
- name: Cancel workflow
|
||||
if: failure()
|
||||
uses: andymckay/cancel-action@0.2
|
143
.travis.yml
143
.travis.yml
|
@ -1,143 +0,0 @@
|
|||
os: linux
|
||||
dist: bionic
|
||||
|
||||
language: java
|
||||
|
||||
jdk:
|
||||
- openjdk11
|
||||
|
||||
addons:
|
||||
sonarcloud:
|
||||
organization: $SONAR_ORGANIZATION
|
||||
|
||||
git:
|
||||
#depth false needed by sonarcloud for deep comparison
|
||||
depth: false
|
||||
|
||||
services:
|
||||
- docker
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- web/node_modules
|
||||
|
||||
branches:
|
||||
except:
|
||||
- /dependabot.*/
|
||||
|
||||
stages:
|
||||
- name: Compile
|
||||
- name: Test
|
||||
- name: Release / Deploy
|
||||
if: repo = 'Taskana/taskana' AND (tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ OR branch = master) AND type != pull_request
|
||||
|
||||
env:
|
||||
global:
|
||||
- NODE_VERSION=12.10.0
|
||||
jobs:
|
||||
- DB=H2
|
||||
- DB=DB2_11_1
|
||||
|
||||
install: skip
|
||||
# include SONAR_PROJECT_KEY as a second parameter if this is not a pull request
|
||||
script: ci/test.sh "$DB" "$([ "false" = "$TRAVIS_PULL_REQUEST" ] && echo "$SONAR_PROJECT_KEY")"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
jobs:
|
||||
include:
|
||||
# We are using the environment variable 'MODULE' to force travis into using a different cache for each build.
|
||||
# See https://docs.travis-ci.com/user/caching/#caches-and-build-matrices for detailed information on
|
||||
# which characteristics determine the cache selection.
|
||||
- stage: Compile
|
||||
name: taskana-web
|
||||
language: node_js
|
||||
node_js: $NODE_VERSION
|
||||
install: skip
|
||||
env: MODULE=WEB
|
||||
script: ci/compile.sh "$MODULE"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Compile
|
||||
name: taskana-common + taskana-lib
|
||||
install: skip
|
||||
env: MODULE=LIB
|
||||
script: ci/compile.sh COMMON && ci/compile.sh "$MODULE"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Compile
|
||||
name: taskana-rest
|
||||
install: skip
|
||||
env: MODULE=REST
|
||||
script: ci/compile.sh "$MODULE"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Compile
|
||||
name: taskana-history
|
||||
install: skip
|
||||
env: MODULE=HISTORY
|
||||
script: ci/compile.sh "$MODULE"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Test
|
||||
install: skip
|
||||
env: DB=POSTGRES_10
|
||||
script: ci/test.sh "$DB"
|
||||
&& ./mvnw -q install -f history -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
&& export JAVA_HOME=/usr/local/lib/jvm/openjdk8
|
||||
&& ci/test.sh WILDFLY
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Test
|
||||
before_script: nvm install $NODE_VERSION
|
||||
install: skip
|
||||
env: DB=WEB
|
||||
script: ci/test.sh "$DB"
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
|
||||
- stage: Release / Deploy
|
||||
name: release / deploy / commit
|
||||
# This is necessary in order to fix some gpg issues (for signing the artifacts which will be released)
|
||||
# More details: https://discuss.circleci.com/t/error-sending-to-agent-inappropriate-ioctl-for-device/17465/7
|
||||
before_install: |
|
||||
echo use-agent >> ~/.gnupg/gpg.conf \
|
||||
&& echo pinentry-mode loopback >> ~/.gnupg/gpg.conf \
|
||||
&& echo allow-loopback-pinentry >> ~/.gnupg/gpg-agent.conf \
|
||||
&& echo RELOADAGENT | gpg-connect-agent \
|
||||
&& openssl aes-256-cbc -K "$encrypted_21a5d40e43a3_key" -iv "$encrypted_21a5d40e43a3_iv" \
|
||||
-in "ci/codesigning.asc.enc" -out "ci/codesigning.asc" -d \
|
||||
&& gpg --batch --no-tty --yes --import "ci/codesigning.asc" \
|
||||
&& nvm install "$NODE_VERSION"
|
||||
install: ci/change_version.sh -m .
|
||||
&& ( cd web && npm install )
|
||||
&& ( cd web && npm run build:prod-silent )
|
||||
&& ./mvnw -q install -B -T 2C -pl :taskana-rest-spring-example-boot,:taskana-cdi -am -DskipTests -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
&& ./mvnw -q prepare-package -B -T 2C -pl :taskana-rest-spring
|
||||
&& ./mvnw -q install -B -T 2C -f history -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip
|
||||
&& ./mvnw -q install -B -T 2C -pl :taskana-rest-spring-example-boot -P history.plugin -DskipTests -Dcheckstyle.skip
|
||||
before_script: ci/verify_docs_jar.sh
|
||||
script: |
|
||||
./mvnw deploy -B -T 2C -P `[[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` \
|
||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip \
|
||||
-pl :taskana-parent,\
|
||||
:taskana-common-parent,:taskana-common,:taskana-common-data,:taskana-common-test,\
|
||||
:taskana-lib-parent,:taskana-core,:taskana-cdi,:taskana-spring,\
|
||||
:taskana-rest-parent,:taskana-web,:taskana-rest-spring,\
|
||||
:taskana-history-parent,:taskana-simplehistory-provider,:taskana-simplehistory-rest-spring,:taskana-loghistory-provider
|
||||
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
|
||||
# travis_terminate is necessary since after_success is a job phase which can change the build result.
|
||||
# it is not documented, so this is a little hack. see: https://docs.travis-ci.com/user/job-lifecycle/#breaking-the-build
|
||||
after_success: ci/change_version.sh -i -m .
|
||||
&& ci/update_taskana_dependency_for_wildfly.sh
|
||||
&& ci/commitPoms.sh || travis_terminate 1
|
||||
deploy:
|
||||
provider: cloudfoundry
|
||||
username: $BLUEMIX_ACCOUNT
|
||||
password: $BLUEMIX_ACCOUNT_PASSWORD
|
||||
api: https://api.ng.bluemix.net
|
||||
organization: "NovaTec Consulting GmbH"
|
||||
space: Taskana
|
||||
on:
|
||||
all_branches: true
|
||||
# travis_terminate is necessary since after_deploy is a job phase which can change the build result.
|
||||
# it is not documented, so this is a little hack. see: https://docs.travis-ci.com/user/job-lifecycle/#breaking-the-build
|
||||
after_deploy: ci/verify_docs_alive.sh || travis_terminate 1
|
|
@ -8,7 +8,7 @@ set -e #fail fast
|
|||
#H
|
||||
#H %FILE% <-m modules...> [-i]
|
||||
#H
|
||||
#H if a release version exists (extracted from TRAVIS_TAG)
|
||||
#H if a release version exists (extracted from GITHUB_REF)
|
||||
#H the maven versions of all modules will be changed to the given release version.
|
||||
#H
|
||||
#H module:
|
||||
|
@ -17,9 +17,9 @@ set -e #fail fast
|
|||
#H increments version
|
||||
#H
|
||||
#H Environment variables:
|
||||
#H - TRAVIS_TAG
|
||||
#H if this is a tagged build then TRAVIS_TAG contains the version number.
|
||||
#H pattern: v[DIGIT].[DIGIT].[DIGIT]
|
||||
#H - GITHUB_REF
|
||||
#H if this is a tagged build then GITHUB_REF contains the version number.
|
||||
#H pattern: refs/tags/v[DIGIT].[DIGIT].[DIGIT]
|
||||
# Arguments:
|
||||
# $1: exit code
|
||||
function helpAndExit() {
|
||||
|
@ -81,8 +81,8 @@ function main() {
|
|||
helpAndExit 1
|
||||
fi
|
||||
|
||||
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
version=$([[ -n "$INCREMENT" ]] && echo $(increment_version "${TRAVIS_TAG##v}")-SNAPSHOT || echo "${TRAVIS_TAG##v}")
|
||||
if [[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
version=$([[ -n "$INCREMENT" ]] && echo $(increment_version "${GITHUB_REF##refs/tags/v}")-SNAPSHOT || echo "${GITHUB_REF##refs/tags/v}")
|
||||
for dir in ${MODULES[@]}; do
|
||||
change_version "$dir" "$version"
|
||||
done
|
||||
|
|
Binary file not shown.
|
@ -12,12 +12,9 @@ set -e # fail fast
|
|||
#H
|
||||
#H Requirements:
|
||||
#H current commit is a HEAD commit
|
||||
#H GH_TOKEN - github access token
|
||||
#H GH_USER - username for the github access token
|
||||
#H GH_USERNAME - github username / displayname (for git config)
|
||||
#H GH_EMAIL - github email address (for git config)
|
||||
#H TRAVIS_TAG (format v[0-9]+\.[0-9]+\.[0-9]+)
|
||||
#H TRAVIS_REPO_SLUG - repo name (in form: owner_name/repo_name)
|
||||
#H GITHUB_REF (format refs/tags/v[0-9]+\.[0-9]+\.[0-9]+)
|
||||
# Arguments:
|
||||
# $1: exit code
|
||||
function helpAndExit() {
|
||||
|
@ -41,26 +38,26 @@ function increment_version() {
|
|||
|
||||
function main() {
|
||||
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||
[[ -z "$GH_USER" || -z "$GH_TOKEN" || -z "$GH_EMAIL" || -z "$GH_USERNAME" || -z "$TRAVIS_REPO_SLUG" ]] && helpAndExit 1
|
||||
if [[ "$TRAVIS_TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||
[[ -z "$GH_EMAIL" || -z "$GH_USERNAME" ]] && helpAndExit 1
|
||||
if [[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
#check if tagged commit is a head commit of any branch
|
||||
commit=$(git ls-remote -q -t origin | grep "$TRAVIS_TAG" | cut -c1-40)
|
||||
commit=$(git ls-remote -q -t origin | grep "$GITHUB_REF" | cut -c1-40)
|
||||
branch=$(git ls-remote -q -h origin | grep "$commit" | sed "s/$commit.*refs\/heads\///")
|
||||
|
||||
if [[ -z "$commit" || -z "$branch" ]]; then
|
||||
echo "the commit '$commit' of tag '$TRAVIS_TAG' is not a head commit. Can not release" >&2
|
||||
echo "the commit '$commit' of tag '${GITHUB_REF##refs/tags/}' is not a head commit. Can not release" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ $(echo "$branch" | wc -l) != '1' ]]; then
|
||||
echo "can not match commit '$commit' to a unique branch." >&2
|
||||
echo "Please make sure, that the tag '$TRAVIS_TAG' is the head of a unique branch" >&2
|
||||
echo "Please make sure, that the tag '${GITHUB_REF##refs/tags/}' is the head of a unique branch" >&2
|
||||
echo "Branches detected: $branch"
|
||||
exit 1
|
||||
fi
|
||||
set -x
|
||||
git config --global user.email $GH_EMAIL
|
||||
git config --global user.name $GH_USERNAME
|
||||
git config --global user.email "$GH_EMAIL"
|
||||
git config --global user.name "$GH_USERNAME"
|
||||
|
||||
#commit all poms
|
||||
git checkout "$branch"
|
||||
|
@ -68,11 +65,8 @@ function main() {
|
|||
for file in "$@"; do
|
||||
[[ -n "$file" ]] && git add "$file"
|
||||
done
|
||||
git commit -m "Updated poms to version $(increment_version ${TRAVIS_TAG##v})-SNAPSHOT"
|
||||
|
||||
#push poms (authentication via GH_TOKEN)
|
||||
git remote add deployment "https://$GH_USER:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
|
||||
git push --quiet --set-upstream deployment "$branch"
|
||||
git commit -m "Updated poms to version $(increment_version ${GITHUB_REF##refs/tags/v})-SNAPSHOT"
|
||||
git push
|
||||
else
|
||||
echo "Nothing to push - this is not a release!"
|
||||
fi
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e # fail fast
|
||||
#H Usage:
|
||||
#H %FILE% -h | %FILE% --help
|
||||
#H
|
||||
#H prints this help and exits
|
||||
#H
|
||||
#H %FILE% <module>
|
||||
#H
|
||||
#H compiles the taskana application. Does not package and install artifacts.
|
||||
#H
|
||||
#H module:
|
||||
#H - WEB
|
||||
#H - COMMON
|
||||
#H - LIB
|
||||
#H - REST
|
||||
#H - HISTORY
|
||||
# Arguments:
|
||||
# $1: exit code
|
||||
function helpAndExit() {
|
||||
cat "$0" | grep "^#H" | cut -c4- | sed -e "s/%FILE%/$(basename "$0")/g"
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
function main() {
|
||||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||
REL=$(dirname "$0")
|
||||
case "$1" in
|
||||
WEB)
|
||||
set -x
|
||||
(cd $REL/../web && npm install --silent)
|
||||
(cd $REL/../web && npm run lint)
|
||||
(cd $REL/../web && npm run build)
|
||||
;;
|
||||
COMMON)
|
||||
set -x
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip -N
|
||||
$REL/../mvnw -q test-compile -B -T 2C -f $REL/../common
|
||||
;;
|
||||
LIB)
|
||||
set -x
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-core -am -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip
|
||||
$REL/../mvnw -q test-compile -B -T 2C -f $REL/../lib
|
||||
;;
|
||||
REST)
|
||||
set -x
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-simplehistory-rest-spring -am -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip -Dasciidoctor.skip
|
||||
$REL/../mvnw -q test-compile -B -T 2C -f $REL/../rest
|
||||
;;
|
||||
HISTORY)
|
||||
set -x
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-rest-spring -am -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip -Dasciidoctor.skip
|
||||
$REL/../mvnw -q test-compile -B -T 2C -f $REL/../history
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
|
@ -0,0 +1,89 @@
|
|||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>taskana-sonar-test-coverage</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.groupId}:${project.artifactId}</name>
|
||||
<description>This pom aggregates the jacoco reports for each module</description>
|
||||
|
||||
<parent>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-parent</artifactId>
|
||||
<version>4.3.1-SNAPSHOT</version>
|
||||
<relativePath>../../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-common-data</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-core</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-cdi</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
<artifactId>taskana-rest-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-simplehistory-provider</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-simplehistory-rest-spring</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pro.taskana.history</groupId>
|
||||
<artifactId>taskana-loghistory-provider</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>${version.jacoco}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>report-aggregate</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>report-aggregate</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
94
ci/test.sh
94
ci/test.sh
|
@ -1,94 +0,0 @@
|
|||
#!/bin/bash
|
||||
set -e # fail fast
|
||||
|
||||
#H Usage:
|
||||
#H test.sh -h | test.sh --help
|
||||
#H
|
||||
#H prints this help and exits
|
||||
#H
|
||||
#H test.sh <database|module> [sonar project key]
|
||||
#H
|
||||
#H tests the taskana application. See documentation for further testing details.
|
||||
#H
|
||||
#H database:
|
||||
#H - H2
|
||||
#H - DB2_11_1
|
||||
#H - POSTGRES_10
|
||||
#H module:
|
||||
#H - HISTORY
|
||||
#H - WILDFLY
|
||||
#H sonar project key:
|
||||
#H the key of the sonarqube project where the coverage will be sent to.
|
||||
#H If empty nothing will be sent
|
||||
# Arguments:
|
||||
# $1: exit code
|
||||
function helpAndExit() {
|
||||
cat "$0" | grep "^#H" | cut -c4-
|
||||
exit "$1"
|
||||
}
|
||||
|
||||
function main() {
|
||||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||
REL=$(dirname "$0")
|
||||
case "$1" in
|
||||
H2)
|
||||
set -x
|
||||
eval "$REL/prepare_db.sh '$1'"
|
||||
# We can not use the fancy '-f' maven option due to a bug in arquillian. See https://issues.jboss.org/browse/THORN-2049
|
||||
(cd $REL/.. && ./mvnw -q install -B -T 2C -Pcoverage -Dcheckstyle.skip)
|
||||
eval "$REL/verify_docs_jar.sh"
|
||||
# disabling sonarqube for PRs because it's not supported yet. See https://jira.sonarsource.com/browse/MMF-1371
|
||||
if [ -n "$2" ]; then
|
||||
# -Pcoverage to activate jacoco and test coverage reports
|
||||
# send test coverage and build information to sonarcloud
|
||||
$REL/../mvnw -q sonar:sonar -B -T 2C -f $REL/.. -Pcoverage -Dsonar.projectKey="$2"
|
||||
fi
|
||||
;;
|
||||
DB2_11_1)
|
||||
set -x
|
||||
eval "$REL/prepare_db.sh '$1'"
|
||||
$REL/../mvnw -q verify -B -T 2C -f $REL/.. -pl :taskana-core -am -Dmaven.javadoc.skip -Dcheckstyle.skip
|
||||
;;
|
||||
POSTGRES_10)
|
||||
set -x
|
||||
eval "$REL/prepare_db.sh '$1'"
|
||||
### INSTALL ###
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-rest-spring-example-common -am -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
|
||||
### TEST ###
|
||||
$REL/../mvnw -q verify -B -T 2C -f $REL/.. -pl :taskana-core -Dmaven.javadoc.skip -Dcheckstyle.skip
|
||||
;;
|
||||
WILDFLY)
|
||||
set -x
|
||||
eval "$REL/prepare_db.sh 'POSTGRES_10'"
|
||||
# Same as above (H2) we can not use the fancy '-f' maven option
|
||||
(cd $REL/../rest/taskana-rest-spring-example-wildfly && ../../mvnw -q verify -B -T 2C -Ddb.type=postgres)
|
||||
;;
|
||||
HISTORY)
|
||||
set -x
|
||||
### INSTALL ###
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-rest-spring -am -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
|
||||
### TEST ###
|
||||
$REL/../mvnw -q verify -B -T 2C -f $REL/../history -Dmaven.javadoc.skip -Dcheckstyle.skip
|
||||
;;
|
||||
WEB)
|
||||
set -x
|
||||
### INSTALL ###
|
||||
|
||||
(cd $REL/../web && npm install --silent && npm run build:prod-silent)
|
||||
$REL/../mvnw -q install -B -T 2C -f $REL/.. -pl :taskana-rest-spring-example-boot -am -P history.plugin -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -Dasciidoctor.skip
|
||||
$REL/../mvnw spring-boot:run -P history.plugin -f $REL/../rest/taskana-rest-spring-example-boot > /dev/null &
|
||||
|
||||
### TEST ###
|
||||
(cd $REL/../web && npm run test -- --coverageReporters text-summary)
|
||||
### TEMP REMOVE CYPRESS TESTS ###
|
||||
### (cd $REL/../web && npm run e2e -- --config-file ../ci/cypress.json) ###
|
||||
|
||||
### CLEANUP ###
|
||||
jobs -p | xargs -rn10 kill
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
main "$@"
|
|
@ -8,7 +8,7 @@ set -e #fail fast
|
|||
#H
|
||||
#H %FILE%
|
||||
#H
|
||||
#H if a release version exists (extracted from TRAVIS_TAG environment variable)
|
||||
#H if a release version exists (extracted from GITHUB_REF environment variable)
|
||||
#H the taskana dependency in our wildfly example project will be incremented to the new version snapshot.
|
||||
#H
|
||||
# Arguments:
|
||||
|
@ -34,14 +34,16 @@ function increment_version() {
|
|||
|
||||
function main() {
|
||||
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
if [[ "$GITHUB_REF" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
REL=$(dirname "$0")
|
||||
FILES=(
|
||||
$REL/../rest/taskana-rest-spring-example-wildfly/pom.xml
|
||||
)
|
||||
for file in ${FILES[@]}; do
|
||||
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT/$(increment_version "${TRAVIS_TAG##v}")-SNAPSHOT/g" $file
|
||||
sed -i "s/[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT/$(increment_version "${GITHUB_REF##refs/tags/v}")-SNAPSHOT/g" $file
|
||||
done
|
||||
else
|
||||
echo "skipped version change for wildfly because this is not a release build"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
@ -18,5 +18,7 @@ set -x
|
|||
verifyDocs "$REL/../lib/taskana-core/target/apidocs" "/static/docs/java/taskana-core"
|
||||
verifyDocs "$REL/../lib/taskana-cdi/target/apidocs" "/static/docs/java/taskana-cdi"
|
||||
verifyDocs "$REL/../lib/taskana-spring/target/apidocs" "/static/docs/java/taskana-spring"
|
||||
test -n "$(jar -tf $JAR_FILE_LOCATION | grep /static/docs/rest/rest-api.html)"
|
||||
test -n "$(jar -tf $JAR_FILE_LOCATION | grep /static/docs/rest/simplehistory-rest-api.html)"
|
||||
set +x
|
||||
echo "the jar file '$JAR_FILE_LOCATION' contains all javadoc"
|
||||
echo "the jar file '$JAR_FILE_LOCATION' contains documentation"
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>generate-javadoc-json</id>
|
||||
<phase>compile</phase>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>javadoc-no-fork</goal>
|
||||
</goals>
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
/.apt_generated/
|
||||
/target/
|
||||
.checkstyle
|
|
@ -1,6 +1,6 @@
|
|||
# Configuration file for Cloud Foundry, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
|
||||
applications:
|
||||
- name: taskana-rest
|
||||
- name: taskana-rest-spring-example-boot
|
||||
path: rest/taskana-rest-spring-example-boot/target/taskana-rest-spring-example-boot.jar
|
||||
buildpacks:
|
||||
- https://github.com/cloudfoundry/java-buildpack.git
|
||||
|
|
77
pom.xml
77
pom.xml
|
@ -17,6 +17,7 @@
|
|||
<module>rest</module>
|
||||
<!-- History is an optional module. -->
|
||||
<module>history</module>
|
||||
<module>ci/taskana-sonar-test-coverage</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
@ -41,6 +42,7 @@
|
|||
<version.maven.asciidoctor>2.1.0</version.maven.asciidoctor>
|
||||
<version.maven.clean>3.1.0</version.maven.clean>
|
||||
<version.maven.dependency>3.1.2</version.maven.dependency>
|
||||
<version.maven.sonar>3.7.0.1746</version.maven.sonar>
|
||||
|
||||
<!-- release dependencies -->
|
||||
<version.maven.gpg>1.6</version.maven.gpg>
|
||||
|
@ -73,8 +75,19 @@
|
|||
|
||||
<!-- database driver versions -->
|
||||
<version.db2>11.1.1.1</version.db2>
|
||||
<!-- used by jacoco to collect coverage -->
|
||||
<argLine></argLine>
|
||||
|
||||
<!-- sonar settings -->
|
||||
<sonar.projectKey>${env.SONAR_PROJECT_KEY}</sonar.projectKey>
|
||||
<sonar.organization>${env.SONAR_ORGANIZATION}</sonar.organization>
|
||||
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
|
||||
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
|
||||
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
|
||||
<sonar.coverage.jacoco.xmlReportPaths>
|
||||
${project.basedir}/ci/coverage/target/site/jacoco-aggregate/jacoco.xml,
|
||||
${project.basedir}/ci/../coverage/target/site/jacoco-aggregate/jacoco.xml,
|
||||
${project.basedir}/ci/../../coverage/target/site/jacoco-aggregate/jacoco.xml
|
||||
</sonar.coverage.jacoco.xmlReportPaths>
|
||||
<sonar.sources>src/main/java</sonar.sources>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -139,6 +152,13 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- The pinentry-mode loopback is necessary to specify and use a passphrase with a gpg key -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
|
@ -177,6 +197,13 @@
|
|||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- The pinentry-mode loopback is necessary to specify and use a passphrase with a gpg key -->
|
||||
<gpgArguments>
|
||||
<arg>--pinentry-mode</arg>
|
||||
<arg>loopback</arg>
|
||||
</gpgArguments>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
|
@ -198,42 +225,18 @@
|
|||
</repository>
|
||||
</distributionManagement>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>eclipse</id>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.eclipse.m2e</groupId>
|
||||
<artifactId>lifecycle-mapping</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<configuration>
|
||||
<lifecycleMappingMetadata>
|
||||
<pluginExecutions>
|
||||
<pluginExecution>
|
||||
<pluginExecutionFilter>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-checkstyle-plugin</artifactId>
|
||||
<versionRange>[1.0.0,)</versionRange>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
</pluginExecutionFilter>
|
||||
<action>
|
||||
<ignore/>
|
||||
</action>
|
||||
</pluginExecution>
|
||||
</pluginExecutions>
|
||||
</lifecycleMappingMetadata>
|
||||
</configuration>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>${version.maven.sonar}</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>coverage</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
|
@ -241,20 +244,13 @@
|
|||
<version>${version.jacoco}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- This plugin appends version information into the jar, so
|
||||
that it can be extracted from the jar. See TSK-837 for more information -->
|
||||
<plugin>
|
||||
|
@ -313,9 +309,6 @@
|
|||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>${version.maven.surefire}</version>
|
||||
<configuration>
|
||||
<argLine>${argLine}</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<sonar.sources>src/main/java,src/main/resources/templates</sonar.sources>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>pro.taskana</groupId>
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
<executions>
|
||||
<execution>
|
||||
<id>generate-javadoc-json</id>
|
||||
<phase>compile</phase>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>javadoc-no-fork</goal>
|
||||
</goals>
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
sonar.sources=src/main/java,src/main/resources/templates
|
||||
sonar.java.coveragePlugin=jacoco
|
||||
sonar.jacoco.reportPath=**/jacoco.*
|
||||
sonar.dynamicAnalysis=reuseReports
|
|
@ -13,6 +13,11 @@
|
|||
<version>4.3.1-SNAPSHOT</version>
|
||||
<relativePath>../rest/pom.xml</relativePath>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<sonar.skip>true</sonar.skip>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
|
Loading…
Reference in New Issue