Skip to content

Commit 1a40dd6

Browse files
authored
Adding 'website', basic spring boot serving static site (#528)
0 parents  commit 1a40dd6

File tree

4 files changed

+59
-0
lines changed

4 files changed

+59
-0
lines changed

build.gradle

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
plugins {
2+
id 'org.springframework.boot' version '2.7.3'
3+
id 'io.spring.dependency-management' version '1.0.13.RELEASE'
4+
id "com.google.cloud.tools.jib" version "3.1.4"
5+
id 'java'
6+
}
7+
8+
dependencies {
9+
implementation 'org.springframework.boot:spring-boot-starter-web'
10+
}
11+
12+
var outputImage = 'togetherjava.duckdns.org:5001/togetherjava/website:' + System.getenv('BRANCH_NAME') ?: 'latest'
13+
14+
jib {
15+
from.image = 'eclipse-temurin:18'
16+
to {
17+
image = outputImage
18+
auth {
19+
username = System.getenv('REGISTRY_USER') ?: ''
20+
password = System.getenv('REGISTRY_PASSWORD') ?: ''
21+
}
22+
}
23+
container {
24+
setPorts(["5051"].asList())
25+
setCreationTime(Instant.now().toString())
26+
}
27+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.togetherjava.tjbot.website;
2+
3+
import org.springframework.boot.SpringApplication;
4+
import org.springframework.boot.autoconfigure.SpringBootApplication;
5+
6+
/**
7+
* Spring boot application to serve the bots welcome webpage.
8+
*/
9+
@SpringBootApplication
10+
public class Application {
11+
/**
12+
* Starts the application.
13+
*
14+
* @param args Not supported
15+
*/
16+
public static void main(final String[] args) {
17+
SpringApplication.run(Application.class, args);
18+
}
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
server.port=5051
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Together Java</title>
7+
</head>
8+
<body>
9+
<h1>Hello from Together Java</h1>
10+
Visit us at: <a href="https://discord.gg/P3UmanFmvK">discord.gg/P3UmanFmvK</a>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)