From 54c9b538f8544e48ec5846bfef3437d0bd567938 Mon Sep 17 00:00:00 2001 From: Mustapha Zorgati <15628173+mustaphazorgati@users.noreply.github.com> Date: Wed, 28 Feb 2018 09:45:11 +0100 Subject: [PATCH] TSK-311 now releasing taskana-rest-spring to maven central aswell TSK-311: fixed travis config TSK-311: created import key toggle TSK-311: now only pushing one commit TSK-311: replaced implicit if statements with explicit statements --- .travis.yml | 10 +- lib/deployment/deploy.sh | 55 ++++++---- manifest.yml | 1 + rest/taskana-rest-spring/pom.xml | 166 ++++++++++++++++++++++++++++++- 4 files changed, 207 insertions(+), 25 deletions(-) diff --git a/.travis.yml b/.travis.yml index 41cec9b54..18c1cfe72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,14 +16,16 @@ before_install: - npm install -g @angular/cli >/dev/null 2>&1 install: - (cd workplace && npm install --no-progress && ng build --environment=prod --no-progress) - && (cd admin && npm install --no-progress && npm run build:prod && npm run test-phantom) + && (cd admin && npm install --no-progress && npm run build:prod) && (cd monitor && npm install --no-progress && ng build --environment=prod --no-progress) && mvn clean install -q -f lib/ -DskipTests=true -Dmaven.javadoc.skip=true -B - && mvn clean install -q -f rest/ -DskipTests=true -B + && mvn clean install -q -f rest/ -DskipTests=true -Dmaven.javadoc.skip=true -B script: - - mvn verify -f lib/ + - (cd admin && npm run test-phantom) + && mvn verify -f lib/ && mvn verify -f rest/ - && lib/deployment/deploy.sh -p lib/ -m "lib/taskana-core/ lib/taskana-spring/ lib/taskana-cdi/" -mf manifest.yml -avc rest/ -swarm lib/taskana-cdi/src/test/java/pro/taskana/TaskanaProducersTest.java + && lib/deployment/deploy.sh -ik -p lib/ -m "lib/taskana-core/ lib/taskana-spring/ lib/taskana-cdi/" + && lib/deployment/deploy.sh -pp -p rest/ -m rest/taskana-rest-spring -mf manifest.yml -swarm lib/taskana-cdi/src/test/java/pro/taskana/TaskanaProducersTest.java deploy: provider: cloudfoundry username: tobias.schaefer@novatec-gmbh.de diff --git a/lib/deployment/deploy.sh b/lib/deployment/deploy.sh index 6ab16eab2..cfdec9058 100755 --- a/lib/deployment/deploy.sh +++ b/lib/deployment/deploy.sh @@ -1,10 +1,12 @@ #!/bin/bash set -e #fail fast -reqRepo="Taskana/taskana" -[[ -z "$MANIFEST_PREFIX" ]] && MANIFEST_PREFIX="/rest" +reqRepo="mustaphazorgati/taskana" +if [[ -z "$MANIFEST_PREFIX" ]]; then + MANIFEST_PREFIX="/rest" +fi #H Usage: -#H deploy.sh -h | pfcalc.sh --help +#H deploy.sh -h | deploy.sh --help #H #H prints this help and exits #H @@ -23,14 +25,18 @@ reqRepo="Taskana/taskana" #H -avc | --append-version-change #H List of modules (path) whose version will be updated after deployment. #H -d | --dry-run -#H echos out all commands instead of excecuting them. +#H Echos out all commands instead of executing them. #H -m | --modules #H List of modules (path) which will be deployed. #H -mf | --manifest -#H if a manifest file exists the version of an artifact will be replaced. +#H If a manifest file exists the version of an artifact will be replaced. #H You can Overwrite it by setting the env variable MANIFEST_PREFIX to the required prefix. #H -p | --parent #H If a parent pom exists the version change will be done in the parent instead of every module. +#H -ik | --import-keys +#H Toggles import of gpg keys. +#H -pp | --push-poms +#H Toggles the commit & push of new poms (on release build) #H #H #H IMPORTANT: @@ -158,7 +164,7 @@ function main { echo "missing parameter for argument '-avc|--additional-version-change'" >&2 exit 1 fi - local ADDITIONAL_VC=($2) + ADDITIONAL_VC=($2) shift # past argument shift # past value ;; @@ -174,7 +180,7 @@ function main { echo "missing parameter for argument '-m|--modules'" >&2 exit 1 fi - local MODULES=($2) + MODULES=($2) shift # past argument shift # past value ;; @@ -183,7 +189,7 @@ function main { echo "missing parameter for argument '-mf|--manifest'" >&2 exit 1 fi - local MANIFEST="$2" + MANIFEST="$2" shift # past argument shift # past value ;; @@ -192,12 +198,20 @@ function main { echo "missing parameter for argument '-p|--parent'" >&2 exit 1 fi - local PARENT_DIR="$2" + PARENT_DIR="$2" shift # past argument shift # past value ;; + -pp|--push-poms) + PUSH_POMS="YES" + shift # past argument + ;; + -ik|--import-keys) + IMPORT_KEYS="YES" + shift # past argument + ;; -swarm) - local SWARM="$2" + SWARM="$2" shift # past argument shift # past value ;; @@ -213,7 +227,7 @@ function main { helpAndExit 1 fi - local debug= + debug= if [[ -n "$DRY_RUN" ]]; then debug=echo print_environment @@ -236,12 +250,12 @@ function main { fi if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - local profile="release" + profile="release" if [[ -z "$debug" ]]; then #check if tagged commit is a head commit of any branch - local commit=`git ls-remote -q -t origin | grep "$TRAVIS_TAG" | cut -c1-40` - local branch=`git ls-remote -q -h origin | grep "$commit" | sed "s/$commit.*refs\/heads\///"` + 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 @@ -272,11 +286,14 @@ function main { echo "Skipping release to sonatype because this branch is not permitted" exit 0 fi - local profile="snapshot" + profile="snapshot" fi - decodeAndImportKeys `dirname "$0"` + if [[ "$IMPORT_KEYS" == 'YES' ]]; then + decodeAndImportKeys `dirname "$0"` + fi + for dir in ${MODULES[@]}; do deploy "$dir" "$profile" "`dirname "$0"`/mvnsettings.xml" done @@ -287,7 +304,7 @@ function main { exit 1 fi - local newVersion=`increment_version ${TRAVIS_TAG##v}` + newVersion=`increment_version ${TRAVIS_TAG##v}` if [[ -n "$PARENT_DIR" ]]; then change_version "$PARENT_DIR" "$newVersion-SNAPSHOT" @@ -309,7 +326,9 @@ function main { $debug sed -i "s|$MANIFEST_PREFIX.*\.jar|$MANIFEST_PREFIX-$newVersion-SNAPSHOT.jar|" "$MANIFEST" fi - push_new_poms "$MANIFEST" "$SWARM" + if [[ "$PUSH_POMS" == 'YES' ]]; then + push_new_poms "$MANIFEST" "$SWARM" + fi fi } diff --git a/manifest.yml b/manifest.yml index 6d6047055..4027e6220 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,6 +1,7 @@ # Configuration file for Cloud Foundry, see https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html applications: - name: taskana-rest + #TODO: path path: rest/target/rest-0.0.8-SNAPSHOT.jar buildpack: https://github.com/cloudfoundry/java-buildpack.git#v3.10 memory: 512M diff --git a/rest/taskana-rest-spring/pom.xml b/rest/taskana-rest-spring/pom.xml index afa216b86..fc7143bf9 100644 --- a/rest/taskana-rest-spring/pom.xml +++ b/rest/taskana-rest-spring/pom.xml @@ -6,10 +6,32 @@ pro.taskana taskana-rest-spring 0.0.8-SNAPSHOT - jar - rest - Demo project for Spring Boot + ${project.groupId}:${project.artifactId} + The taskana rest logic. + http://taskana.pro + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + Holger Hagen + holger.hagen@novatec-gmbh.de + NovaTec Consulting GmbH + https://www.novatec-gmbh.de + + + + + scm:git:git://github.com/taskana/taskana.git + scm:git:ssh://github.com:taskana/taskana.git + http://github.com/taskana/taskana/tree/master + org.springframework.boot @@ -24,6 +46,85 @@ 1.8 + + + snapshot + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots + + + + + release + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.8 + true + + ossrh + https://oss.sonatype.org/ + false + + + + + + + ossrh + https://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + org.springframework.boot @@ -80,6 +181,65 @@ org.springframework.boot spring-boot-maven-plugin + + org.apache.maven.plugins + maven-checkstyle-plugin + 2.17 + + + validate + validate + + ../../qa/checkstyle/checkstyle.xml + UTF-8 + true + true + true + true + + + check + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.5.1 + + true + + -Xlint:all + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + + attach-javadocs + + jar + + + +