From d773869779423a0156f6ede2fbea24bb26a8831d Mon Sep 17 00:00:00 2001 From: Mustapha Zorgati <15628173+mustaphazorgati@users.noreply.github.com> Date: Tue, 5 Jan 2021 15:33:09 +0100 Subject: [PATCH] TSK-1497: introduced GitHub Actions --- .github/workflows/continuous-integration.yml | 453 ++++++++++++++++++ .travis.yml | 143 ------ ci/change_version.sh | 12 +- ci/codesigning.asc.enc | Bin 9664 -> 0 bytes ci/commitPoms.sh | 26 +- ci/compile.sh | 58 --- ci/taskana-sonar-test-coverage/pom.xml | 89 ++++ ci/test.sh | 94 ---- ci/update_taskana_dependency_for_wildfly.sh | 8 +- ci/verify_docs_jar.sh | 4 +- .../taskana-simplehistory-rest-spring/pom.xml | 2 +- lib/taskana-cdi/.gitignore | 3 - manifest.yml | 2 +- pom.xml | 109 ++--- .../pom.xml | 4 + rest/taskana-rest-spring/pom.xml | 2 +- sonar-project.properties | 4 - web/pom.xml | 5 + 18 files changed, 629 insertions(+), 389 deletions(-) create mode 100644 .github/workflows/continuous-integration.yml delete mode 100644 .travis.yml delete mode 100644 ci/codesigning.asc.enc delete mode 100755 ci/compile.sh create mode 100644 ci/taskana-sonar-test-coverage/pom.xml delete mode 100755 ci/test.sh delete mode 100644 lib/taskana-cdi/.gitignore delete mode 100644 sonar-project.properties diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 000000000..e9406519d --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -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 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 26f3661dd..000000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/ci/change_version.sh b/ci/change_version.sh index afa73778a..73bf9f28c 100755 --- a/ci/change_version.sh +++ b/ci/change_version.sh @@ -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 diff --git a/ci/codesigning.asc.enc b/ci/codesigning.asc.enc deleted file mode 100644 index e724bc02ad6638ea7a1f532e70fec6a5f8e3e3a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9664 zcmV;xB|qBz=;wn}mpXzs%=_-pxS|HOSRU$Q%=(QTKWn**PeQcfh4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y`zWcAdR9|*9?xc^6_b!$7Ze1~dFE}&XHKEHNlo=leosDsq!TPtTlQJ(`gyE9 zfGdA4_ChA{2w5xuC1Ykrh_5*m7Lkp;4tq4TfyN z%8vrkeOP;(R0v=gu;+8;jQ1TIrAWS|WWY;5t9Q!nG~nO{xOP~ft|bOHhBby7kKNVH z(5I4%R1cE-*oUZ%FHR6dkut4^F%SD5vT?WdPe%#uNzRc1_XTs21a^~$1ABMMa1=hd zyfC=X2Smr5I{-~sfnxPYp06bISswFJe`Wkj&=Q~UrXfu&8qJYEP<4c;GB6>kSm1ElhJDW0byOHdv}&)LKlSlA7Z zLlHrhG*&i8Gt}g|YFQ{>>o(pQd-5A+BVeVX9KRCMsZ#t=P+7pf5yno)!)X$AI7z#= zTO1Dx29?J7mtiD=2&MH0yF?fb3Gp)bW#iP9E#4@QYl-oOU~NfflggELwuJ$CIA|>} z3Pvd_pXm6e`RjB`dg7a>+fZyEB?RUuuIADu#wqoDnGv&?0o7KL^Dx1&I%YbLeKCRH z0PMx%oX#;+v-fOE&|jFFsj>;Qc4}_x(Yly#Yz0+yw5=keI(epTJK5TvQsBNg$6pE;J(f9Qpfe-9Y}<(r-Jw^TXHLoyEt%eJU*6NrW3m;rgB<7A_>8`zu%R{y_QQg~R7!0Tpwld)Q zF;BaQI!uan<=MrUlo_7oK0(hpaN(R~&e^0;#CJSHoA zTJw>!KTA^lQGeF@yOtd;1dGO)jMnTS^FcClf*Ugf@{cIf`v1EGJWHq-&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 diff --git a/ci/compile.sh b/ci/compile.sh deleted file mode 100755 index 898d04468..000000000 --- a/ci/compile.sh +++ /dev/null @@ -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% -#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 "$@" diff --git a/ci/taskana-sonar-test-coverage/pom.xml b/ci/taskana-sonar-test-coverage/pom.xml new file mode 100644 index 000000000..0b0cd0935 --- /dev/null +++ b/ci/taskana-sonar-test-coverage/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + taskana-sonar-test-coverage + pom + + ${project.groupId}:${project.artifactId} + This pom aggregates the jacoco reports for each module + + + pro.taskana + taskana-parent + 4.3.1-SNAPSHOT + ../../pom.xml + + + + + pro.taskana + taskana-common + ${project.version} + + + pro.taskana + taskana-common-data + ${project.version} + + + + pro.taskana + taskana-core + ${project.version} + + + pro.taskana + taskana-cdi + ${project.version} + + + pro.taskana + taskana-spring + ${project.version} + + + + + pro.taskana + taskana-rest-spring + ${project.version} + + + + + pro.taskana.history + taskana-simplehistory-provider + ${project.version} + + + pro.taskana.history + taskana-simplehistory-rest-spring + ${project.version} + + + pro.taskana.history + taskana-loghistory-provider + ${project.version} + + + + + + + org.jacoco + jacoco-maven-plugin + ${version.jacoco} + + + report-aggregate + verify + + report-aggregate + + + + + + + diff --git a/ci/test.sh b/ci/test.sh deleted file mode 100755 index 5fd4e0b48..000000000 --- a/ci/test.sh +++ /dev/null @@ -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 [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 "$@" diff --git a/ci/update_taskana_dependency_for_wildfly.sh b/ci/update_taskana_dependency_for_wildfly.sh index cc192fdb5..3423a5d4b 100755 --- a/ci/update_taskana_dependency_for_wildfly.sh +++ b/ci/update_taskana_dependency_for_wildfly.sh @@ -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 } diff --git a/ci/verify_docs_jar.sh b/ci/verify_docs_jar.sh index 97cfbe3ed..32731fd88 100755 --- a/ci/verify_docs_jar.sh +++ b/ci/verify_docs_jar.sh @@ -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" diff --git a/history/taskana-simplehistory-rest-spring/pom.xml b/history/taskana-simplehistory-rest-spring/pom.xml index 309b41cf9..2ec34bf61 100644 --- a/history/taskana-simplehistory-rest-spring/pom.xml +++ b/history/taskana-simplehistory-rest-spring/pom.xml @@ -180,7 +180,7 @@ generate-javadoc-json - compile + validate javadoc-no-fork diff --git a/lib/taskana-cdi/.gitignore b/lib/taskana-cdi/.gitignore deleted file mode 100644 index 6dec5d949..000000000 --- a/lib/taskana-cdi/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/.apt_generated/ -/target/ -.checkstyle diff --git a/manifest.yml b/manifest.yml index c3201d916..af8e98f82 100644 --- a/manifest.yml +++ b/manifest.yml @@ -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 diff --git a/pom.xml b/pom.xml index 2a75f0e5e..dcbea8acf 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,7 @@ rest history + ci/taskana-sonar-test-coverage @@ -41,6 +42,7 @@ 2.1.0 3.1.0 3.1.2 + 3.7.0.1746 1.6 @@ -73,8 +75,19 @@ 11.1.1.1 - - + + + ${env.SONAR_PROJECT_KEY} + ${env.SONAR_ORGANIZATION} + ${project.artifactId} + https://sonarcloud.io + jacoco + + ${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 + + src/main/java @@ -139,6 +152,13 @@ + + + + --pinentry-mode + loopback + + org.sonatype.plugins @@ -177,6 +197,13 @@ + + + + --pinentry-mode + loopback + + org.sonatype.plugins @@ -198,63 +225,32 @@ - - eclipse - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - [1.0.0,) - - check - - - - - - - - - - - - - - - - coverage - - - - org.jacoco - jacoco-maven-plugin - ${version.jacoco} - - - - prepare-agent - report - - - - - - - + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${version.maven.sonar} + + + + + org.jacoco + jacoco-maven-plugin + ${version.jacoco} + + + prepare-agent + + prepare-agent + + + + @@ -313,9 +309,6 @@ org.apache.maven.plugins maven-surefire-plugin ${version.maven.surefire} - - ${argLine} - org.apache.maven.plugins diff --git a/rest/taskana-rest-spring-example-common/pom.xml b/rest/taskana-rest-spring-example-common/pom.xml index fbb63d266..552b6ded4 100644 --- a/rest/taskana-rest-spring-example-common/pom.xml +++ b/rest/taskana-rest-spring-example-common/pom.xml @@ -15,6 +15,10 @@ ../pom.xml + + src/main/java,src/main/resources/templates + + pro.taskana diff --git a/rest/taskana-rest-spring/pom.xml b/rest/taskana-rest-spring/pom.xml index 771865de4..290498a96 100644 --- a/rest/taskana-rest-spring/pom.xml +++ b/rest/taskana-rest-spring/pom.xml @@ -180,7 +180,7 @@ generate-javadoc-json - compile + validate javadoc-no-fork diff --git a/sonar-project.properties b/sonar-project.properties deleted file mode 100644 index 5b9f64990..000000000 --- a/sonar-project.properties +++ /dev/null @@ -1,4 +0,0 @@ -sonar.sources=src/main/java,src/main/resources/templates -sonar.java.coveragePlugin=jacoco -sonar.jacoco.reportPath=**/jacoco.* -sonar.dynamicAnalysis=reuseReports diff --git a/web/pom.xml b/web/pom.xml index 4e3edddf6..9a217798e 100644 --- a/web/pom.xml +++ b/web/pom.xml @@ -13,6 +13,11 @@ 4.3.1-SNAPSHOT ../rest/pom.xml + + + true + +