Skip to content

Commit

Permalink
Merge pull request #55 from mslowiak/develop
Browse files Browse the repository at this point in the history
AnnouncementsProcessor 1.0
  • Loading branch information
mslowiak authored Jan 9, 2019
2 parents a7db8c6 + a69320c commit 9c8c6d8
Show file tree
Hide file tree
Showing 145 changed files with 14,095 additions and 29 deletions.
84 changes: 84 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
version: 2
jobs:
parser-test:
docker:
- image: circleci/openjdk:8-jdk-browsers

steps:
- checkout

- restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed
key: circleci-announcement-processor-parser-{{ checksum "announcement-processor-parser/pom.xml" }}

- run: cd announcement-processor-parser && mvn dependency:go-offline # gets the project dependencies

- save_cache: # saves the project dependencies
paths:
- ~/.m2
key: circleci-announcement-processor-parser-{{ checksum "announcement-processor-parser/pom.xml" }}

- run: cd announcement-processor-parser && mvn package # run the actual tests

- store_test_results: # uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.
path: announcement-processor-parser/target/surefire-reports

- store_artifacts:
path: announcement-processor-parser/target/parser-service.jar

api-test:
docker:
- image: circleci/openjdk:8-jdk-browsers

steps:
- checkout

- restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed
key: circleci-announcement-processor-api-{{ checksum "announcement-processor-api/pom.xml" }}

- run: cd announcement-processor-api && mvn dependency:go-offline # gets the project dependencies

- save_cache: # saves the project dependencies
paths:
- ~/.m2
key: circleci-announcement-processor-api-{{ checksum "announcement-processor-api/pom.xml" }}

- run: cd announcement-processor-api && mvn package # run the actual tests

- store_test_results: # uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.
path: announcement-processor-api/target/surefire-reports

- store_artifacts:
path: announcement-processor-api/target/api-service.jar

extractor-test:
docker:
- image: circleci/openjdk:8-jdk-browsers

steps:
- checkout

- restore_cache: # restore the saved cache after the first run or if `pom.xml` has changed
key: circleci-announcement-processor-extractor-{{ checksum "announcement-processor-extractor/pom.xml" }}

- run: cd announcement-processor-extractor && mvn dependency:go-offline # gets the project dependencies

- save_cache: # saves the project dependencies
paths:
- ~/.m2
key: circleci-announcement-processor-extractor-{{ checksum "announcement-processor-extractor/pom.xml" }}

- run: cd announcement-processor-extractor && mvn package # run the actual tests

- store_test_results: # uploads the test metadata from the `target/surefire-reports` directory so that it can show up in the CircleCI dashboard.
path: announcement-processor-extractor/target/surefire-reports

- store_artifacts:
path: announcement-processor-extractor/target/extractor-service.jar

workflows:
version: 2
announcement_processor:
jobs:
- parser-test
- api-test
- extractor-test
29 changes: 29 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/target/
.mvn
mvnw
mvnw.cmd

src/main/resources/application-prod.properties

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
29 changes: 29 additions & 0 deletions announcement-processor-api/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/target/
.mvn
mvnw
mvnw.cmd

src/main/resources/application-prod.properties

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/build/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
16 changes: 16 additions & 0 deletions announcement-processor-api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:8-jdk-alpine

RUN apk update
RUN apk add maven

RUN mkdir -p /srv/announcement-processor/api
WORKDIR /srv/announcement-processor/api

ADD pom.xml /srv/announcement-processor/api
COPY src /srv/announcement-processor/api/src

RUN ["mvn", "clean", "install", "-DskipTests"]

EXPOSE 8080

CMD java -jar -Dspring.profiles.active=dev /srv/announcement-processor/api/target/api-service.jar
135 changes: 135 additions & 0 deletions announcement-processor-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
<?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>announcement-processor</groupId>
<artifactId>api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Announcement processor api</name>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.0.RELEASE</version>
<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>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<!--LESS CODE MORE ANNOTATIONS-->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>

<!--TEST-->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>2.0.2-beta</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
</dependency>

<!--DB-->
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.197</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

<!--ModelMapper-->
<dependency>
<groupId>org.modelmapper</groupId>
<artifactId>modelmapper</artifactId>
<version>2.3.2</version>
</dependency>
</dependencies>

<build>
<finalName>
api-service
</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.2</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<excludes>
<exclude>
api/AnnouncementProcessorApiApplication.class
</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package api;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class AnnouncementProcessorApiApplication {

public static void main(String[] args) {
SpringApplication.run(AnnouncementProcessorApiApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package api.configuration;

import api.converter.AnnouncementDtoEntityConverter;
import org.modelmapper.ModelMapper;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ModelMapperConfig {

@Bean
public ModelMapper modelMapper() {
ModelMapper mapper = new ModelMapper();
mapper.addConverter(new AnnouncementDtoEntityConverter());
return mapper;
}
}
Loading

0 comments on commit 9c8c6d8

Please sign in to comment.