Compare commits
No commits in common. "155412f0fa411b2ad4c08b4aedffd3f8ae25d4b1" and "c2f8f9261324a8ced3f530265607bf65d678609f" have entirely different histories.
155412f0fa
...
c2f8f92613
24
.github/workflows/build.yml
vendored
24
.github/workflows/build.yml
vendored
@ -3,12 +3,7 @@
|
|||||||
|
|
||||||
name: Build
|
name: Build
|
||||||
|
|
||||||
on:
|
on: push
|
||||||
push:
|
|
||||||
branches-ignore:
|
|
||||||
- "renovate/**"
|
|
||||||
tags-ignore:
|
|
||||||
- "**"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-gradle:
|
build-gradle:
|
||||||
@ -19,9 +14,8 @@ jobs:
|
|||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: 17
|
java-version: 17
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
@ -52,10 +46,10 @@ jobs:
|
|||||||
path: build/libs/
|
path: build/libs/
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
- name: Login to ghcr.io
|
- name: Login to ghcr.io
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v1
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.repository_owner }}
|
username: ${{ github.repository_owner }}
|
||||||
@ -63,14 +57,20 @@ jobs:
|
|||||||
|
|
||||||
- name: Get branch name
|
- name: Get branch name
|
||||||
id: branch-name
|
id: branch-name
|
||||||
uses: tj-actions/branch-names@v5.3
|
uses: tj-actions/branch-names@v5.2
|
||||||
|
|
||||||
|
- name: Set tag master
|
||||||
|
if: steps.branch-name.outputs.current_branch == 'master'
|
||||||
|
run: |
|
||||||
|
echo "tag=latest" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set tag
|
- name: Set tag
|
||||||
|
if: steps.branch-name.outputs.current_branch != 'master'
|
||||||
run: |
|
run: |
|
||||||
echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
|
echo "tag=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Build and push Docker
|
- name: Build and push Docker
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
context: .
|
context: .
|
||||||
|
78
.github/workflows/release.yml
vendored
78
.github/workflows/release.yml
vendored
@ -1,78 +0,0 @@
|
|||||||
# This workflow will build a Java project with Gradle
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
||||||
|
|
||||||
name: Build Release
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "**"
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-gradle:
|
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Set up JDK 17
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: 17
|
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
|
||||||
run: chmod +x gradlew
|
|
||||||
|
|
||||||
- name: Build with Gradle
|
|
||||||
run: ./gradlew build
|
|
||||||
|
|
||||||
- name: Upload Jar File
|
|
||||||
uses: actions/upload-artifact@v2-preview
|
|
||||||
with:
|
|
||||||
name: claptrap_jar
|
|
||||||
path: build/libs/
|
|
||||||
|
|
||||||
build-docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs:
|
|
||||||
- build-gradle
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Download artifact
|
|
||||||
uses: actions/download-artifact@v3.0.0
|
|
||||||
with:
|
|
||||||
# Artifact name
|
|
||||||
name: claptrap_jar
|
|
||||||
# Destination path
|
|
||||||
path: build/libs/
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to ghcr.io
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.repository_owner }}
|
|
||||||
password: ${{ secrets.CR_PAT }}
|
|
||||||
|
|
||||||
- name: Get branch name
|
|
||||||
id: branch-name
|
|
||||||
uses: tj-actions/branch-names@v5.3
|
|
||||||
|
|
||||||
- name: Set tag
|
|
||||||
run: |
|
|
||||||
echo "tag=${{ steps.branch-name.outputs.tag }}" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build and push Docker
|
|
||||||
uses: docker/build-push-action@v3
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
context: .
|
|
||||||
tags: |
|
|
||||||
ghcr.io/sebclem/claptrapbot:${{ env.tag }}
|
|
||||||
ghcr.io/sebclem/claptrapbot:latest
|
|
||||||
file: ./Dockerfile
|
|
@ -1,10 +1,10 @@
|
|||||||
FROM openjdk:18.0.1
|
FROM openjdk:17.0.2
|
||||||
WORKDIR /bot_src
|
WORKDIR /bot_src
|
||||||
ARG BUILD_NBR
|
ARG BUILD_NBR
|
||||||
ARG BRANCH_NAME
|
ARG BRANCH_NAME
|
||||||
ARG BRANCH_NAME
|
ARG BRANCH_NAME
|
||||||
ARG GITHUB_RUN_NUMBER
|
ARG GITHUB_RUN_NUMBER
|
||||||
ADD build/libs/ClaptrapBot.jar /bot_src/claptrapbot.jar
|
ADD build/libs/ClaptrapBot-*.jar /bot_src/bot.jar
|
||||||
RUN java -version
|
RUN java -version
|
||||||
CMD java -jar claptrapbot.jar
|
CMD java -jar bot.jar
|
||||||
LABEL org.opencontainers.image.source=https://github.com/Sebclem/ClaptrapBot/
|
LABEL org.opencontainers.image.source=https://github.com/Sebclem/ClaptrapBot/
|
46
build.gradle
46
build.gradle
@ -4,14 +4,19 @@ plugins {
|
|||||||
id 'java'
|
id 'java'
|
||||||
id 'groovy'
|
id 'groovy'
|
||||||
id 'org.liquibase.gradle' version '2.1.1'
|
id 'org.liquibase.gradle' version '2.1.1'
|
||||||
id "nebula.lint" version "17.7.0"
|
id "nebula.lint" version "16.26.0"
|
||||||
id "com.gorylenko.gradle-git-properties" version "2.4.1"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def versionObj = new Version(major: 0, minor: 2, revision: 0)
|
||||||
|
|
||||||
group = "net.broken"
|
group = "net.broken"
|
||||||
archivesBaseName = "ClaptrapBot"
|
archivesBaseName = "ClaptrapBot"
|
||||||
|
version = "$versionObj"
|
||||||
|
|
||||||
sourceCompatibility = '17'
|
sourceCompatibility = '17'
|
||||||
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
maven {
|
maven {
|
||||||
@ -22,6 +27,7 @@ jar {
|
|||||||
enabled(false)
|
enabled(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
configurations.implementation {
|
configurations.implementation {
|
||||||
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
|
exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
|
||||||
}
|
}
|
||||||
@ -32,8 +38,6 @@ dependencies {
|
|||||||
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-log4j2")
|
implementation("org.springframework.boot:spring-boot-starter-log4j2")
|
||||||
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
|
implementation("org.springframework.boot:spring-boot-starter-oauth2-client")
|
||||||
implementation('org.springframework.boot:spring-boot-starter-actuator')
|
|
||||||
implementation('io.micrometer:micrometer-registry-prometheus:1.9.1')
|
|
||||||
|
|
||||||
implementation('org.springdoc:springdoc-openapi-ui:1.6.9')
|
implementation('org.springdoc:springdoc-openapi-ui:1.6.9')
|
||||||
implementation('org.springdoc:springdoc-openapi-security:1.6.9')
|
implementation('org.springdoc:springdoc-openapi-security:1.6.9')
|
||||||
@ -44,28 +48,28 @@ dependencies {
|
|||||||
implementation('io.jsonwebtoken:jjwt-impl:0.11.5')
|
implementation('io.jsonwebtoken:jjwt-impl:0.11.5')
|
||||||
implementation('io.jsonwebtoken:jjwt-jackson:0.11.5')
|
implementation('io.jsonwebtoken:jjwt-jackson:0.11.5')
|
||||||
|
|
||||||
implementation('com.sedmelluq:lavaplayer:1.3.78')
|
implementation 'com.sedmelluq:lavaplayer:1.3.77'
|
||||||
implementation('net.dv8tion:JDA:4.4.0_350')
|
implementation 'net.dv8tion:JDA:4.4.0_350'
|
||||||
|
|
||||||
implementation(platform("org.apache.logging.log4j:log4j-bom:2.17.2"))
|
implementation(platform("org.apache.logging.log4j:log4j-bom:2.17.1"))
|
||||||
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '7.0.4.Final'
|
implementation group: 'org.hibernate', name: 'hibernate-validator', version: '7.0.4.Final'
|
||||||
|
|
||||||
// Use MySQL Connector-J
|
// Use MySQL Connector-J
|
||||||
implementation('mysql:mysql-connector-java:8.0.29')
|
implementation 'mysql:mysql-connector-java:8.0.29'
|
||||||
implementation('org.reflections:reflections:0.10.2')
|
implementation 'org.reflections:reflections:0.10.2'
|
||||||
implementation('org.apache.commons:commons-lang3:3.12.0')
|
implementation 'org.apache.commons:commons-lang3:3.12.0'
|
||||||
|
|
||||||
|
|
||||||
liquibaseRuntime('org.liquibase:liquibase-core:4.12.0')
|
liquibaseRuntime 'org.liquibase:liquibase-core:4.12.0'
|
||||||
liquibaseRuntime('org.liquibase:liquibase-groovy-dsl:3.0.2')
|
liquibaseRuntime 'org.liquibase:liquibase-groovy-dsl:3.0.2'
|
||||||
liquibaseRuntime('mysql:mysql-connector-java:8.0.29')
|
liquibaseRuntime 'mysql:mysql-connector-java:8.0.29'
|
||||||
liquibaseRuntime group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
|
liquibaseRuntime group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
|
||||||
liquibaseRuntime group: 'org.liquibase.ext', name: 'liquibase-hibernate5', version: '4.12.0'
|
liquibaseRuntime group: 'org.liquibase.ext', name: 'liquibase-hibernate5', version: '4.12.0'
|
||||||
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-data-jpa'
|
liquibaseRuntime 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
liquibaseRuntime 'org.springframework.data:spring-data-jpa'
|
liquibaseRuntime 'org.springframework.data:spring-data-jpa'
|
||||||
liquibaseRuntime 'org.springframework:spring-beans'
|
liquibaseRuntime 'org.springframework:spring-beans'
|
||||||
liquibaseRuntime 'net.dv8tion:JDA:4.4.0_350'
|
liquibaseRuntime 'net.dv8tion:JDA:4.4.0_350'
|
||||||
liquibaseRuntime 'com.sedmelluq:lavaplayer:1.3.78'
|
liquibaseRuntime 'com.sedmelluq:lavaplayer:1.3.77'
|
||||||
liquibaseRuntime sourceSets.main.output
|
liquibaseRuntime sourceSets.main.output
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -85,3 +89,17 @@ liquibase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class Version {
|
||||||
|
String major, minor, revision
|
||||||
|
|
||||||
|
static String getBuild() {
|
||||||
|
System.getenv("GITHUB_RUN_NUMBER") ?: System.getProperty("BUILD_NUMBER") ?:
|
||||||
|
System.getenv("GIT_COMMIT")?.substring(0, 7) ?: System.getProperty("GIT_COMMIT")?.substring(0, 7) ?: "DEV"
|
||||||
|
}
|
||||||
|
|
||||||
|
String toString() {
|
||||||
|
"${major}.${minor}.${revision}_$build"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -2,5 +2,5 @@
|
|||||||
"extends": [
|
"extends": [
|
||||||
"config:base"
|
"config:base"
|
||||||
],
|
],
|
||||||
"commitMessagePrefix": ":arrow_up:"
|
"commitMessageSuffix": "[skip ci]"
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ public class GuildController {
|
|||||||
|
|
||||||
@GetMapping("inviteLink")
|
@GetMapping("inviteLink")
|
||||||
public InviteLink getInviteLink() {
|
public InviteLink getInviteLink() {
|
||||||
|
String link = MainBot.jda.setRequiredScopes("applications.commands").getInviteUrl(Permission.getPermissions(1644971949399L));
|
||||||
return new InviteLink(guildService.getInviteLink());
|
return new InviteLink(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{guildId}/voiceChannels")
|
@GetMapping("/{guildId}/voiceChannels")
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
package net.Broken.Api.Controllers;
|
||||||
|
|
||||||
|
import net.Broken.Api.Security.Data.JwtPrincipal;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/v2/hello")
|
||||||
|
@CrossOrigin(origins = "*", maxAge = 3600)
|
||||||
|
public class HelloController {
|
||||||
|
|
||||||
|
|
||||||
|
@GetMapping("world")
|
||||||
|
public String helloWorld(Authentication authentication){
|
||||||
|
JwtPrincipal principal = (JwtPrincipal) authentication.getPrincipal();
|
||||||
|
return "Hello " + principal.user().getUsername();
|
||||||
|
}
|
||||||
|
}
|
@ -2,34 +2,33 @@ package net.Broken.Api.OpenApi;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.models.Components;
|
import io.swagger.v3.oas.models.Components;
|
||||||
import io.swagger.v3.oas.models.OpenAPI;
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
import io.swagger.v3.oas.models.info.Info;
|
|
||||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||||
import io.swagger.v3.oas.models.security.SecurityScheme;
|
import io.swagger.v3.oas.models.security.SecurityScheme;
|
||||||
import io.swagger.v3.oas.models.servers.Server;
|
import io.swagger.v3.oas.models.servers.Server;
|
||||||
import net.Broken.VersionLoader;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class OpenApiConfig {
|
public class OpenApiConfig {
|
||||||
private final VersionLoader versionLoader;
|
|
||||||
|
|
||||||
public OpenApiConfig(VersionLoader version) {
|
|
||||||
this.versionLoader = version;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public OpenAPI customOpenAPI() {
|
public OpenAPI customOpenAPI() {
|
||||||
final String securitySchemeName = "JWT";
|
final String securitySchemeName = "JWT";
|
||||||
return new OpenAPI().addSecurityItem(
|
|
||||||
new SecurityRequirement().addList(securitySchemeName)).components(
|
// final String apiTitle = String.format("%s API", StringUtils.capitalize(moduleName));
|
||||||
new Components().addSecuritySchemes(
|
return new OpenAPI()
|
||||||
securitySchemeName,
|
.addSecurityItem(new SecurityRequirement().addList(securitySchemeName))
|
||||||
new SecurityScheme().name(securitySchemeName)
|
.components(
|
||||||
|
new Components()
|
||||||
|
.addSecuritySchemes(securitySchemeName,
|
||||||
|
new SecurityScheme()
|
||||||
|
.name(securitySchemeName)
|
||||||
.type(SecurityScheme.Type.HTTP)
|
.type(SecurityScheme.Type.HTTP)
|
||||||
.scheme("bearer")
|
.scheme("bearer")
|
||||||
.bearerFormat("JWT"))
|
.bearerFormat("JWT")
|
||||||
).addServersItem(new Server().url("/").description("Default"))
|
)
|
||||||
.info(new Info().title("ClaptrapBot API").version(versionLoader.getVersion()));
|
)
|
||||||
|
.addServersItem(new Server().url("/").description("Default"));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -29,7 +29,6 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.antMatchers("/swagger-ui/**").permitAll()
|
.antMatchers("/swagger-ui/**").permitAll()
|
||||||
.antMatchers("/swagger-ui.html").permitAll()
|
.antMatchers("/swagger-ui.html").permitAll()
|
||||||
.antMatchers("/v3/api-docs/**").permitAll()
|
.antMatchers("/v3/api-docs/**").permitAll()
|
||||||
.antMatchers("/actuator/**").permitAll()
|
|
||||||
.anyRequest().authenticated();
|
.anyRequest().authenticated();
|
||||||
|
|
||||||
http.addFilterBefore(jwtFilter(), UsernamePasswordAuthenticationFilter.class);
|
http.addFilterBefore(jwtFilter(), UsernamePasswordAuthenticationFilter.class);
|
||||||
|
@ -66,9 +66,4 @@ public class GuildService {
|
|||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public String getInviteLink(){
|
|
||||||
return MainBot.jda.setRequiredScopes("applications.commands").getInviteUrl(Permission.getPermissions(1644971949399L));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@ import javax.security.auth.login.LoginException;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class Init {
|
public class Init {
|
||||||
static private final Logger logger = LogManager.getLogger();
|
static private final Logger logger = LogManager.getLogger();
|
||||||
|
|
||||||
|
@ -7,9 +7,6 @@ import org.springframework.boot.SpringApplication;
|
|||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||||
import org.springframework.context.ConfigurableApplicationContext;
|
import org.springframework.context.ConfigurableApplicationContext;
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
|
||||||
import org.springframework.core.io.ClassPathResource;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
@ -35,14 +32,11 @@ public class MainBot {
|
|||||||
|
|
||||||
ConfigurableApplicationContext ctx = SpringApplication.run(MainBot.class, args);
|
ConfigurableApplicationContext ctx = SpringApplication.run(MainBot.class, args);
|
||||||
BotConfigLoader config = ctx.getBean(BotConfigLoader.class);
|
BotConfigLoader config = ctx.getBean(BotConfigLoader.class);
|
||||||
VersionLoader versionLoader = ctx.getBean(VersionLoader.class);
|
|
||||||
|
|
||||||
logger.info("=======================================");
|
logger.info("=======================================");
|
||||||
logger.info("--------------Starting Bot-------------");
|
logger.info("--------------Starting Bot-------------");
|
||||||
logger.info("=======================================");
|
logger.info("=======================================");
|
||||||
|
|
||||||
logger.info("Version: " + versionLoader.getVersion());
|
|
||||||
|
|
||||||
jda = Init.initJda(config);
|
jda = Init.initJda(config);
|
||||||
if (jda == null) {
|
if (jda == null) {
|
||||||
System.exit(SpringApplication.exit(ctx, () -> {
|
System.exit(SpringApplication.exit(ctx, () -> {
|
||||||
@ -53,14 +47,4 @@ public class MainBot {
|
|||||||
Init.polish(jda, config);
|
Init.polish(jda, config);
|
||||||
ready = true;
|
ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
|
||||||
public static PropertySourcesPlaceholderConfigurer placeholderConfigurer() {
|
|
||||||
PropertySourcesPlaceholderConfigurer propsConfig
|
|
||||||
= new PropertySourcesPlaceholderConfigurer();
|
|
||||||
propsConfig.setLocation(new ClassPathResource("git.properties"));
|
|
||||||
propsConfig.setIgnoreResourceNotFound(true);
|
|
||||||
propsConfig.setIgnoreUnresolvablePlaceholders(true);
|
|
||||||
return propsConfig;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
package net.Broken;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
@Component
|
|
||||||
public class VersionLoader {
|
|
||||||
@Value("${git.branch}")
|
|
||||||
private String branch;
|
|
||||||
@Value("${git.tags}")
|
|
||||||
private String tags;
|
|
||||||
@Value("${git.commit.id.abbrev}")
|
|
||||||
private String commitId;
|
|
||||||
|
|
||||||
public String getVersion(){
|
|
||||||
String version;
|
|
||||||
if(tags.isEmpty()){
|
|
||||||
version = "DEV-" + branch + "-" + commitId;
|
|
||||||
}else{
|
|
||||||
version = tags;
|
|
||||||
}
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,18 +28,3 @@ discord:
|
|||||||
|
|
||||||
springdoc:
|
springdoc:
|
||||||
paths-to-match: /api/v2/**
|
paths-to-match: /api/v2/**
|
||||||
show-actuator: true
|
|
||||||
|
|
||||||
management:
|
|
||||||
info:
|
|
||||||
git:
|
|
||||||
mode: full
|
|
||||||
enabled: true
|
|
||||||
endpoints:
|
|
||||||
enabled-by-default: true
|
|
||||||
web:
|
|
||||||
exposure:
|
|
||||||
include: health, info, prometheus
|
|
||||||
endpoint:
|
|
||||||
prometheus:
|
|
||||||
enabled: true
|
|
Loading…
Reference in New Issue
Block a user