Skip to content

Commit

Permalink
changes to the screencast
Browse files Browse the repository at this point in the history
  • Loading branch information
apssouza22 committed Nov 27, 2017
1 parent 36ceb11 commit 551fb33
Show file tree
Hide file tree
Showing 14 changed files with 49 additions and 28 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -28,7 +28,6 @@ CQRS, REST, Web Sockets, Continuous deploy with Jenkins, and all developed using

* run package-projects.sh
* run docker-orchestrate.sh
* docker-compose -f infra-docker-compose.yml -p todo up (wait until all services be up)
* docker-compose -p todo up

## Continuous deploy using Jenkins Pipeline
Expand All @@ -44,9 +43,9 @@ and paste the content of the Jenkinsfile in the Pipeline script box. Have a look
to check how to work with Jenkins pipeline

### Accessing the services
* Authenticate -> curl -X POST -vu todo-app:123456 http://localhost:8017/oauth/token -H "Accept: application/json" -d "password=1234&username=apssouza22@gmail.com&grant_type=password&scope=write&client_secret=123456&client_id=todo-app"
* Authenticate -> ```curl -X POST -vu todo-app:123456 http://localhost:8017/oauth/token -H "Accept: application/json" -d "password=1234&username=apssouza22@gmail.com&grant_type=password&scope=write&client_secret=123456&client_id=todo-app"```

* Get data using the access_token -> localhost:8018/accounts?access_token={access_token} or curl -H "Authorization: Bearer $TOKEN" "localhost:8018/path"
* Get data using the access_token -> `localhost:8018/accounts?access_token={access_token}` or `curl -H "Authorization: Bearer $TOKEN" "localhost:8018/path"`

### Scaling
NGINX will be configured for browser caching of the static content and Load balance. For that we will need to scale our App Gateway
Expand Down Expand Up @@ -104,7 +103,7 @@ curl -d '{"userEmail":"alex@test.com", "caption":"post caption", "description":"

```
# running separated container and link to the network infrastructure
docker run -d -p 8026:8026 --network todo_net --add-host eureka:172.19.0.3 todo/admin-server
docker run -d -p 8018:8018 --network todo_net --add-host eureka:172.19.0.5 --add-host config:172.19.0.2 todo/reminder-service
# orchestrate start-up of containers, tailing the logs...
docker-compose -p music up -d container-name && docker logs elk --follow # ^C to break
Expand Down
5 changes: 0 additions & 5 deletions api-gateway/pom.xml
Expand Up @@ -101,11 +101,6 @@
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
</dependency>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.4</version>
</dependency>

<dependency>
<groupId>com.h2database</groupId>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions config-server/pom.xml
Expand Up @@ -3,7 +3,7 @@
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>org.test</groupId>
<groupId>com.apssouza</groupId>
<artifactId>config-server</artifactId>
<version>1</version>
<packaging>jar</packaging>
Expand Down Expand Up @@ -42,7 +42,7 @@
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>

</dependencies>

<build>
Expand Down
4 changes: 4 additions & 0 deletions config-server/src/main/resources/application.yml
Expand Up @@ -2,6 +2,8 @@
spring.profiles.active: native
spring.application.name: config-server
server.port: 8888
eureka.client.serviceUrl.defaultZone : http://eureka:8010/eureka/,http://localhost:8011/eureka/

spring:
cloud:
config:
Expand All @@ -12,3 +14,5 @@ spring:
# "native" is used when the native profile is active, for local tests with a classpath repo:
native:
searchLocations: classpath:offline-repository/


40 changes: 40 additions & 0 deletions docker-compose.yml
Expand Up @@ -121,7 +121,47 @@ services:
command: ["./wait-for-it.sh","eureka:8010","--timeout=150","--","/usr/local/bin/start.sh"]
external_links:
- elk

zookeeper:
image: wurstmeister/zookeeper
ports:
- 2181:2181
networks:
- net
mem_limit: 925288000
cpu_shares: 100

kafka:
image: wurstmeister/kafka
ports:
- 9092
depends_on:
- zookeeper
environment:
KAFKA_ADVERTISED_HOST_NAME: 172.19.0.1
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_CREATE_TOPICS: "todo-mail:1:1"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
hostname: kafka
container_name: kafka
networks:
- net
mem_limit: 925288000
cpu_shares: 100

proxy:
build: proxy/
ports:
- 8055:80
networks:
- net
depends_on:
- gateway
hostname: proxy
container_name: proxy
command: ["./wait-for-it.sh","gateway:8018","--timeout=50","--","/usr/local/bin/start.sh"]

volumes:
todo_data:
external: true
Expand Down
Empty file modified docker-orchestrate.sh 100644 → 100755
Empty file.
6 changes: 0 additions & 6 deletions oauth-server/pom.xml
Expand Up @@ -95,12 +95,6 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.5.4</version>
</dependency>

<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
Expand Down
6 changes: 0 additions & 6 deletions remainder-service/pom.xml
Expand Up @@ -25,12 +25,6 @@
</properties>

<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.3.4</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions user-service/pom.xml
Expand Up @@ -38,11 +38,6 @@
</dependencyManagement>

<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>1.3.4</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down

0 comments on commit 551fb33

Please sign in to comment.