TSK-901: replaced deploy stage with single maven call.
This commit is contained in:
parent
8bcde0a40b
commit
e68c9bae1b
17
.travis.yml
17
.travis.yml
|
@ -5,6 +5,9 @@ language: java
|
|||
jdk:
|
||||
- openjdk8
|
||||
|
||||
git:
|
||||
depth: 3
|
||||
|
||||
services:
|
||||
- docker
|
||||
- xvfb # required because our frontend tests currently use firefox as a browser (and thus do not run headless)
|
||||
|
@ -58,19 +61,23 @@ matrix:
|
|||
script: ci/compile.sh $MODULE
|
||||
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
|
||||
|
||||
|
||||
- stage: "Release / Deploy"
|
||||
name: release / deploy / commit
|
||||
before_install: |
|
||||
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"
|
||||
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: DEPLOY_MODULES=". lib lib/taskana-core lib/taskana-cdi lib/taskana-spring web rest rest/taskana-rest-spring rest/taskana-rest-spring rest/taskana-rest-spring-base"
|
||||
name: release / deploy / commit
|
||||
script: for i in $DEPLOY_MODULES; do ci/release.sh $i; done
|
||||
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh
|
||||
script: |
|
||||
mvn deploy -T 4C -P `[[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "release" || echo "snapshot"` \
|
||||
--settings ci/mvnsettings.xml -DskipTests -Dcheckstyle.skip -pl !:taskana-spring-example,!:taskana-cdi-example,\
|
||||
!:taskana-rest-spring-example,!:taskana-rest-spring-wildfly-example
|
||||
before_cache: rm -rf $HOME/.m2/repository/pro/taskana
|
||||
after_success: ci/change_version.sh -i -m . && ci/commitPoms.sh
|
||||
deploy:
|
||||
provider: cloudfoundry
|
||||
username: $BLUEMIX_ACCOUNT
|
||||
|
|
|
@ -1,12 +1,4 @@
|
|||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>${env.OSSRH_JIRA_USERNAME}</username>
|
||||
<password>${env.OSSRH_JIRA_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>ossrh</id>
|
||||
|
@ -18,7 +10,14 @@
|
|||
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
|
||||
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
|
||||
</properties>
|
||||
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<servers>
|
||||
<server>
|
||||
<id>ossrh</id>
|
||||
<username>${env.OSSRH_JIRA_USERNAME}</username>
|
||||
<password>${env.OSSRH_JIRA_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
</settings>
|
|
@ -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 "$@"
|
Loading…
Reference in New Issue