From 3194a3f775a235a4d9fea1c5bb90d5b24fb6e372 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Fri, 4 Dec 2020 14:19:11 +0100
Subject: [PATCH] Setup for spring-admin

---
 goofy-server/pom.xml                               |  9 +++++++++
 .../src/main/resources/application-local.yml       |  5 +++++
 goofy-server/src/main/resources/application-oc.yml |  7 +++++++
 goofy-server/src/main/resources/application.yml    | 14 +++++++++++++-
 goofy-server/src/main/resources/banner.txt         |  6 ++++++
 pom.xml                                            | 11 +++++++++--
 6 files changed, 49 insertions(+), 3 deletions(-)
 create mode 100644 goofy-server/src/main/resources/application-local.yml
 create mode 100644 goofy-server/src/main/resources/banner.txt

diff --git a/goofy-server/pom.xml b/goofy-server/pom.xml
index 22efc79754..f458c20b5a 100644
--- a/goofy-server/pom.xml
+++ b/goofy-server/pom.xml
@@ -43,6 +43,15 @@
 			<groupId>net.devh</groupId>
 			<artifactId>grpc-client-spring-boot-starter</artifactId>
 		</dependency>
+		
+		<dependency>
+			<groupId>org.springframework.boot</groupId>
+			<artifactId>spring-boot-starter-actuator</artifactId>
+		</dependency>
+		<dependency>
+			<groupId>de.codecentric</groupId>
+			<artifactId>spring-boot-admin-starter-client</artifactId>
+		</dependency>
 
 		<!-- own projects -->
 		<dependency>
diff --git a/goofy-server/src/main/resources/application-local.yml b/goofy-server/src/main/resources/application-local.yml
new file mode 100644
index 0000000000..6701369f97
--- /dev/null
+++ b/goofy-server/src/main/resources/application-local.yml
@@ -0,0 +1,5 @@
+spring:
+  boot:
+    admin:
+      client:
+        url: http://localhost:8090
\ No newline at end of file
diff --git a/goofy-server/src/main/resources/application-oc.yml b/goofy-server/src/main/resources/application-oc.yml
index 2ff02fbea0..990f684686 100644
--- a/goofy-server/src/main/resources/application-oc.yml
+++ b/goofy-server/src/main/resources/application-oc.yml
@@ -1,3 +1,10 @@
+spring:
+  boot:
+    admin:
+      client:
+        instance:
+          prefer-ip: true
+
 grpc:
   client:
     pluto:
diff --git a/goofy-server/src/main/resources/application.yml b/goofy-server/src/main/resources/application.yml
index 0b899014ee..8a94428096 100644
--- a/goofy-server/src/main/resources/application.yml
+++ b/goofy-server/src/main/resources/application.yml
@@ -1,11 +1,23 @@
 logging:
   level:
     ROOT: WARN
-    de.itvsh: INFO
+    '[de.itvsh]': INFO
+
+spring:
+  application:
+    name: Goofy
 
 server:
   http2:
     enabled: true
+    
+management:
+  server:
+    port: 8081
+  endpoints:
+    web:
+      exposure:
+        include: "*"
 
 goofy:
   production: false
diff --git a/goofy-server/src/main/resources/banner.txt b/goofy-server/src/main/resources/banner.txt
new file mode 100644
index 0000000000..13e3273b90
--- /dev/null
+++ b/goofy-server/src/main/resources/banner.txt
@@ -0,0 +1,6 @@
+  ___   ___    ___   ___ __   __
+ / __| / _ \  / _ \ | __|\ \ / /
+| (_ || (_) || (_) || _|  \   / 
+ \___| \___/  \___/ |_|    |_|  
+================================
+${spring-boot.version}		${application.version}
diff --git a/pom.xml b/pom.xml
index feb66b26e0..3a76d61287 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,6 +22,7 @@
 		<spring.boot.version>2.4.0</spring.boot.version>
 
 		<grpc.spring-boot-starter.version>2.10.1.RELEASE</grpc.spring-boot-starter.version>
+		<spring-admin.version>2.3.1</spring-admin.version>
 		<mapstruct.version>1.4.1.Final</mapstruct.version>
 
 		<lorem.version>2.1</lorem.version>
@@ -45,6 +46,12 @@
 				<scope>import</scope>
 			</dependency>
 
+			<dependency>
+				<groupId>de.codecentric</groupId>
+				<artifactId>spring-boot-admin-starter-client</artifactId>
+				<version>${spring-admin.version}</version>
+			</dependency>
+
 			<!-- tools -->
 			<dependency>
 				<groupId>org.mapstruct</groupId>
@@ -62,7 +69,7 @@
 				<artifactId>pluto-interface</artifactId>
 				<version>${project.version}</version>
 			</dependency>
-			
+
 			<dependency>
 				<groupId>com.thedeanda</groupId>
 				<artifactId>lorem</artifactId>
@@ -80,7 +87,7 @@
 					<artifactId>maven-resources-plugin</artifactId>
 					<version>${resources.plugin.version}</version>
 				</plugin>
-				
+
 				<plugin>
 					<groupId>org.springframework.boot</groupId>
 					<artifactId>spring-boot-maven-plugin</artifactId>
-- 
GitLab