-
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.
Merge pull request #9 from dksifoua/feature/5-setup-config-server
Setup Config Server
- Loading branch information
Showing
18 changed files
with
251 additions
and
49 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,31 @@ | ||
name: config-server | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
- feature/** | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: oracle | ||
java-version: 21 | ||
- name: Setup Task | ||
uses: arduino/setup-task@v2 | ||
with: | ||
version: 3.x | ||
repo-token: ${{ secrets.GH_TOKEN }} | ||
- name: Test config server | ||
run: task config: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
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
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
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 |
---|---|---|
@@ -1,28 +1,6 @@ | ||
server: | ||
port: 8080 | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka} | ||
|
||
spring: | ||
application: | ||
name: api-gateway | ||
devtools: | ||
livereload: | ||
port: 35730 | ||
|
||
cloud: | ||
gateway: | ||
routes: | ||
- id: catalog-service | ||
uri: http://localhost:8081 | ||
predicates: | ||
- Path=/api/v1/catalog/** | ||
logging: | ||
level: | ||
root: info | ||
org.springframework.cloud.gateway: trace | ||
org.springframework.web: debug | ||
org.springframework.web.reactive: debug | ||
config: | ||
import: optional:configserver:http://dksifoua:dksifoua@localhost:8888 |
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
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 |
---|---|---|
@@ -1,23 +1,6 @@ | ||
app: | ||
base-path: /api/v1/catalog | ||
|
||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka} | ||
|
||
server: | ||
port: 8081 | ||
|
||
spring: | ||
application: | ||
name: catalog-service | ||
devtools: | ||
livereload: | ||
port: 35729 | ||
|
||
logging: | ||
level: | ||
root: info | ||
org.springframework.web: debug | ||
org.springframework.web.reactive: debug | ||
config: | ||
import: optional:configserver:http://dksifoua:dksifoua@localhost:8888 |
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
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,25 @@ | ||
app: | ||
base-path: /api/v1/catalog | ||
|
||
eureka: | ||
client: | ||
enabled: false | ||
register-with-eureka: false | ||
fetch-registry: false | ||
|
||
server: | ||
port: 8081 | ||
|
||
spring: | ||
application: | ||
name: catalog-service | ||
|
||
devtools: | ||
livereload: | ||
port: 35729 | ||
|
||
logging: | ||
level: | ||
root: info | ||
org.springframework.web: debug | ||
org.springframework.web.reactive: debug |
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 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ |
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,19 @@ | ||
version: 3 | ||
|
||
tasks: | ||
clean: | ||
desc: Clean config server build | ||
cmd: ./gradlew :config-server:clean | ||
silent: true | ||
|
||
run: | ||
desc: Run config server | ||
cmd: ./gradlew :config-server:bootRun | ||
silent: true | ||
|
||
test: | ||
desc: Test config server | ||
cmds: | ||
- task: clean | ||
- ./gradlew :config-server:test | ||
silent: true |
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,41 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.4' | ||
id 'io.spring.dependency-management' version '1.1.6' | ||
} | ||
|
||
group = 'io.dksifoua.eshop' | ||
version = '0.0.1-SNAPSHOT' | ||
|
||
java { | ||
toolchain { | ||
languageVersion = JavaLanguageVersion.of(21) | ||
} | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
ext { | ||
set('springCloudVersion', "2023.0.3") | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter-security' | ||
implementation 'org.springframework.cloud:spring-cloud-config-server' | ||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
testImplementation 'org.springframework.security:spring-security-test' | ||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
} | ||
|
||
dependencyManagement { | ||
imports { | ||
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}" | ||
} | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} |
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 @@ | ||
rootProject.name = 'config' |
15 changes: 15 additions & 0 deletions
15
config-server/src/main/java/io/dksifoua/eshop/config/ConfigServerApplication.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,15 @@ | ||
package io.dksifoua.eshop.config; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.config.server.EnableConfigServer; | ||
|
||
@SpringBootApplication | ||
@EnableConfigServer | ||
public class ConfigServerApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(ConfigServerApplication.class, args); | ||
} | ||
|
||
} |
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,28 @@ | ||
eureka: | ||
client: | ||
enabled: false | ||
register-with-eureka: false | ||
fetch-registry: false | ||
|
||
logging: | ||
level: | ||
root: info | ||
org.springframework.cloud.config: debug | ||
|
||
server: | ||
port: 8888 | ||
|
||
spring: | ||
application: | ||
name: config-server | ||
|
||
cloud: | ||
config: | ||
server: | ||
git: | ||
uri: https://github.com/dksifoua/eshop-config | ||
|
||
security: | ||
user: | ||
name: dksifoua | ||
password: dksifoua |
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 @@ | ||
eureka: | ||
client: | ||
service-url: | ||
defaultZone: ${EUREKA_URI:http://localhost:8761/eureka} | ||
|
||
logging: | ||
level: | ||
root: info | ||
org.springframework.cloud.config: debug | ||
|
||
server: | ||
port: 8888 | ||
|
||
spring: | ||
application: | ||
name: config-server | ||
|
||
cloud: | ||
config: | ||
server: | ||
git: | ||
uri: https://github.com/dksifoua/eshop-config | ||
|
||
security: | ||
user: | ||
name: dksifoua | ||
password: dksifoua |
15 changes: 15 additions & 0 deletions
15
config-server/src/test/java/io/dksifoua/eshop/config/ConfigServerApplicationTests.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,15 @@ | ||
package io.dksifoua.eshop.config; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.test.context.ActiveProfiles; | ||
|
||
@SpringBootTest | ||
@ActiveProfiles(profiles = "test") | ||
class ConfigServerApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |
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