-
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.
Setup netflix eureka service discovery
- Loading branch information
Showing
18 changed files
with
218 additions
and
10 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: eureka | ||
|
||
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 eureka server | ||
run: task eureka: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
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
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,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 eureka server build | ||
cmd: ./gradlew :eureka-server:clean | ||
silent: true | ||
|
||
run: | ||
desc: Run netflix eureka server | ||
cmd: ./gradlew :eureka-server:bootRun | ||
silent: true | ||
|
||
test: | ||
desc: Test netflix eureka server | ||
cmds: | ||
- task: clean | ||
- ./gradlew :eureka-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,38 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.springframework.boot' version '3.3.3' | ||
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.cloud:spring-cloud-starter-netflix-eureka-server' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-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 = 'eureka' |
15 changes: 15 additions & 0 deletions
15
eureka-server/src/main/java/io/dksifoua/eshop/eureka/EurekaServerApplication.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.eureka; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; | ||
|
||
@SpringBootApplication | ||
@EnableEurekaServer | ||
public class EurekaServerApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(EurekaServerApplication.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,11 @@ | ||
eureka: | ||
client: | ||
fetch-registry: false | ||
register-with-eureka: false | ||
|
||
server: | ||
port: 8761 | ||
|
||
spring: | ||
application: | ||
name: eureka-server |
14 changes: 14 additions & 0 deletions
14
eureka-server/src/test/java/io/dksifoua/eshop/eureka/EurekaServerApplicationTests.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 io.dksifoua.eshop.eureka; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class EurekaServerApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
assert 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
rootProject.name = 'eshop' | ||
|
||
include('api-gateway') | ||
include('catalog-service') | ||
include('catalog-service') | ||
include('eureka-server') |