TSK-892: Refactored build pipeline in order to increase general speed

Removed caches. Each build step is now independent.
Build stage is now Compile stage with 3 jobs.
Reduced test stage from 6 to 4, so that we use optimal job count (travis runs 4 in parralel).
Reduced release / deploy stage to one job.
TSK-892 made maven less verbose to clean up build log

TSK-892: corrected syntax of weird firefox starting command..

TSK-892: fixed h2 test phase

TSK-892: fixed db2 test phase

TSK-892: removed taskana artifacts from build cache

TSK-892: fixed h2 test

TSK-892: reconfigured travis

TSK-879: added git config to personalise travis pom commit

TSK-879: reformatted bash scripts in ci folder

TSK-879: fixed prod configuration for web
This commit is contained in:
Mustapha Zorgati 2019-10-07 10:44:42 +02:00 committed by Dennis Lehmann
parent f68e730a72
commit 17885d227a
12 changed files with 253 additions and 300 deletions

View File

@ -1,84 +1,83 @@
dist: xenial
language: java
jdk:
- oraclejdk8
- openjdk8
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
- web/dist
stages:
- Build
- Compile
- Test
- "Release / Deploy"
env:
global:
- FORCE_DEPLOY=false
- NODE_VERSION=12.10.0
- DEPLOY_REPO=Taskana/taskana
- VERSION=v`mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec -f ./lib`
matrix:
- DB=H2 PROJECT=REST
- DB=H2 PROJECT=LIB
- DB=DB2_10_5 PROJECT=CORE
- DB=DB2_11_1 PROJECT=CORE
- DB=POSTGRES_10_4 PROJECT=CORE
- DB=POSTGRES_10_4 PROJECT=WILDFLY
install: mvn dependency:resolve
- DB=H2
- DB=DB2_10_5
- DB=DB2_11_1
- DB=POSTGRES_10_4
stage: Test
script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
- nvm install $NODE_VERSION
&& ci/change_version.sh -m .
&& ci/test.sh $DB $PROJECT
install: skip
script: ci/test.sh $DB
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
jobs:
matrix:
include:
- stage: Build
install:
- nvm install $NODE_VERSION
&& (cd web && npm install && npm rebuild node-sass)
&& ci/change_version.sh -m .
script:
- (cd web && npm run build:prod)
&& mvn clean install -q -DskipTests -Dmaven.javadoc.skip -P history.plugin
- stage: Compile
name: taskana-web
language: node_js
node_js: 12.10.0
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: "Release / Deploy"
name: "Release stage"
script:
- ci/release.sh . $TRAVIS_TAG
&& mvn install -q -DskipTests
&& mvn prepare-package -q -f ./rest/taskana-rest-spring-test
&& ci/release.sh lib $TRAVIS_TAG
&& ci/release.sh lib/taskana-core $TRAVIS_TAG
&& ci/release.sh lib/taskana-spring $TRAVIS_TAG
&& ci/release.sh lib/taskana-cdi $TRAVIS_TAG
&& ci/release.sh web $TRAVIS_TAG
&& ci/release.sh rest $TRAVIS_TAG
&& ci/release.sh rest/taskana-rest-spring $TRAVIS_TAG
&& ci/release.sh rest/taskana-rest-spring-base $TRAVIS_TAG
if: repo = env(DEPLOY_REPO) AND (tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ OR branch = master) AND type != pull_request
- stage: "Release / Deploy"
name: "Update Pom's stage"
script:
- ci/change_version.sh -i -m .
&& ci/commitPoms.sh lib/taskana-cdi/src/test/java/pro/taskana/TaskanaProducersTest.java
if: repo = env(DEPLOY_REPO) AND tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$
- stage: "Release / Deploy"
name: "Deploy stage"
script:
- if [[ $FORCE_DEPLOY = true ]];
then ci/copy-rest-spring.sh $VERSION;
else ci/copy-rest-spring.sh $TRAVIS_TAG;
fi
install: ci/change_version.sh -m .
&& ( 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
&& mvn -q prepare-package -pl :taskana-rest-spring-test
&& mvn -q install -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-rest-spring-example
env: RELEASE_PROFILE=$([[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot")
name: release / deploy / commit
# decoding gpg key and importing it. Gpg key is necessary to sign artifacts for release.
before_script: |
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"
script: |
mvn deploy -P "$RELEASE_PROFILE" --settings ci/mvnsettings.xml
-pl \!taskana-cdi-example,\!taskana-spring-example,\!taskana-rest-spring-test,\!taskana-rest-spring-example,
\!taskana-rest-spring-wildfly-example -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
deploy:
provider: cloudfoundry
username: $BLUEMIX_ACCOUNT
@ -88,4 +87,4 @@ jobs:
space: Taskana
on:
all_branches: true
if: (repo = env(DEPLOY_REPO) AND tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$) OR (env(FORCE_DEPLOY) = true)
if: repo = env(DEPLOY_REPO) AND (tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ OR branch = master) AND type != pull_request

View File

@ -4,11 +4,11 @@ set -e #fail fast
#H Usage:
#H change_version.sh -h | change_version.sh --help
#H
#H prints this help and exits
#H
#H change_version.sh <-m modules...> [-i]
#H prints this help and exits
#H
#H if a release version exists (extracted from TRAVIS_TAG)
#H change_version.sh <-m modules...> [-i]
#H
#H if a release version exists (extracted from TRAVIS_TAG)
#H the maven versions of all modules will be changed to the given release version.
#H
#H module:
@ -17,18 +17,18 @@ set -e #fail fast
#H increments version
#H
#H Environment variables:
#H - TRAVIS_TAG
#H - TRAVIS_TAG
#H if this is a tagged build then TRAVIS_TAG contains the version number.
#H pattern: v[DIGIT].[DIGIT].[DIGIT]
# Arguments:
# $1: exitcode
function helpAndExit {
function helpAndExit() {
cat "$0" | grep "^#H" | cut -c4-
exit "$1"
}
# takes a version (without leading v) and increments its
# last number by one.
# last number by one.
# Arguments:
# $1: version (without leading v) which will be patched
# Return:
@ -36,41 +36,41 @@ function helpAndExit {
function increment_version() {
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "'$1' does not match tag pattern." >&2
exit 1;
exit 1
fi
echo "${1%\.*}.`expr ${1##*\.*\.} + 1`"
echo "${1%\.*}.$(expr ${1##*\.*\.} + 1)"
}
# changing version in pom and all its children
# Arguments:
# $1: directory of pom
# $2: new version
function change_version {
mvn versions:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* versions:commit
function change_version() {
mvn -q versions:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* versions:commit
}
function main {
function main() {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
while [[ $# -gt 0 ]]; do
case $1 in
-i)
INCREMENT="true"
shift # past argument
;;
-m|--modules)
if [[ -z "$2" || "$2" == -* ]]; then
echo "missing parameter for argument '-m|--modules'" >&2
exit 1
fi
MODULES=($2)
shift # past argument
shift # past value
;;
*) # unknown option
echo "unknown parameter $1" >&2
-i)
INCREMENT="true"
shift # passed argument
;;
-m | --modules)
if [[ -z "$2" || "$2" == -* ]]; then
echo "missing parameter for argument '-m|--modules'" >&2
exit 1
;;
fi
MODULES=($2)
shift # passed argument
shift # passed value
;;
*) # unknown option
echo "unknown parameter $1" >&2
exit 1
;;
esac
done
@ -80,7 +80,7 @@ function main {
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}"`
version=$([[ -n "$INCREMENT" ]] && echo $(increment_version "${TRAVIS_TAG##v}")-SNAPSHOT || echo "${TRAVIS_TAG##v}")
for dir in ${MODULES[@]}; do
change_version "$dir" "$version"
done

View File

@ -18,13 +18,13 @@ set -e # fail fast
#H TRAVIS_REPO_SLUG - repo name (in form: owner_name/repo_name)
# Arguments:
# $1: exit code
function helpAndExit {
function helpAndExit() {
cat "$0" | grep "^#H" | cut -c4-
exit "$1"
}
# takes a version (without leading v) and increments its
# last number by one.
# last number by one.
# Arguments:
# $1: version (without leading v) which will be patched
# Return:
@ -32,48 +32,51 @@ function helpAndExit {
function increment_version() {
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo "'$1' does not match tag pattern." >&2
exit 1;
exit 1
fi
echo "${1%\.*}.`expr ${1##*\.*\.} + 1`"
echo "${1%\.*}.$(expr ${1##*\.*\.} + 1)"
}
function main {
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
[[ -z "$GH_USER" || -z "$GH_TOKEN" || -z "$TRAVIS_REPO_SLUG" ]] && helpAndExit 1
if [[ "$TRAVIS_TAG" =~ 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`
branch=`git ls-remote -q -h origin | grep "$commit" | sed "s/$commit.*refs\/heads\///"`
function main() {
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
[[ -z "$GH_USER" || -z "$GH_TOKEN" || -z "$TRAVIS_REPO_SLUG" ]] && helpAndExit 1
if [[ "$TRAVIS_TAG" =~ 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)
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
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 "Branches detected: $branch"
exit 1
fi
#commit all poms
git checkout -b "$branch"
#to compensate new updates
git pull
git add "./*pom.xml"
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"
else
echo "Nothing to push - this is not a release!"
if [[ -z "$commit" || -z "$branch" ]]; then
echo "the commit '$commit' of tag '$TRAVIS_TAG' 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 "Branches detected: $branch"
exit 1
fi
git config --global user.email $GH_EMAIL
git config --global user.name $GH_USERNAME
#commit all poms
git checkout -b "$branch"
#to compensate new updates
git pull
git add "./*pom.xml"
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"
else
echo "Nothing to push - this is not a release!"
fi
}
main "$@"

45
ci/compile.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
set -e # fail fast
#H Usage:
#H compile.sh -h | test.sh --help
#H
#H prints this help and exits
#H
#H compile.sh <module>
#H
#H compiles the taskana application. Does not package and install artifacts.
#H
#H module:
#H - WEB
#H - LIB
#H - REST
# 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
WEB)
(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
;;
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
;;
esac
}
main "$@"

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -e # fail fast
if [[ ! "$1" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-SNAPSHOT)?$ ]]; then
echo "missing tag" >&2
exit 1
fi
cp ~/.m2/repository/pro/taskana/taskana-rest-spring-example/${1##v}/taskana-rest-spring-example-${1##v}.jar taskana-rest-spring-example.jar

View File

@ -17,66 +17,67 @@ set -e #fail fast
#H - POSTGRES_10_4
# Arguments:
# $1: exit code
function helpAndExit {
function helpAndExit() {
cat "$0" | grep "^#H" | cut -c4-
exit "$1"
}
function main {
function main() {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
propFile="$HOME/taskanaUnitTest.properties"
case "$1" in
H2)
if [[ -f "$propFile" ]]; then
rm "$propFile"
propFile="$HOME/taskanaUnitTest.properties"
case "$1" in
H2)
if [[ -f "$propFile" ]]; then
rm "$propFile"
fi
;;
DB2_10_5)
if [[ -z $(docker ps -aq -f name=^/taskana-db2_10_5$ -f status=running) ]]; then
if [[ -z $(docker ps -aq -f name=^/taskana-db2_10_5$) ]]; then
docker run -d -p 50100:50000 --name taskana-db2_10_5 taskana/db2:10.5 -d
else
docker start taskana-db2_10_5
fi
;;
DB2_10_5)
if [[ -z `docker ps -aq -f name=^/taskana-db2_10_5$ -f status=running` ]]; then
if [[ -z `docker ps -aq -f name=^/taskana-db2_10_5$` ]]; then
docker run -d -p 50100:50000 --name taskana-db2_10_5 taskana/db2:10.5 -d
else
docker start taskana-db2_10_5
fi
fi
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' >$propFile
echo 'jdbcUrl=jdbc:db2://localhost:50100/tskdb' >>$propFile
echo 'dbUserName=db2inst1' >>$propFile
echo 'dbPassword=db2inst1-pwd' >>$propFile
echo 'schemaName=TASKANA' >>$propFile
;;
DB2_11_1)
if [[ -z $(docker ps -aq -f name=^/taskana-db2_11_1$ -f status=running) ]]; then
if [[ -z $(docker ps -aq -f name=^/taskana-db2_11_1$) ]]; then
docker run -d -p 50101:50000 --name taskana-db2_11_1 taskana/db2:11.1 -d
else
docker start taskana-db2_11_1
fi
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
echo 'jdbcUrl=jdbc:db2://localhost:50100/tskdb' >> $propFile
echo 'dbUserName=db2inst1' >> $propFile
echo 'dbPassword=db2inst1-pwd' >> $propFile
echo 'schemaName=TASKANA' >> $propFile
;;
DB2_11_1)
if [[ -z `docker ps -aq -f name=^/taskana-db2_11_1$ -f status=running` ]]; then
if [[ -z `docker ps -aq -f name=^/taskana-db2_11_1$` ]]; then
docker run -d -p 50101:50000 --name taskana-db2_11_1 taskana/db2:11.1 -d
else
docker start taskana-db2_11_1
fi
fi
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' >$propFile
echo 'jdbcUrl=jdbc:db2://localhost:50101/tskdb' >>$propFile
echo 'dbUserName=db2inst1' >>$propFile
echo 'dbPassword=db2inst1-pwd' >>$propFile
echo 'schemaName=TASKANA' >>$propFile
;;
POSTGRES_10_4)
if [[ -z $(docker ps -aq -f name=^/taskana-postgres_10_4$ -f status=running) ]]; then
if [[ -z $(docker ps -aq -f name=^/taskana-postgres_10_4$) ]]; then
docker run -d -p 50102:5432 --name taskana-postgres_10_4 -e POSTGRES_PASSWORD=postgres postgres:10.4
else
docker start taskana-postgres_10_4
fi
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
echo 'jdbcUrl=jdbc:db2://localhost:50101/tskdb' >> $propFile
echo 'dbUserName=db2inst1' >> $propFile
echo 'dbPassword=db2inst1-pwd' >> $propFile
echo 'schemaName=TASKANA' >> $propFile
;;
POSTGRES_10_4)
if [[ -z `docker ps -aq -f name=^/taskana-postgres_10_4$ -f status=running` ]]; then
if [[ -z `docker ps -aq -f name=^/taskana-postgres_10_4$` ]]; then
docker run -d -p 50102:5432 --name taskana-postgres_10_4 -e POSTGRES_PASSWORD=postgres postgres:10.4
else
docker start taskana-postgres_10_4
fi
fi
echo 'jdbcDriver=org.postgresql.Driver' > $propFile
echo 'jdbcUrl=jdbc:postgresql://localhost:50102/postgres' >> $propFile
echo 'dbUserName=postgres' >> $propFile
echo 'dbPassword=postgres' >> $propFile
echo 'schemaName=taskana' >> $propFile
;;
*)
echo "unknown database '$1'" >&2
exit 1
fi
echo 'jdbcDriver=org.postgresql.Driver' >$propFile
echo 'jdbcUrl=jdbc:postgresql://localhost:50102/postgres' >>$propFile
echo 'dbUserName=postgres' >>$propFile
echo 'dbPassword=postgres' >>$propFile
echo 'schemaName=taskana' >>$propFile
;;
*)
echo "unknown database '$1'" >&2
exit 1
;;
esac
docker ps

View File

@ -1,78 +0,0 @@
#!/bin/bash
set -e # fail fast
#H Usage:
#H release.sh -h | release.sh --help
#H
#H prints this help and exits
#H
#H release.sh <module> [version]
#H
#H an easy deployment tool to deploy maven projects.
#H
#H module:
#H
#H path to maven project
#H
#H version:
#H
#H new version for the <module>.
#H format: ^v[0-9]+\.[0-9]+\.[0-9]+$
#H if the format is wrong it will be ignored.
#H
#H requirements:
#H
#H - <module>'s pom file contains the profiles 'release' and 'snapshot'
#H - the files
#H * mvnsettings.xml
#H * codesigning.asc.enc
#H have to exist in the same folder as this script
#H - the environment variables
#H * encrypted_21a5d40e43a3_key
#H * encrypted_21a5d40e43a3_iv
#H have to exist (in order to decode codesigning.asc.enc)
# Arguments:
# $1: exit code
function helpAndExit {
cat "$0" | grep "^#H" | cut -c4-
exit "$1"
}
# decripting gpg keys and importing them (needed to sign artifacts)
# Global:
# $encrypted_21a5d40e43a3_key: decription key
# $encrypted_21a5d40e43a3_iv: initialisation vector
# Arguments:
# $1: basedir
function decodeAndImportKeys {
if [[ ! -f "$1/codesigning.asc" ]]; then
openssl aes-256-cbc -K "$encrypted_21a5d40e43a3_key" -iv "$encrypted_21a5d40e43a3_iv" -in "$1/codesigning.asc.enc" -out "$1/codesigning.asc" -d
gpg --import "$1/codesigning.asc"
fi
}
# deploying a given project
# Arguments:
# $1: project folder (dir)
# $2: profile name
# $3: settings file (dir)
function release {
mvn deploy -f "$1" -P "$2" --settings "$3" -DskipTests=true -B -U -N
}
# changing version in pom and all its children
# Arguments:
# $1: directory of pom
# $2: new version
function change_version {
mvn versions:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* versions:commit
}
function main {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
[[ "$1" == '.' && "$2" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && change_version "$1" "${2##v}"
decodeAndImportKeys `dirname "$0"`
release "$1" `[[ "$2" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` "`dirname "$0"`/mvnsettings.xml"
}
main "$@"

View File

@ -6,52 +6,43 @@ set -e # fail fast
#H
#H prints this help and exits
#H
#H test.sh <database> <project>
#H test.sh <database>
#H
#H tests the taskana application
#H tests the taskana application. See documentation for further testing details.
#H
#H database:
#H - H2
#H - DB2_10_5
#H - DB2_11_1
#H - POSTGRES_10_4
#H project:
#H - REST
#H - WILDFLY
#H - CORE
#H - LIB
# Arguments:
# $1: exit code
function helpAndExit {
function helpAndExit() {
cat "$0" | grep "^#H" | cut -c4-
exit "$1"
}
function main {
function main() {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
REL=`dirname "$0"`
REL=$(dirname "$0")
eval "$REL/prepare_db.sh '$1'"
if [[ "$1" == "H2" && "$2" == "REST" ]]; then
(cd $REL/../web && npm run test)
(cd $REL/../rest/ && mvn install -q -B) #reinstalling rest because rest-doc is built during tests.
(cd $REL/../rest/ && mvn verify -q -B -pl taskana-rest-spring-example -P history.plugin)
elif [[ "$1" == "H2" && "$2" == "LIB" ]]; then
(cd $REL/.. && mvn install -q -N -B )
(cd $REL/../lib/ && mvn install -q -B -Dmaven.javadoc.skip)
elif [[ "$1" == "POSTGRES_10_4" && "$2" == "CORE" ]]; then
(cd $REL/.. && mvn install -q -N -B)
(cd $REL/../lib && mvn install -q -N -B)
(cd $REL/../lib/taskana-core && mvn verify -q -B)
elif [[ "$1" == "POSTGRES_10_4" && "$2" == "WILDFLY" ]]; then
#installing dependencies for rest (since this tests runs in a different cache)
mvn install -q -N
(cd $REL/../lib/ && mvn install -q -B -DskipTests -Dmaven.javadoc.skip)
(cd $REL/../rest/ && mvn install -q -B -DskipTests -pl !taskana-rest-spring-wildfly-example -Dmaven.javadoc.skip)
(cd $REL/../rest/ && mvn install -q -B -pl taskana-rest-spring-wildfly-example -Dmaven.javadoc.skip -P postgres)
else
(cd $REL/../lib/taskana-core && mvn verify -q -B)
fi
case "$1" in
H2)
(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)
;;
POSTGRES_10_4)
### INSTALL ###
(cd $REL/.. && mvn -q install -B -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -P postgres -am -T 4C -pl :taskana-rest-spring-wildfly-example)
### 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)
;;
esac
}
main "$@"

View File

@ -1,7 +1,7 @@
# Configuration file for Cloud Foundry, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
applications:
- name: taskana-rest
path: taskana-rest-spring-example.jar
path: rest/taskana-rest-spring-example/target/taskana-rest-spring-example.jar
buildpacks:
- https://github.com/cloudfoundry/java-buildpack.git
memory: 640M

View File

@ -113,6 +113,7 @@
</profiles>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>

View File

@ -5,8 +5,8 @@
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": " npm run lint && ng build --env=dev ",
"build:prod": "npm run lint && ng build --configuration=production",
"build": "ng build",
"build:prod": "ng build --prod=true",
"test": "ng test --karma-config karma.conf.js --watch=false --browsers Firefox",
"test:watch": "ng test --karma-config karma.conf.js --browsers Chrome",
"lint": "ng lint"

View File

@ -1,5 +1,5 @@
export const environment = {
production: true,
taskanaRestUrl: '/api',
taskanaLogoutUrl: ''
taskanaLogoutUrl: '/logout'
};