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
This commit is contained in:
Mustapha Zorgati 2018-02-28 09:45:11 +01:00 committed by Holger Hagen
parent e872c39340
commit 54c9b538f8
4 changed files with 207 additions and 25 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -6,10 +6,32 @@
<groupId>pro.taskana</groupId>
<artifactId>taskana-rest-spring</artifactId>
<version>0.0.8-SNAPSHOT</version>
<packaging>jar</packaging>
<name>rest</name>
<description>Demo project for Spring Boot</description>
<name>${project.groupId}:${project.artifactId}</name>
<description>The taskana rest logic.</description>
<url>http://taskana.pro</url>
<licenses>
<license>
<name>The Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
<developer>
<name>Holger Hagen</name>
<email>holger.hagen@novatec-gmbh.de</email>
<organization>NovaTec Consulting GmbH</organization>
<organizationUrl>https://www.novatec-gmbh.de</organizationUrl>
</developer>
</developers>
<scm>
<connection>scm:git:git://github.com/taskana/taskana.git</connection>
<developerConnection>scm:git:ssh://github.com:taskana/taskana.git</developerConnection>
<url>http://github.com/taskana/taskana/tree/master</url>
</scm>
<parent>
<groupId>org.springframework.boot</groupId>
@ -24,6 +46,85 @@
<java.version>1.8</java.version>
</properties>
<profiles>
<profile>
<id>snapshot</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>
<distributionManagement>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
@ -80,6 +181,65 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>../../qa/checkstyle/checkstyle.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<showWarnings>true</showWarnings>
<compilerArgs>
<arg>-Xlint:all</arg>
</compilerArgs>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.2.1</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>