Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
TSK-747 Remove properties from parent to prevent errors on deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelMartinRojas authored and holgerhagen committed Feb 27, 2019
1 parent b490a2c commit c3b02a2
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
include:
- stage: Build
script:
- mvn clean install -q -f lib -Dmaven.javadoc.skip=true
- ci/build.sh lib/ $TRAVIS_TAG
- stage: Release
script:
- ci/release.sh lib/taskana-simplehistory-provider $TRAVIS_TAG
&& ci/release.sh lib/taskana-simplehistory-rest-spring $TRAVIS_TAG
- ci/release.sh lib/taskana-simplehistory-provider lib/ $TRAVIS_TAG
&& ci/release.sh lib/taskana-simplehistory-rest-spring lib/ $TRAVIS_TAG
&& ci/change_version.sh -i -m "lib/"
&& ci/commitPoms.sh
if: repo = env(DEPLOY_REPO) AND (tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ OR branch = master) AND type != pull_request
45 changes: 45 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash
set -e #fail fast

#H Usage:
#H build.sh -h | build.sh --help
#H
#H prints this help and exits
#H
#H build.sh <module>
#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:
#H directory of a maven project
#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'
# Arguments:
# $1: exit code
function helpAndExit {
cat "$0" | grep "^#H" | cut -c4-
exit "$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 main {
[[ "$2" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && change_version "$1" "${2##v}"
mvn clean install -q -f "$1" -Dmaven.javadoc.skip=true
}

main "$@"
8 changes: 6 additions & 2 deletions ci/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@ set -e # fail fast
#H
#H prints this help and exits
#H
#H release.sh <module> [version]
#H release.sh <module> <parentModule> [version]
#H
#H an easy deployment tool to deploy maven projects.
#H
#H module:
#H
#H path to maven project
#H
#H parentModule:
#H
#H path to parent maven project
#H
#H version:
#H
#H new version for the <module>.
Expand Down Expand Up @@ -70,7 +74,7 @@ function change_version {

function main {
[[ $# -eq 0 || "$1" == '-h' || "$1" == '--help' ]] && helpAndExit 0
[[ "$2" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && change_version "$1" "${2##v}"
[[ "$3" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && change_version "$2" "${3##v}"
decodeAndImportKeys `dirname "$0"`
release "$1" `[[ "$2" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` "`dirname "$0"`/mvnsettings.xml"
}
Expand Down

0 comments on commit c3b02a2

Please sign in to comment.