Skip to content

Commit

Permalink
Merge pull request #1 from ZhengXinCN/master
Browse files Browse the repository at this point in the history
Travis build added.
  • Loading branch information
lbovet authored Sep 1, 2021
2 parents 99a9f8f + d98a987 commit 3453966
Show file tree
Hide file tree
Showing 10 changed files with 488 additions and 9 deletions.
22 changes: 22 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
language: java
dist: trusty
jdk:
- oraclejdk8
before_install:
- chmod +x maybe-release.sh
# install groovy
- curl -s get.sdkman.io | bash
- source "$HOME/.sdkman/bin/sdkman-init.sh"
- sdk install groovy 3.0.8
- echo $(groovy --version)
install:
- mvn install -Dmaven.javadoc.skip=true -B -V
before_script:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis-CI"
script:
- git config credential.helper "store --file=.git/credentials"
- echo "https://${GH_TOKEN}:@github.com" > .git/credentials
- ./maybe-release.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
2 changes: 1 addition & 1 deletion kobuka-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.0.2</version>
<version>1.0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kobuka-gen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.0.2</version>
<version>1.0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion kobuka-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>kobuka</artifactId>
<groupId>org.swisspush</groupId>
<version>1.0.2</version>
<version>1.0.3-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
42 changes: 42 additions & 0 deletions maybe-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
set -ev
if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_REPO_SLUG" == "swisspush/kobuka" ]
then
git reset --hard
git clean -fd
git checkout master
echo 'Master checked out'
groovy staging.groovy drop
rc=$?
if [ $rc -ne 0 ]
then
echo 'problem when trying to drop, ignored'
fi
echo 'starting a new nexus repository ...'
OUTPUT=$(groovy staging.groovy start)
echo "repository Id: $OUTPUT"
mvn -B -Prelease jgitflow:release-start jgitflow:release-finish --settings settings.xml -DrepositoryId=${OUTPUT}
rc=$?
if [ $rc -eq 0 ]
then
groovy staging.groovy close ${OUTPUT}
groovy staging.groovy promote ${OUTPUT}
rc=$?
if [ $rc -ne 0 ]
then
echo 'Release failed, cannot promote stage'
exit rc
fi
echo 'Release done, will push'
git tag
git push --tags
git checkout develop
git push origin develop
exit 0
fi
echo 'Release failed'
exit rc
else
echo 'Release skipped'
exit 0
fi
186 changes: 180 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,91 @@
<groupId>org.swisspush</groupId>
<artifactId>kobuka</artifactId>
<packaging>pom</packaging>
<version>1.0.2</version>

<version>1.0.3-SNAPSHOT</version>
<name>kobuka</name>
<description>Config Builders for Kafka. A fluent API for configuring kafka clients.</description>
<url>https://github.com/swisspush/kobuka</url>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/swisspush/kobuka.git</url>
</scm>
<developers>
<developer>
<id>laurentbovet</id>
<name>Laurent Bovet</name>
<email>[email protected]</email>
</developer>
</developers>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<mavenExecutorId>forked-path</mavenExecutorId>
<useReleaseProfile>false</useReleaseProfile>
<arguments>${arguments} -Psonatype-oss-release
</arguments>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<homedir>${session.executionRootDirectory}</homedir>
<keyname>230584D7</keyname>
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>external.atlassian.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1</version>
<configuration>
<flowInitContext>
<masterBranchName>master</masterBranchName>
<developBranchName>develop</developBranchName>
<featureBranchPrefix>feature-</featureBranchPrefix>
<releaseBranchPrefix>release-</releaseBranchPrefix>
<hotfixBranchPrefix>hotfix-</hotfixBranchPrefix>
<versionTagPrefix>v</versionTagPrefix>
</flowInitContext>
<pullDevelop>true</pullDevelop>
<username>USERNAME_FOR_A_GIT_USER</username>
<password>PASSWORD_FOR_A_GIT_USER</password>
<!--<noDeploy>true</noDeploy>-->
<allowUntracked>true</allowUntracked>
<autoVersionSubmodules>true</autoVersionSubmodules>
<!--<noReleaseMerge>true</noReleaseMerge>-->
<!--<noReleaseBuild>true</noReleaseBuild>-->
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand Down Expand Up @@ -56,13 +137,106 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonatypeOssDistMgmtSnapshotsUrl>
https://oss.sonatype.org/content/repositories/snapshots/
</sonatypeOssDistMgmtSnapshotsUrl>
</properties>

<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>
https://oss.sonatype.org/content/repositories/snapshots
</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>${sonatypeOssDistMgmtSnapshotsUrl}</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/swisspush/kobuka</url>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>
https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${repositoryId}
</url>
</repository>
</distributionManagement>
</distributionManagement> <profiles>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sonatype-oss-release</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.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>3.0.0-M1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<source>8</source>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<homedir>${session.executionRootDirectory}</homedir>
<keyname>230584D7</keyname>
<!--<executable>C:\Program Files (x86)\GnuPG\bin\gpg.exe</executable>-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Binary file added pubring.gpg
Binary file not shown.
Binary file added secring.gpg
Binary file not shown.
14 changes: 14 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>sonatype-nexus-staging</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>gpg.passphrase</id>
<passphrase>${env.CI_PGP_PASSWORD}</passphrase>
</server>
</servers>
</settings>
Loading

0 comments on commit 3453966

Please sign in to comment.