TSK-925: integrated taskana-history in the build

This commit is contained in:
Mustapha Zorgati 2019-10-22 23:55:10 +02:00
parent 1518cfc298
commit 16aa628602
3 changed files with 53 additions and 17 deletions

View File

@ -30,6 +30,7 @@ env:
- DB=DB2_10_5
- DB=DB2_11_1
- DB=POSTGRES_10_4
- DB=HISTORY
stage: Test
install: skip
@ -38,6 +39,9 @@ before_cache: rm -rf $HOME/.m2/repository/pro/taskana
matrix:
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
@ -61,12 +65,19 @@ matrix:
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"
install: ci/change_version.sh -m .
install: ci/change_version.sh -m ". history"
&& ( cd web && npm install )
&& ( cd web && npm run build:prod )
&& mvn -q install -T 4C -am -DskipTests -DmFaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-rest-spring-test
@ -75,9 +86,12 @@ matrix:
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,!:taskana-rest-spring-wildfly-example
!:taskana-rest-spring-example,!:taskana-rest-spring-wildfly-example \
&& mvn deploy -f history --settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip \
-P `[[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` \
-pl !:taskana-simplehistory-spring-test,!:taskana-simplehistory-rest-spring-example
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh
after_success: ci/change_version.sh -i -m ". history" && ci/commitPoms.sh
deploy:
provider: cloudfoundry
username: $BLUEMIX_ACCOUNT

View File

@ -1,8 +1,7 @@
#!/bin/bash
set -e # fail fast
#H Usage:
#H compile.sh -h | test.sh --help
#H compile.sh -h | compile.sh --help
#H
#H prints this help and exits
#H
@ -26,18 +25,24 @@ function main() {
REL=$(dirname "$0")
case "$1" in
WEB)
set -x
(cd $REL/../web && npm install --silent)
(cd $REL/../web && npm run build)
;;
LIB)
mvn -q install -N -Dcheckstyle.skip -f $REL/..
mvn -q compile -f $REL/../lib
set -x
mvn -q install -B -f $REL/.. -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip -N
mvn -q compile -B -f $REL/../lib
;;
REST)
mvn -q install -N -Dcheckstyle.skip
mvn -q install -f lib -N -Dcheckstyle.skip
mvn -q install -f lib/taskana-core -DskipTests -Dmaven.javadoc.skip
mvn -q install -f lib/taskana-spring -DskipTests -Dmaven.javadoc.skip
set -x
mvn -q install -B -f $REL/.. -pl :taskana-spring -am -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip
mvn -q compile -B -f $REL/../rest
;;
HISTORY)
set -x
mvn -q install -B -f $REL/.. -pl :taskana-rest-spring -am -DskipTests -Dcheckstyle.skip -Dmaven.javadoc.skip
mvn -q compile -B -f $REL/../history
;;
esac
}

View File

@ -6,7 +6,7 @@ set -e # fail fast
#H
#H prints this help and exits
#H
#H test.sh <database>
#H test.sh <database|module>
#H
#H tests the taskana application. See documentation for further testing details.
#H
@ -15,6 +15,8 @@ set -e # fail fast
#H - DB2_10_5
#H - DB2_11_1
#H - POSTGRES_10_4
#H module:
#H - HISTORY
# Arguments:
# $1: exit code
function helpAndExit() {
@ -25,22 +27,37 @@ function helpAndExit() {
function main() {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
REL=$(dirname "$0")
eval "$REL/prepare_db.sh '$1'"
case "$1" in
H2)
set -x
eval "$REL/prepare_db.sh '$1'"
# We can not use the fance '-f' maven option due to a bug in arquillian. See https://issues.jboss.org/browse/THORN-2049
(cd $REL/.. && mvn -q install -B -T 4C -am -Dmaven.javadoc.skip -Dcheckstyle.skip)
(cd $REL/../web && npm install --silent && npm run test)
;;
DB2_10_5 | DB2_11_1)
(cd $REL/.. && mvn -q verify -B -am -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core)
set -x
eval "$REL/prepare_db.sh '$1'"
mvn -q verify -B -f $REL/.. -am -T 4C -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core
;;
POSTGRES_10_4)
set -x
eval "$REL/prepare_db.sh '$1'"
### INSTALL ###
(cd $REL/.. && mvn -q install -B -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -P postgres -am -T 4C -pl :taskana-rest-spring-wildfly-example)
mvn -q install -B -f $REL/.. -P postgres -am -T 4C -pl :taskana-rest-spring-wildfly-example -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip
### TEST ###
(cd $REL/.. && mvn -q verify -B -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core)
(cd $REL/../rest/taskana-rest-spring-wildfly-example && mvn -q verify -B -P postgres -Dmaven.javadoc.skip -Dcheckstyle.skip)
mvn -q verify -B -f $REL/.. -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core
# Same as above (H2) we can not use the fancy '-f' maven option
(cd $REL/.. && mvn -q verify -B -pl :taskana-rest-spring-wildfly-example -P postgres -Dmaven.javadoc.skip -Dcheckstyle.skip)
;;
HISTORY)
set -x
### INSTALL ###
mvn -q install -B -f $REL/.. -am -T 4C -pl :taskana-rest-spring -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip
### TEST ###
mvn -q verify -B -f $REL/../history -Dmaven.javadoc.skip -Dcheckstyle.skip
;;
esac
}