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:
parent
f68e730a72
commit
17885d227a
117
.travis.yml
117
.travis.yml
|
|
@ -1,84 +1,83 @@
|
||||||
|
dist: xenial
|
||||||
|
|
||||||
language: java
|
language: java
|
||||||
|
|
||||||
jdk:
|
jdk:
|
||||||
- oraclejdk8
|
- openjdk8
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- 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:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
- $HOME/.m2
|
- $HOME/.m2
|
||||||
- web/node_modules
|
- web/node_modules
|
||||||
- web/dist
|
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- Build
|
- Compile
|
||||||
- Test
|
- Test
|
||||||
- "Release / Deploy"
|
- "Release / Deploy"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- FORCE_DEPLOY=false
|
|
||||||
- NODE_VERSION=12.10.0
|
|
||||||
- DEPLOY_REPO=Taskana/taskana
|
- 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:
|
matrix:
|
||||||
- DB=H2 PROJECT=REST
|
- DB=H2
|
||||||
- DB=H2 PROJECT=LIB
|
- DB=DB2_10_5
|
||||||
- DB=DB2_10_5 PROJECT=CORE
|
- DB=DB2_11_1
|
||||||
- DB=DB2_11_1 PROJECT=CORE
|
- DB=POSTGRES_10_4
|
||||||
- DB=POSTGRES_10_4 PROJECT=CORE
|
|
||||||
- DB=POSTGRES_10_4 PROJECT=WILDFLY
|
|
||||||
|
|
||||||
install: mvn dependency:resolve
|
|
||||||
|
|
||||||
stage: Test
|
stage: Test
|
||||||
script:
|
install: skip
|
||||||
- "export DISPLAY=:99.0"
|
script: ci/test.sh $DB
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
|
||||||
- sleep 3 # give xvfb some time to start
|
|
||||||
- nvm install $NODE_VERSION
|
|
||||||
&& ci/change_version.sh -m .
|
|
||||||
&& ci/test.sh $DB $PROJECT
|
|
||||||
|
|
||||||
jobs:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- stage: Build
|
- stage: Compile
|
||||||
install:
|
name: taskana-web
|
||||||
- nvm install $NODE_VERSION
|
language: node_js
|
||||||
&& (cd web && npm install && npm rebuild node-sass)
|
node_js: 12.10.0
|
||||||
&& ci/change_version.sh -m .
|
install: skip
|
||||||
script:
|
env: MODULE=WEB
|
||||||
- (cd web && npm run build:prod)
|
script: ci/compile.sh $MODULE
|
||||||
&& mvn clean install -q -DskipTests -Dmaven.javadoc.skip -P history.plugin
|
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"
|
- stage: "Release / Deploy"
|
||||||
name: "Release stage"
|
install: ci/change_version.sh -m .
|
||||||
script:
|
&& ( cd web && npm install )
|
||||||
- ci/release.sh . $TRAVIS_TAG
|
&& ( cd web && npm run build:prod )
|
||||||
&& mvn install -q -DskipTests
|
&& mvn -q install -T 4C -am -DskipTests -DmFaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-rest-spring-test
|
||||||
&& mvn prepare-package -q -f ./rest/taskana-rest-spring-test
|
&& mvn -q prepare-package -pl :taskana-rest-spring-test
|
||||||
&& ci/release.sh lib $TRAVIS_TAG
|
&& mvn -q install -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-rest-spring-example
|
||||||
&& ci/release.sh lib/taskana-core $TRAVIS_TAG
|
env: RELEASE_PROFILE=$([[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot")
|
||||||
&& ci/release.sh lib/taskana-spring $TRAVIS_TAG
|
name: release / deploy / commit
|
||||||
&& ci/release.sh lib/taskana-cdi $TRAVIS_TAG
|
# decoding gpg key and importing it. Gpg key is necessary to sign artifacts for release.
|
||||||
&& ci/release.sh web $TRAVIS_TAG
|
before_script: |
|
||||||
&& ci/release.sh rest $TRAVIS_TAG
|
openssl aes-256-cbc -K "$encrypted_21a5d40e43a3_key" -iv "$encrypted_21a5d40e43a3_iv"
|
||||||
&& ci/release.sh rest/taskana-rest-spring $TRAVIS_TAG
|
-in "ci/codesigning.asc.enc" -out "ci/codesigning.asc" -d && gpg --import "ci/codesigning.asc"
|
||||||
&& ci/release.sh rest/taskana-rest-spring-base $TRAVIS_TAG
|
script: |
|
||||||
if: repo = env(DEPLOY_REPO) AND (tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ OR branch = master) AND type != pull_request
|
mvn deploy -P "$RELEASE_PROFILE" --settings ci/mvnsettings.xml
|
||||||
- stage: "Release / Deploy"
|
-pl \!taskana-cdi-example,\!taskana-spring-example,\!taskana-rest-spring-test,\!taskana-rest-spring-example,
|
||||||
name: "Update Pom's stage"
|
\!taskana-rest-spring-wildfly-example -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip
|
||||||
script:
|
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh
|
||||||
- ci/change_version.sh -i -m .
|
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
|
||||||
&& 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
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: cloudfoundry
|
provider: cloudfoundry
|
||||||
username: $BLUEMIX_ACCOUNT
|
username: $BLUEMIX_ACCOUNT
|
||||||
|
|
@ -88,4 +87,4 @@ jobs:
|
||||||
space: Taskana
|
space: Taskana
|
||||||
on:
|
on:
|
||||||
all_branches: true
|
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
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ set -e #fail fast
|
||||||
#H pattern: v[DIGIT].[DIGIT].[DIGIT]
|
#H pattern: v[DIGIT].[DIGIT].[DIGIT]
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exitcode
|
# $1: exitcode
|
||||||
function helpAndExit {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4-
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
@ -36,36 +36,36 @@ function helpAndExit {
|
||||||
function increment_version() {
|
function increment_version() {
|
||||||
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||||
echo "'$1' does not match tag pattern." >&2
|
echo "'$1' does not match tag pattern." >&2
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${1%\.*}.`expr ${1##*\.*\.} + 1`"
|
echo "${1%\.*}.$(expr ${1##*\.*\.} + 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# changing version in pom and all its children
|
# changing version in pom and all its children
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: directory of pom
|
# $1: directory of pom
|
||||||
# $2: new version
|
# $2: new version
|
||||||
function change_version {
|
function change_version() {
|
||||||
mvn versions:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* versions:commit
|
mvn -q versions:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* versions:commit
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main() {
|
||||||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||||
|
|
||||||
while [[ $# -gt 0 ]]; do
|
while [[ $# -gt 0 ]]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
-i)
|
-i)
|
||||||
INCREMENT="true"
|
INCREMENT="true"
|
||||||
shift # past argument
|
shift # passed argument
|
||||||
;;
|
;;
|
||||||
-m|--modules)
|
-m | --modules)
|
||||||
if [[ -z "$2" || "$2" == -* ]]; then
|
if [[ -z "$2" || "$2" == -* ]]; then
|
||||||
echo "missing parameter for argument '-m|--modules'" >&2
|
echo "missing parameter for argument '-m|--modules'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
MODULES=($2)
|
MODULES=($2)
|
||||||
shift # past argument
|
shift # passed argument
|
||||||
shift # past value
|
shift # passed value
|
||||||
;;
|
;;
|
||||||
*) # unknown option
|
*) # unknown option
|
||||||
echo "unknown parameter $1" >&2
|
echo "unknown parameter $1" >&2
|
||||||
|
|
@ -80,7 +80,7 @@ function main {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
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
|
for dir in ${MODULES[@]}; do
|
||||||
change_version "$dir" "$version"
|
change_version "$dir" "$version"
|
||||||
done
|
done
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ set -e # fail fast
|
||||||
#H TRAVIS_REPO_SLUG - repo name (in form: owner_name/repo_name)
|
#H TRAVIS_REPO_SLUG - repo name (in form: owner_name/repo_name)
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4-
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
@ -32,31 +32,34 @@ function helpAndExit {
|
||||||
function increment_version() {
|
function increment_version() {
|
||||||
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
if [[ ! "$1" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||||
echo "'$1' does not match tag pattern." >&2
|
echo "'$1' does not match tag pattern." >&2
|
||||||
exit 1;
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "${1%\.*}.`expr ${1##*\.*\.} + 1`"
|
echo "${1%\.*}.$(expr ${1##*\.*\.} + 1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main() {
|
||||||
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
[[ "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||||
[[ -z "$GH_USER" || -z "$GH_TOKEN" || -z "$TRAVIS_REPO_SLUG" ]] && helpAndExit 1
|
[[ -z "$GH_USER" || -z "$GH_TOKEN" || -z "$TRAVIS_REPO_SLUG" ]] && helpAndExit 1
|
||||||
if [[ "$TRAVIS_TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
if [[ "$TRAVIS_TAG" =~ v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
||||||
#check if tagged commit is a head commit of any branch
|
#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 "$TRAVIS_TAG" | cut -c1-40)
|
||||||
branch=`git ls-remote -q -h origin | grep "$commit" | sed "s/$commit.*refs\/heads\///"`
|
branch=$(git ls-remote -q -h origin | grep "$commit" | sed "s/$commit.*refs\/heads\///")
|
||||||
|
|
||||||
if [[ -z "$commit" || -z "$branch" ]]; then
|
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 '$TRAVIS_TAG' is not a head commit. Can not release" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ `echo "$branch" | wc -l` != '1' ]]; then
|
if [[ $(echo "$branch" | wc -l) != '1' ]]; then
|
||||||
echo "can not match commit '$commit' to a unique branch." >&2
|
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 '$TRAVIS_TAG' is the head of a unique branch" >&2
|
||||||
echo "Branches detected: $branch"
|
echo "Branches detected: $branch"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git config --global user.email $GH_EMAIL
|
||||||
|
git config --global user.name $GH_USERNAME
|
||||||
|
|
||||||
#commit all poms
|
#commit all poms
|
||||||
git checkout -b "$branch"
|
git checkout -b "$branch"
|
||||||
#to compensate new updates
|
#to compensate new updates
|
||||||
|
|
@ -65,7 +68,7 @@ function main {
|
||||||
for file in "$@"; do
|
for file in "$@"; do
|
||||||
[[ -n "$file" ]] && git add "$file"
|
[[ -n "$file" ]] && git add "$file"
|
||||||
done
|
done
|
||||||
git commit -m "Updated poms to version `increment_version ${TRAVIS_TAG##v}`-SNAPSHOT"
|
git commit -m "Updated poms to version $(increment_version ${TRAVIS_TAG##v})-SNAPSHOT"
|
||||||
|
|
||||||
#push poms (authentication via GH_TOKEN)
|
#push poms (authentication via GH_TOKEN)
|
||||||
git remote add deployment "https://$GH_USER:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
|
git remote add deployment "https://$GH_USER:$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG.git"
|
||||||
|
|
|
||||||
|
|
@ -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 "$@"
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -17,12 +17,12 @@ set -e #fail fast
|
||||||
#H - POSTGRES_10_4
|
#H - POSTGRES_10_4
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4-
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main() {
|
||||||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||||
propFile="$HOME/taskanaUnitTest.properties"
|
propFile="$HOME/taskanaUnitTest.properties"
|
||||||
|
|
||||||
|
|
@ -33,50 +33,51 @@ function main {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
DB2_10_5)
|
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$ -f status=running) ]]; then
|
||||||
if [[ -z `docker ps -aq -f name=^/taskana-db2_10_5$` ]]; 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
|
docker run -d -p 50100:50000 --name taskana-db2_10_5 taskana/db2:10.5 -d
|
||||||
else
|
else
|
||||||
docker start taskana-db2_10_5
|
docker start taskana-db2_10_5
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
|
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' >$propFile
|
||||||
echo 'jdbcUrl=jdbc:db2://localhost:50100/tskdb' >> $propFile
|
echo 'jdbcUrl=jdbc:db2://localhost:50100/tskdb' >>$propFile
|
||||||
echo 'dbUserName=db2inst1' >> $propFile
|
echo 'dbUserName=db2inst1' >>$propFile
|
||||||
echo 'dbPassword=db2inst1-pwd' >> $propFile
|
echo 'dbPassword=db2inst1-pwd' >>$propFile
|
||||||
echo 'schemaName=TASKANA' >> $propFile
|
echo 'schemaName=TASKANA' >>$propFile
|
||||||
;;
|
;;
|
||||||
DB2_11_1)
|
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$ -f status=running) ]]; then
|
||||||
if [[ -z `docker ps -aq -f name=^/taskana-db2_11_1$` ]]; 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
|
docker run -d -p 50101:50000 --name taskana-db2_11_1 taskana/db2:11.1 -d
|
||||||
else
|
else
|
||||||
docker start taskana-db2_11_1
|
docker start taskana-db2_11_1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' > $propFile
|
echo 'jdbcDriver=com.ibm.db2.jcc.DB2Driver' >$propFile
|
||||||
echo 'jdbcUrl=jdbc:db2://localhost:50101/tskdb' >> $propFile
|
echo 'jdbcUrl=jdbc:db2://localhost:50101/tskdb' >>$propFile
|
||||||
echo 'dbUserName=db2inst1' >> $propFile
|
echo 'dbUserName=db2inst1' >>$propFile
|
||||||
echo 'dbPassword=db2inst1-pwd' >> $propFile
|
echo 'dbPassword=db2inst1-pwd' >>$propFile
|
||||||
echo 'schemaName=TASKANA' >> $propFile
|
echo 'schemaName=TASKANA' >>$propFile
|
||||||
;;
|
;;
|
||||||
POSTGRES_10_4)
|
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$ -f status=running) ]]; then
|
||||||
if [[ -z `docker ps -aq -f name=^/taskana-postgres_10_4$` ]]; 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
|
docker run -d -p 50102:5432 --name taskana-postgres_10_4 -e POSTGRES_PASSWORD=postgres postgres:10.4
|
||||||
else
|
else
|
||||||
docker start taskana-postgres_10_4
|
docker start taskana-postgres_10_4
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo 'jdbcDriver=org.postgresql.Driver' > $propFile
|
echo 'jdbcDriver=org.postgresql.Driver' >$propFile
|
||||||
echo 'jdbcUrl=jdbc:postgresql://localhost:50102/postgres' >> $propFile
|
echo 'jdbcUrl=jdbc:postgresql://localhost:50102/postgres' >>$propFile
|
||||||
echo 'dbUserName=postgres' >> $propFile
|
echo 'dbUserName=postgres' >>$propFile
|
||||||
echo 'dbPassword=postgres' >> $propFile
|
echo 'dbPassword=postgres' >>$propFile
|
||||||
echo 'schemaName=taskana' >> $propFile
|
echo 'schemaName=taskana' >>$propFile
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "unknown database '$1'" >&2
|
echo "unknown database '$1'" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
docker ps
|
docker ps
|
||||||
|
|
|
||||||
|
|
@ -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 "$@"
|
|
||||||
51
ci/test.sh
51
ci/test.sh
|
|
@ -6,52 +6,43 @@ set -e # fail fast
|
||||||
#H
|
#H
|
||||||
#H prints this help and exits
|
#H prints this help and exits
|
||||||
#H
|
#H
|
||||||
#H test.sh <database> <project>
|
#H test.sh <database>
|
||||||
#H
|
#H
|
||||||
#H tests the taskana application
|
#H tests the taskana application. See documentation for further testing details.
|
||||||
#H
|
#H
|
||||||
#H database:
|
#H database:
|
||||||
#H - H2
|
#H - H2
|
||||||
#H - DB2_10_5
|
#H - DB2_10_5
|
||||||
#H - DB2_11_1
|
#H - DB2_11_1
|
||||||
#H - POSTGRES_10_4
|
#H - POSTGRES_10_4
|
||||||
#H project:
|
|
||||||
#H - REST
|
|
||||||
#H - WILDFLY
|
|
||||||
#H - CORE
|
|
||||||
#H - LIB
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
# $1: exit code
|
# $1: exit code
|
||||||
function helpAndExit {
|
function helpAndExit() {
|
||||||
cat "$0" | grep "^#H" | cut -c4-
|
cat "$0" | grep "^#H" | cut -c4-
|
||||||
exit "$1"
|
exit "$1"
|
||||||
}
|
}
|
||||||
|
|
||||||
function main {
|
function main() {
|
||||||
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
|
||||||
REL=`dirname "$0"`
|
REL=$(dirname "$0")
|
||||||
eval "$REL/prepare_db.sh '$1'"
|
eval "$REL/prepare_db.sh '$1'"
|
||||||
if [[ "$1" == "H2" && "$2" == "REST" ]]; then
|
case "$1" in
|
||||||
(cd $REL/../web && npm run test)
|
H2)
|
||||||
(cd $REL/../rest/ && mvn install -q -B) #reinstalling rest because rest-doc is built during tests.
|
(cd $REL/.. && mvn -q install -B -T 4C -am -Dmaven.javadoc.skip -Dcheckstyle.skip)
|
||||||
(cd $REL/../rest/ && mvn verify -q -B -pl taskana-rest-spring-example -P history.plugin)
|
(cd $REL/../web && npm install --silent && npm run test)
|
||||||
elif [[ "$1" == "H2" && "$2" == "LIB" ]]; then
|
;;
|
||||||
(cd $REL/.. && mvn install -q -N -B )
|
DB2_10_5 | DB2_11_1)
|
||||||
(cd $REL/../lib/ && mvn install -q -B -Dmaven.javadoc.skip)
|
(cd $REL/.. && mvn -q verify -B -am -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core)
|
||||||
elif [[ "$1" == "POSTGRES_10_4" && "$2" == "CORE" ]]; then
|
;;
|
||||||
(cd $REL/.. && mvn install -q -N -B)
|
POSTGRES_10_4)
|
||||||
(cd $REL/../lib && mvn install -q -N -B)
|
### INSTALL ###
|
||||||
(cd $REL/../lib/taskana-core && mvn verify -q -B)
|
(cd $REL/.. && mvn -q install -B -DskipTests -Dmaven.javadoc.skip -Dcheckstyle.skip -P postgres -am -T 4C -pl :taskana-rest-spring-wildfly-example)
|
||||||
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)
|
### TEST ###
|
||||||
(cd $REL/../rest/ && mvn install -q -B -pl taskana-rest-spring-wildfly-example -Dmaven.javadoc.skip -P postgres)
|
(cd $REL/.. && mvn -q verify -B -Dmaven.javadoc.skip -Dcheckstyle.skip -pl :taskana-core)
|
||||||
else
|
(cd $REL/../rest/taskana-rest-spring-wildfly-example && mvn -q verify -B -P postgres -Dmaven.javadoc.skip -Dcheckstyle.skip)
|
||||||
(cd $REL/../lib/taskana-core && mvn verify -q -B)
|
;;
|
||||||
fi
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Configuration file for Cloud Foundry, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
|
# Configuration file for Cloud Foundry, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
|
||||||
applications:
|
applications:
|
||||||
- name: taskana-rest
|
- name: taskana-rest
|
||||||
path: taskana-rest-spring-example.jar
|
path: rest/taskana-rest-spring-example/target/taskana-rest-spring-example.jar
|
||||||
buildpacks:
|
buildpacks:
|
||||||
- https://github.com/cloudfoundry/java-buildpack.git
|
- https://github.com/cloudfoundry/java-buildpack.git
|
||||||
memory: 640M
|
memory: 640M
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@
|
||||||
</profiles>
|
</profiles>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
"build": " npm run lint && ng build --env=dev ",
|
"build": "ng build",
|
||||||
"build:prod": "npm run lint && ng build --configuration=production",
|
"build:prod": "ng build --prod=true",
|
||||||
"test": "ng test --karma-config karma.conf.js --watch=false --browsers Firefox",
|
"test": "ng test --karma-config karma.conf.js --watch=false --browsers Firefox",
|
||||||
"test:watch": "ng test --karma-config karma.conf.js --browsers Chrome",
|
"test:watch": "ng test --karma-config karma.conf.js --browsers Chrome",
|
||||||
"lint": "ng lint"
|
"lint": "ng lint"
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
taskanaRestUrl: '/api',
|
taskanaRestUrl: '/api',
|
||||||
taskanaLogoutUrl: ''
|
taskanaLogoutUrl: '/logout'
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue