Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v1.0.0 #1

Merged
merged 5 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions build.gradle

This file was deleted.

26 changes: 20 additions & 6 deletions handler/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.0.0' apply false
id 'maven-publish'
}

group = 'io.jeyong'
version = '0.0.1-SNAPSHOT'
version = '1.0.0'

ext {
artifactName = 'k8s-sigterm-handler'
}

java {
toolchain {
Expand All @@ -15,14 +19,24 @@ java {

repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
implementation 'org.springframework.boot:spring-boot-starter:3.0.0'
}

tasks.named('test') {
useJUnitPlatform()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = project.group
artifactId = project.ext.artifactName
version = project.version
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ public class HandlerApplication {
public static void main(String[] args) {
SpringApplication.run(HandlerApplication.class, args);
}

}
17 changes: 17 additions & 0 deletions handler/src/main/java/io/jeyong/handler/SigtermListener.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.jeyong.handler;

import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.context.ApplicationListener;
import sun.misc.Signal;

public class SigtermListener implements ApplicationListener<ApplicationReadyEvent> {

@Override
public void onApplicationEvent(ApplicationReadyEvent event) {
Signal.handle(new Signal("TERM"), signal -> handleSigterm());
}

private void handleSigterm() {
System.exit(0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.jeyong.handler.SigtermListener
1 change: 0 additions & 1 deletion handler/src/main/resources/application.properties

This file was deleted.

This file was deleted.

10 changes: 7 additions & 3 deletions test/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.0'
id 'io.spring.dependency-management' version '1.1.6'
id 'org.springframework.boot' version '3.0.0'
id 'io.spring.dependency-management' version '1.1.0'
}

group = 'io.jeyong'
Expand All @@ -18,7 +18,11 @@ repositories {
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
implementation project(':handler')
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
Expand Down
1 change: 0 additions & 1 deletion test/src/main/java/io/jeyong/test/TestApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ public class TestApplication {
public static void main(String[] args) {
SpringApplication.run(TestApplication.class, args);
}

}
1 change: 0 additions & 1 deletion test/src/main/resources/application.properties

This file was deleted.

Empty file.