Skip to content

Updated Project Name in bootstrap.yml #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@ jdk:
- oraclejdk8
sudo: required
services:
- mysql
- docker
before_script:
- sudo service mysql stop
env:
global:
- secure: j5zON5BZcgWx2u33dNmRrSQeiAByoIxwbGlUKBsNZwpBUBv5nWIqBAEnxytMplD5js59EcbVfjxfSyhHQst3/TsnQsg63Y4Nzjhn5shaupInwiu+dNq2R50MkiYsgAt3fhoQgpg1UYnK7SnNeNqnGm7h+efAKESFul0w+wqtSH0Fx+9HVpvFm5PyfI3jlZXe2t4C1HWzwcDhxhKKV4i9NMOtJyxPpZz/TLz41YF2VjLmaHTu1uEkykZPjRfvIRktRsl9r6huRYc+pFEzvtkpel86CSCtYLsDzxA8l57EB/w5i06Mnj0Z41SnwVEvQs75wYrZ4GLH36RAu0xRWJg6M4zC2VwZ68QGBdspc96gJxBa2BM19SLvEUTG8EfIPjwjyF1Zoons2ECsvQqJTNfq0CPwQH3ghhwv6rVWaWfrpwYsrq9/AjIfc5sRDPf7VPqtTQy4a3rP0kGdR+pICEtwioUvFN5E6tTkJ7yTuuafhNJwQr4mV7zIC/00mlMisGk3zygUJq6w1jxynMyxib1dz9YjqnEAFW5BJfg/1YIhFfaOhXapcLC88WVe9UzCKJI5vRGRKr4G/H/PW/z3ZKHVF55R+IY/zr20sVm5ls5MJbZz8rDW91H49rbx71sebrTxKdDsGVgdYe14Hy/jp6SYNfl3h4TIF+mwFKI/9J19vlA=
- secure: IKttjrB+x/qpP7DRz1GaxzFg7vuQUF4PcY+XiJP3Yx2nlvvdcyXPbDMhkcbYhGrBdXR3IQjpD9Uf7YI4tUrfQ164QIlzds0CveA+GT1KgCVqmov6w5HPIdMYk58fgsp0CNl7qUu78Cg+NpuQunp8EIN7cKnFkDNtth+YVCvz6dn9+Va0pYuuWhfn5nCx1arENuWTgd8u5B/7rQvTwa0Uf4Gc4I4f8nRhaNZsDWDOUUscPI2ynUNo5oYlDZhZ1wC4UFXm54GN8x6iofRcZida98JLf/PDG2eAphKPM4zO8vUuufQhe2+bKzOQXqA+3KMo6EbHk2ZE99vi7+7t24bAuMByBxXG+kbM/rBXHCZVQHQjAAJjOVVEqBoUoqmydUfqN772VM5/lSXgXL7/xSD5AtjKYC/NSuFEdEH5ghj8z2FplAUkhFdaYSfRQdfF89pZhJ+6mXAiu22FZi9U5ip5kgXgN48yjO8WeBh23SvrxZYYyplceC/9Cq2B/9dCZy8h0LYZSpdkyhPMBiiR0O9Es7d8cwvcgespRhcYEPLlAKJ/6vxRQhFRIE/LfEdUEMcoffoRUdQv8IX00GAw6G4oucijy2PQfJhQIi+YHypMGmSe3ALfNBaQKsW4LBEjZnPnhfz1qUn8S0y6Z5LXY5x0QOZuUswzXRsMyLb3eeINITk=
test:
adapter: mysql2
database: user_service
username: travis
encoding: utf8
before_install:
- mysql -e 'CREATE DATABASE IF NOT EXISTS user_service;'
- chmod +x gradlew
- echo "Testing Docker Hub credentials"
- docker -v
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM openjdk:8-jdk-alpine
MAINTAINER Juan Sotomayor "jsoto128@fiu.edu"
VOLUME /tmp
ADD build/libs/user-service-0.0.1-SNAPSHOT.jar app.jar
ADD build/libs/userservice-0.0.1-SNAPSHOT.jar app.jar
ENV JAVA_OPTS=""
ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ]
11 changes: 11 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'checkstyle'

group = 'org.aitesting.microservices'
jar.baseName = 'userservice'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

Expand Down Expand Up @@ -51,6 +52,9 @@ dependencies {
//compile('postgresql:postgresql:9.1-901.jdbc4')
compile 'mysql:mysql-connector-java'

testCompile('com.jayway.restassured:rest-assured:2.5.0')
testCompile('com.jayway.restassured:spring-mock-mvc:2.5.0')
testCompile('org.springframework.cloud:spring-cloud-starter-contract-stub-runner')
testCompile('org.springframework.boot:spring-boot-starter-test')
testCompile('com.palantir.docker.compose:docker-compose-rule-junit4:0.33.0')
}
Expand All @@ -77,3 +81,10 @@ dependencyManagement {
}
}

