Skip to content

Commit

Permalink
ci: manage the repository with travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gdrouet committed Nov 24, 2016
1 parent e0d8076 commit 6e67ab3
Show file tree
Hide file tree
Showing 7 changed files with 174 additions and 23 deletions.
10 changes: 10 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
language: java
jdk:
- oraclejdk8
env:
- MODULE=core
- MODULE=core/java-lib
- MODULE=core/broadcaster
before_install:
- cp config/settings.xml ~/.m2/settings.xml
script: cd $MODULE && mvn clean deploy
9 changes: 9 additions & 0 deletions config/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<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>github</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
</servers>
</settings>
35 changes: 26 additions & 9 deletions core/broadcaster/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,20 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.reactivity.core</groupId>
<artifactId>broadcaster</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Reactivity core broadcaster</name>
<description>Microservice holding client SSE connections and broadcasting events</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
<relativePath/> <!-- lookup parent from repository -->
<groupId>io.reactivity.core</groupId>
<artifactId>reactivity-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<spring-data.version>2.0.0.DATACMNS-836-SNAPSHOT</spring-data.version>
<couchbase-client.version>2.3.4</couchbase-client.version>
<rxjava.version>1.1.9</rxjava.version>
Expand All @@ -32,6 +27,19 @@
<reactive-streams-common.version>0.6.0.BUILD-SNAPSHOT</reactive-streams-common.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<!-- Import dependency management from Spring Boot -->
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.0.BUILD-SNAPSHOT</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>

<!-- Spring Data with couchbase (including RxJava for async driver) -->
Expand Down Expand Up @@ -136,6 +144,15 @@
<enabled>false</enabled>
</snapshots>
</repository>
<!-- Reactivity Core dependencies -->
<repository>
<id>internal.repo</id>
<name>GitHub Repository</name>
<url>https://raw.githubusercontent.com/reactivity-io/maven-repository/mvn-repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.document.JsonDocument;
import com.couchbase.client.java.document.json.JsonObject;
import io.reactivity.core.broadcaster.config.CouchbaseConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
Expand All @@ -44,7 +43,7 @@
* @since 0.1.0
*/
@RunWith(SpringRunner.class)
@ContextConfiguration(classes = CouchbaseConfig.class)
@ContextConfiguration(classes = TestConfig.class)
public class RepositoryTest {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* The MIT License (MIT) Copyright (c) 2016 The reactivity authors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/


package io.reactivity.core.broadcaster;

import io.reactivity.core.broadcaster.config.CouchbaseConfig;
import org.springframework.context.annotation.Configuration;

/**
* <p>
* This configuration class detects environment variable.
* This kind of support is provided by spring boot but the {@code SpringBootApplication} annotation is currently not used.
* </p>
*
* @author Guillaume DROUET
* @since 0.1.0
*/
@Configuration
public class TestConfig extends CouchbaseConfig {

/**
* <p>
* Builds a the default instance.
* </p>
*/
public TestConfig() {
final String nodes = System.getenv("REACTIVITY_COUCHBASE_NODES");

if (nodes != null) {
setNodes(nodes.split(","));
}
}
}
20 changes: 8 additions & 12 deletions core/java-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@
<version>0.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Reactiviy Java Library</name>
<name>Reactivity core Java Library</name>
<description>Library containing common dependencies between Java Microservices</description>

<parent>
<groupId>io.reactivity.core</groupId>
<artifactId>reactivity-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<jackson.version>2.8.5</jackson.version>
<maven-resources-plugin.version>3.0.1</maven-resources-plugin.version>
</properties>
Expand Down Expand Up @@ -51,14 +55,6 @@
<useDefaultDelimiters>false</useDefaultDelimiters>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
72 changes: 72 additions & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.reactivity.core</groupId>
<artifactId>reactivity-parent</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>

<!-- github server corresponds to entry in settings.xml -->
<github.global.server>github</github.global.server>
<site-maven-plugin.version>0.12</site-maven-plugin.version>
</properties>

<distributionManagement>
<!-- This is where artifacts will be deployed and selected for upload to Github -->
<repository>
<id>internal.repo</id>
<name>GitHub Repository</name>
<url>file://${project.build.directory}/mvn-repo</url>
</repository>
</distributionManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>

<!-- This plugin selects artifacts deployed locally and upload them to Github -->
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>${site-maven-plugin.version}</version>
<configuration>
<!-- git commit message -->
<message>deploy: maven artifact for ${project.name} version ${project.version}</message>

<!-- What to include -->
<outputDirectory>${project.build.directory}/mvn-repo</outputDirectory>
<includes><include>**/*</include></includes>

<!-- Github repository -->
<repositoryName>maven-repository</repositoryName>
<repositoryOwner>reactivity-io</repositoryOwner>
<branch>refs/heads/mvn-repo</branch>
<merge>true</merge>
</configuration>
<executions>
<!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>deploy</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

0 comments on commit 6e67ab3

Please sign in to comment.