Skip to content

Commit

Permalink
WIP: Adding codekvast-admin
Browse files Browse the repository at this point in the history
  • Loading branch information
ollehallin committed Apr 10, 2018
1 parent 6d6d297 commit c20afa0
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ subprojects {
ext.gitTimeIso = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZZ").format(new Date(gitHead.time * 1000L))
ext.codekvastDisplayVersion = "${codekvastVersion}-${gitId}".toString()

repositories { jcenter() }
repositories {
jcenter()
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

tasks.withType(JavaCompile) {
options.incremental = true
Expand Down
1 change: 1 addition & 0 deletions gradle/libs.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ext {
jacocoVersion = '0.8.1'
kotlinVersion = '1.2.21'
seleniumVersion = '3.11.0'
springBootAdminVersion = '2.0.0-SNAPSHOT'
springBootVersion = '2.0.1.RELEASE'
springfoxVersion = '2.8.0'

Expand Down
1 change: 1 addition & 0 deletions gradle/spring-boot-app.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
compile 'javax.inject:javax.inject:1'
compile 'org.springframework.boot:spring-boot-starter-logging'
compile 'org.springframework.boot:spring-boot-devtools'
compile "de.codecentric:spring-boot-admin-starter-client:$springBootAdminVersion"

testCompile 'org.springframework.boot:spring-boot-starter-test'
}
Expand Down
24 changes: 24 additions & 0 deletions product/admin/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apply from: "$rootDir/gradle/spring-boot-app.gradle"

description = 'The Codekvast Admin server'
applicationName = 'codekvast-admin'
archivesBaseName = 'codekvast-admin'
version = codekvastVersion
group = 'crisp'
mainClassName = 'io.codekvast.admin.CodekvastAdminApplication'

dependencies {
compile "de.codecentric:spring-boot-admin-starter-server:$springBootAdminVersion"
runtime 'org.springframework.boot:spring-boot-starter-webflux'
}

//--- Packaging ------------------------------------------------------------------------------------------------------------------
bootJar {
launchScript {
properties([
'initInfoProvides': applicationName,
'initInfoShortDescription': 'Codekvast Admin',
'initInfoDescription': 'Codekvast Admin is an admin console for other Codekvast micro services',
])
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2015-2018 Hallin Information Technology AB
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package io.codekvast.admin;

import de.codecentric.boot.admin.server.config.EnableAdminServer;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@EnableAdminServer
public class CodekvastAdminApplication {

public static void main(String[] args) {
SpringApplication.run(CodekvastAdminApplication.class, args);
}
}
20 changes: 20 additions & 0 deletions product/admin/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#-------------------------------------------------------------------------------------------------------
# This file contains ONLY stuff that is injected by Gradle.
# Gradle's expand() does not play well with YAML files...
#
# We use JSP syntax <%= %> to avoid runtime errors if running with an unexpanded file. Spring also
# uses ${} syntax.
#-------------------------------------------------------------------------------------------------------

# info.build.* is visible in /actuator/info
info.build.gradle.name = <%= project.archivesBaseName %>
info.build.gradle.description = <%= project.description %>
info.build.gradle.version = <%= project.codekvastDisplayVersion %>
info.build.git.id = <%= project.gitId %>
info.build.git.committer = <%= project.gitCommitter %>
info.build.git.message = <%= project.gitShortMessage %>
info.build.git.time = <%= project.gitTime %>

# application.title and application.version are shown in the banner on the console
application.title = Codekvast Admin
application.version = <%= project.codekvastDisplayVersion %>
2 changes: 2 additions & 0 deletions product/admin/src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
server:
port: 8083
7 changes: 7 additions & 0 deletions product/admin/src/main/resources/banner.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
_________ .___ __ __ _____ .___ .__
\_ ___ \ ____ __| _/____ | | _____ _______ _______/ |_ / _ \ __| _/_____ |__| ____
/ \ \/ / _ \ / __ |/ __ \| |/ /\ \/ /\__ \ / ___/\ __\ / /_\ \ / __ |/ \| |/ \
\ \___( <_> ) /_/ \ ___/| < \ / / __ \_\___ \ | | / | \/ /_/ | Y Y \ | | \
\______ /\____/\____ |\___ >__|_ \ \_/ (____ /____ > |__| \____|__ /\____ |__|_| /__|___| /
\/ \/ \/ \/ \/ \/ \/ \/ \/ \/
${application.title} ${AnsiColor.MAGENTA}V${application.version}${AnsiColor.DEFAULT} running on Spring Boot ${AnsiColor.MAGENTA}${spring-boot.version}${AnsiColor.DEFAULT}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.codekvast.admin;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = CodekvastAdminApplication.class)
public class CodekvastAdminApplicationTests {

@Test
public void contextLoads() {
}

}
6 changes: 6 additions & 0 deletions product/login/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ server:
use-forward-headers: true

spring:
boot:
admin:
client:
url: http://localhost:8083
instance:
name: codekvast-login
datasource:
hikari:
connection-test-query: SELECT 1 FROM DUAL
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
rootProject.name = 'codekvast'

include ':product'
include ':product:admin'
include ':product:agent-model'
include ':product:common'
include ':product:dashboard'
Expand Down

0 comments on commit c20afa0

Please sign in to comment.