test {
testLogging {
events "failed"
exceptionFormat "full"
}
}

42 changes: 42 additions & 0 deletions docker-compose-local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: '3'

services:

discoveryservice:
image: aista/discovery-service
container_name: discoveryservice
ports:
- "8761:8761"
environment:
- 'eviction-interval-timer-in-ms: 1000'

mysqlserver:
image: mysql:5.7
container_name: mysqlserver
volumes:
- mysql-data:/var/lib/mysql:rw
restart: always
ports:
- '3306:3306'
environment:
MYSQL_USER:
MYSQL_PASSWORD:
MYSQL_ROOT_PASSWORD: 'root'
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: 'user_service'

userservice:
build: ./
depends_on:
- discoveryservice
- mysqlserver
container_name: userservice
ports:
- '8091:8080'
environment:
- 'DOCKER_MACHINE_IP:192.168.99.101'
- 'APP_PORT:8080'

volumes:
mysql-data:

16 changes: 8 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ version: '3'

services:

discovery-service:
discoveryservice:
image: aista/discovery-service
container_name: discovery-service
container_name: discoveryservice
ports:
- "8761:8761"
environment:
- 'eviction-interval-timer-in-ms: 1000'

mysql-server:
mysqlserver:
image: mysql:5.7
container_name: mysql-server
container_name: mysqlserver
volumes:
- mysql-data:/var/lib/mysql:rw
restart: always
Expand All @@ -25,12 +25,12 @@ services:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: 'user_service'

user-service:
userservice:
build: ./
depends_on:
- discovery-service
- mysql-server
container_name: user-service
- discoveryservice
- mysqlserver
container_name: userservice
ports:
- '8091:8080'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.oauth2.config.annotation.web.configuration.AuthorizationServerConfigurerAdapter;
import org.springframework.security.oauth2.config.annotation.web.configurers.AuthorizationServerEndpointsConfigurer;
//import org.springframework.security.oauth2.provider.token.DefaultTokenServices;
import org.springframework.security.oauth2.provider.token.TokenEnhancer;
import org.springframework.security.oauth2.provider.token.TokenEnhancerChain;
import org.springframework.security.oauth2.provider.token.TokenStore;
Expand All @@ -26,9 +25,6 @@ public class JWTOAuth2Config extends AuthorizationServerConfigurerAdapter {
@Autowired
private TokenStore tokenStore;

// @Autowired
// private DefaultTokenServices tokenServices;

@Autowired
private JwtAccessTokenConverter jwtAccessTokenConverter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import javax.sql.DataSource;

//import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
Expand Down
12 changes: 6 additions & 6 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring:
profiles: dev

datasource:
url: jdbc:mysql://mysql-server:3306/user_service
url: jdbc:mysql://${DOCKER_MACHINE_IP:mysqlserver}:3306/user_service
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
Expand All @@ -23,7 +23,7 @@ eureka:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://discovery-service:8761/eureka/
defaultZone: http://${DOCKER_MACHINE_IP:discoveryservice}:8761/eureka/

server:
contextPath: /auth
Expand All @@ -41,7 +41,7 @@ spring:
profiles: docker

datasource:
url: jdbc:mysql://mysql-server:3306/user_service
url: jdbc:mysql://mysqlserver:3306/user_service
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
Expand All @@ -59,7 +59,7 @@ eureka:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://discovery-service:8761/eureka/
defaultZone: http://discoveryservice:8761/eureka/

server:
contextPath: /auth
Expand All @@ -82,7 +82,7 @@ spring:
profiles: local

datasource:
url: jdbc:mysql://192.168.99.100:3306/user_service
url: jdbc:mysql://${DOCKER_MACHINE_IP:localhost}:3306/user_service
username: root
password: root
driver-class-name: com.mysql.jdbc.Driver
Expand All @@ -100,7 +100,7 @@ eureka:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://192.168.99.100:8761/eureka/
defaultZone: http://${DOCKER_MACHINE_IP:localhost}:8761/eureka/

server:
contextPath: /auth
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
spring:
application:
name: user-service
name: userservice
profiles:
active: dev
cloud:
config:
uri: http://192.168.99.100:8888
uri: http://${CONFIGURATION_HOST:localhost}:8888
enabled: true
Loading