From 0062d89aae7208126af5840cc0b129ff78740baa Mon Sep 17 00:00:00 2001 From: Mustapha Zorgati <15628173+mustaphazorgati@users.noreply.github.com> Date: Mon, 30 Apr 2018 11:44:12 +0200 Subject: [PATCH] TSK-456: configured deployment of taskana-web --- .travis.yml | 2 +- lib/deployment/change_version.sh | 60 +++++++++++++++++++----- manifest.yml | 14 +----- web/src/environments/environment.prod.ts | 2 +- 4 files changed, 51 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 496c9ab84..941c2c53e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,7 +12,7 @@ cache: before_install: - nvm install $NODE_VERSION - npm install -g @angular/cli >/dev/null 2>&1 - - lib/deployment/change_version.sh rest/ lib/ web/ + - lib/deployment/change_version.sh -m "rest/ lib/ web/" -swarm lib/taskana-cdi/src/test/java/pro/taskana/TaskanaProducersTest.java install: - (cd web && npm install --no-progress && npm run build:prod) && mvn clean install -q -f lib/ -DskipTests=true -Dmaven.javadoc.skip=true -B diff --git a/lib/deployment/change_version.sh b/lib/deployment/change_version.sh index d101b0b34..44074912e 100755 --- a/lib/deployment/change_version.sh +++ b/lib/deployment/change_version.sh @@ -27,21 +27,57 @@ function helpAndExit { # $1: directory of pom # $2: new version function change_version { - $debug mvn org.codehaus.mojo:versions-maven-plugin:2.5:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* + mvn org.codehaus.mojo:versions-maven-plugin:2.5:set -f "$1" -DnewVersion="$2" -DartifactId=* -DgroupId=* } function main { - if [[ $# -eq 0 || "$1" == "-h" || "$1" == "--help" ]]; then - helpAndExit 0 - fi - if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - while [[ $# -gt 0 ]]; do - change_version "$1" "${TRAVIS_TAG##v}" - shift - done - else - echo "skipped version change because this is not a release build" - fi + if [[ $# -eq 0 || "$1" == "-h" || "$1" == "--help" ]]; then + helpAndExit 0 + fi + + while [[ $# -gt 0 ]]; do + case $1 in + -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 + ;; + -swarm) + if [[ -z "$2" || "$2" == -* ]]; then + echo "missing parameter for argument '-swarm'" >&2 + exit 1 + fi + SWARM="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + echo "unknown parameter $1" >&2 + exit 1 + ;; + esac + done + + if [[ ${#MODULES[@]} -eq 0 ]]; then + echo "Can not perform deployment without any modules" >&2 + helpAndExit 1 + fi + + if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + for dir in ${MODULES[@]}; do + change_version "$dir" "${TRAVIS_TAG##v}" + done + + if [[ -n "$SWARM" ]]; then + sed -i "s/pro.taskana:taskana-core.*-SNAPSHOT/pro.taskana:taskana-core:${TRAVIS_TAG##v}/" "$SWARM" + fi + else + echo "skipped version change because this is not a release build" + fi } main "$@" diff --git a/manifest.yml b/manifest.yml index 2dc3503e9..111ea7eb6 100644 --- a/manifest.yml +++ b/manifest.yml @@ -5,20 +5,8 @@ applications: buildpack: https://github.com/cloudfoundry/java-buildpack.git#v3.10 memory: 512M disk_quota: 256M -- name: taskana-workplace - path: workplace/dist - buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git#v1.3.16 - memory: 16M - disk_quota: 64M -- name: taskana-admin +- name: taskana-web path: web/dist buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git#v1.3.16 memory: 16M disk_quota: 64M -- name: taskana-monitor - path: monitor/dist - buildpack: https://github.com/cloudfoundry/staticfile-buildpack.git#v1.3.16 - memory: 16M - disk_quota: 64M - - diff --git a/web/src/environments/environment.prod.ts b/web/src/environments/environment.prod.ts index c2da7e8e3..6659e7c0d 100644 --- a/web/src/environments/environment.prod.ts +++ b/web/src/environments/environment.prod.ts @@ -1,4 +1,4 @@ export const environment = { production: true, - taskanaRestUrl: 'http://taskana-rest.mybluemix.net' + taskanaRestUrl: 'https://taskana-rest.mybluemix.net' };