forked from Fascinated/Bat
impl ci
This commit is contained in:
parent
ac3529ed88
commit
b703f51868
31
.gitea/workflows/ci.yml
Normal file
31
.gitea/workflows/ci.yml
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
name: Deploy to Dokku
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["master"]
|
||||||
|
paths-ignore:
|
||||||
|
- .gitignore
|
||||||
|
- README.md
|
||||||
|
- LICENSE
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
arch: ["ubuntu-latest"]
|
||||||
|
runs-on: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
# Steps to run
|
||||||
|
steps:
|
||||||
|
# Checkout the repo
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
# Deploy to Dokku
|
||||||
|
- name: Push to dokku
|
||||||
|
uses: dokku/github-action@master
|
||||||
|
with:
|
||||||
|
git_remote_url: "ssh://dokku@10.0.50.232:22/bat"
|
||||||
|
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
|
47
pom.xml
47
pom.xml
@ -20,14 +20,57 @@
|
|||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<!-- Used for compiling the source code with the proper Java version -->
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java.version}</source>
|
||||||
|
<target>${java.version}</target>
|
||||||
|
|
||||||
|
<!-- Enable incremental builds, this is reversed due to -->
|
||||||
|
<!-- a bug as seen in https://issues.apache.org/jira/browse/MCOMPILER-209 -->
|
||||||
|
<useIncrementalCompilation>false</useIncrementalCompilation>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Handles shading of dependencies in the final output jar -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<version>3.5.3</version>
|
||||||
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- Specify the apps main class -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<mainClass>cc.fascinated.bat.BatApplication</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<!-- Spring -->
|
<!-- Spring -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -1,16 +1,24 @@
|
|||||||
package cc.fascinated.bat.common;
|
package cc.fascinated.bat.common;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
import java.text.NumberFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Fascinated (fascinated7)
|
* @author Fascinated (fascinated7)
|
||||||
*/
|
*/
|
||||||
public class NumberUtils {
|
public class NumberUtils {
|
||||||
/**
|
/**
|
||||||
* Formats a number with commas.
|
* Formats a number with commas.
|
||||||
|
* <p>
|
||||||
|
* Example: 1000 -> 1,000 | Example: 1000.5 -> 1,000.5
|
||||||
|
* </p>
|
||||||
*
|
*
|
||||||
* @param number the number to format
|
* @param number the number to format
|
||||||
* @return the formatted number
|
* @return the formatted number
|
||||||
*/
|
*/
|
||||||
public static String formatNumberCommas(double number) {
|
public static String formatNumberCommas(double number) {
|
||||||
return String.format("%,.0f", number);
|
NumberFormat format = NumberFormat.getNumberInstance();
|
||||||
|
format.setGroupingUsed(true);
|
||||||
|
return format.format(number);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -98,13 +98,7 @@ public class CommandService extends ListenerAdapter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Register all commands
|
// Register all commands
|
||||||
for (BatCommand command : commands.values()) {
|
jda.updateCommands().addCommands(commands.values().stream().map(BatCommand::getCommandData).toList()).complete();
|
||||||
if (command.getCommandData() == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
jda.upsertCommand(command.getCommandData()).complete(); // Register the command on Discord
|
|
||||||
}
|
|
||||||
log.info("Registered all slash commands in {}ms", System.currentTimeMillis() - before);
|
log.info("Registered all slash commands in {}ms", System.currentTimeMillis() - before);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,5 +10,5 @@ spring:
|
|||||||
# MongoDB Configuration
|
# MongoDB Configuration
|
||||||
mongodb:
|
mongodb:
|
||||||
uri: "mongodb://bat:p4$$w0rd@localhost:27017"
|
uri: "mongodb://bat:p4$$w0rd@localhost:27017"
|
||||||
database: "bonfire"
|
database: "bat"
|
||||||
auto-index-creation: true # Automatically create collection indexes
|
auto-index-creation: true # Automatically create collection indexes
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package cc.fascinated.bat;
|
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test;
|
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
|
||||||
|
|
||||||
@SpringBootTest
|
|
||||||
class BatApplicationTests {
|
|
||||||
|
|
||||||
@Test
|
|
||||||
void contextLoads() {
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user