forked from openshift-labs/devops-labs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a670f09
Showing
64 changed files
with
4,821 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Compiled class file | ||
*.class | ||
|
||
# Log file | ||
*.log | ||
|
||
# BlueJ files | ||
*.ctxt | ||
|
||
# Mobile Tools for Java (J2ME) | ||
.mtj.tmp/ | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
*.zip | ||
*.tar.gz | ||
*.rar | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
target/ | ||
*.iml | ||
tmp/ | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# CoolStore Microservices Online Store | ||
|
||
CoolStore is an online store web application built using Spring Boot, WildFly Swarm, Eclipse Vert.x, | ||
Node.js and AngularJS adopting the microservices architecture. | ||
|
||
* **Web**: A Node.js/Angular front-end | ||
* **API Gateway**: vert.x service aggregates API calls to back-end services and provides a condenses REST API for front-end | ||
* **Catalog**: Spring Boot service exposing REST API for the product catalog and product information | ||
* **Inventory**: WildFly Swarm service exposing REST API for product's inventory status | ||
* **Cart**: Spring Boot service exposing REST API for shopping cart | ||
|
||
``` | ||
+-------------+ | ||
| | | ||
| Web | | ||
| | | ||
| Node.js | | ||
| AngularJS | | ||
+------+------+ | ||
| | ||
v | ||
+------+------+ | ||
| | | ||
| API Gateway | | ||
| | | ||
| Vert.x | | ||
| | | ||
+------+------+ | ||
| | ||
+---------+---------+-------------------+ | ||
v v v | ||
+------+------+ +------+------+ +------+------+ | ||
| | | | | | | ||
| Catalog | | Inventory | | Cart | | ||
| | | | | | | ||
| Spring Boot | |WildFly Swarm| | Spring Boot | | ||
| | | | | | | ||
+-------------+ +-------------+ +-------------+ | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
plugins { | ||
id "java" | ||
id "io.spring.dependency-management" version "1.0.1.RELEASE" | ||
id 'org.springframework.boot' version '1.5.2.RELEASE' | ||
} | ||
|
||
version = "1.0.0-SNAPSHOT" | ||
|
||
jar { | ||
archiveName = 'cart.jar' | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
url "http://nexus.lab-infra.svc.cluster.local:8081/content/groups/public/" | ||
} | ||
mavenCentral() | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.SR2" | ||
} | ||
} | ||
|
||
dependencies { | ||
compile("org.springframework.boot:spring-boot-starter-web") | ||
compile("org.springframework.boot:spring-boot-starter-jersey") | ||
compile("org.springframework.boot:spring-boot-starter-actuator") | ||
compile("org.springframework.cloud:spring-cloud-starter-feign") { | ||
exclude group: "com.sun.jersey", module: "jersey-client" | ||
} | ||
|
||
runtime("org.springframework.boot:spring-boot-starter-tomcat") | ||
testCompile("org.springframework.boot:spring-boot-starter-test") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
<?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>com.redhat.coolstore</groupId> | ||
<artifactId>cart</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>cart-service</name> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>1.4.2.RELEASE</version> | ||
</parent> | ||
|
||
<dependencyManagement> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-dependencies</artifactId> | ||
<version>Camden.SR2</version> | ||
<type>pom</type> | ||
<scope>import</scope> | ||
</dependency> | ||
</dependencies> | ||
</dependencyManagement> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
<java.version>1.8</java.version> | ||
<start-class>com.redhat.coolstore.CartServiceApplication</start-class> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-jersey</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.cloud</groupId> | ||
<artifactId>spring-cloud-starter-feign</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>com.sun.jersey</groupId> | ||
<artifactId>jersey-client</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-tomcat</artifactId> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- Test --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<finalName>${project.artifactId}</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.fabric8</groupId> | ||
<artifactId>fabric8-maven-plugin</artifactId> | ||
<version>3.2.28</version> | ||
<configuration> | ||
<buildRecreate>none</buildRecreate> | ||
<s2iBuildNameSuffix>-service</s2iBuildNameSuffix> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>cart-tests</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>discount-tests</id> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>repackage</goal> | ||
</goals> | ||
<configuration> | ||
<skip>true</skip> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
</profiles> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
|
||
<mirrors> | ||
<mirror> | ||
<id>nexus.default</id> | ||
<url>http://nexus.lab-infra.svc.cluster.local:8081/content/groups/public/</url> | ||
<mirrorOf>external:*</mirrorOf> | ||
</mirror> | ||
</mirrors> | ||
|
||
<profiles> | ||
<profile> | ||
<id>nexus</id> | ||
<repositories> | ||
<repository> | ||
<id>central</id> | ||
<url>http://central</url> | ||
<releases><enabled>true</enabled></releases> | ||
<snapshots><enabled>true</enabled></snapshots> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>central</id> | ||
<url>http://central</url> | ||
<releases><enabled>true</enabled></releases> | ||
<snapshots><enabled>true</enabled></snapshots> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
|
||
<activeProfiles> | ||
<activeProfile>nexus</activeProfile> | ||
</activeProfiles> | ||
</settings> |
14 changes: 14 additions & 0 deletions
14
cart-spring-boot/src/main/java/com/redhat/coolstore/CartServiceApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.redhat.coolstore; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.feign.EnableFeignClients; | ||
|
||
@SpringBootApplication | ||
@EnableFeignClients | ||
public class CartServiceApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(CartServiceApplication.class, args); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
cart-spring-boot/src/main/java/com/redhat/coolstore/model/Product.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.redhat.coolstore.model; | ||
|
||
import java.io.Serializable; | ||
|
||
public class Product implements Serializable { | ||
|
||
private static final long serialVersionUID = -7304814269819778382L; | ||
private String itemId; | ||
private String name; | ||
private String desc; | ||
private double price; | ||
|
||
public Product() { | ||
|
||
} | ||
|
||
public Product(String itemId, String name, String desc, double price) { | ||
super(); | ||
this.itemId = itemId; | ||
this.name = name; | ||
this.desc = desc; | ||
this.price = price; | ||
} | ||
public String getItemId() { | ||
return itemId; | ||
} | ||
public void setItemId(String itemId) { | ||
this.itemId = itemId; | ||
} | ||
public String getName() { | ||
return name; | ||
} | ||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
public String getDesc() { | ||
return desc; | ||
} | ||
public void setDesc(String desc) { | ||
this.desc = desc; | ||
} | ||
public double getPrice() { | ||
return price; | ||
} | ||
public void setPrice(double price) { | ||
this.price = price; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Product [itemId=" + itemId + ", name=" + name + ", desc=" | ||
+ desc + ", price=" + price + "]"; | ||
} | ||
} |
Oops, something went wrong.