taskana/.travis.yml

127 lines
4.6 KiB
YAML

os: linux
dist: xenial
language: java
jdk:
- openjdk8
addons:
sonarcloud:
organization: $SONAR_ORGANIZATION
git:
#depth false needed by sonarcloud for deep comparison
depth: false
services:
- docker
- xvfb # required because our frontend tests currently use firefox as a browser (and thus do not run headless)
# see https://docs.travis-ci.com/user/gui-and-headless-browsers/#using-xvfb-to-run-tests-that-require-a-gui for more information
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
- DB=POSTGRES_10
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:
- 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"
# 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-lib
install: skip
env: MODULE=LIB
script: 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-simplehistory
install: skip
env: MODULE=HISTORY
script: ci/compile.sh "$MODULE"
before_cache: rm -rf "$HOME/.m2/repository/pro/taskana"
- stage: Release / Deploy
name: release / deploy / commit
before_install: |
openssl aes-256-cbc -K "$encrypted_21a5d40e43a3_key" -iv "$encrypted_21a5d40e43a3_iv" \
-in "ci/codesigning.asc.enc" -out "ci/codesigning.asc" -d && gpg --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 )
&& mvn -q install -T 4C -am -Dasciidoctor.skip -DskipTests -Dcheckstyle.skip -pl :taskana-rest-spring-example-boot,:taskana-cdi
&& mvn -q prepare-package -pl :taskana-rest-spring
&& mvn -q install -f history -T 4C -am -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-simplehistory-rest-spring-example
&& mvn -q install -P history.plugin -DskipTests -Dcheckstyle.skip -pl :taskana-rest-spring-example-boot
before_script: ci/verify_docs_jar.sh
script: |
mvn deploy -T 4C -P `[[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` \
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -pl !:taskana-spring-example,!:taskana-cdi-example,\
!:taskana-rest-spring-example-boot,!:taskana-rest-spring-example-wildfly,\
!:taskana-simplehistory-rest-spring-example
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/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