Compare commits

...

4 Commits

Author SHA1 Message Date
Jef Roosens 5a69234877
feat: better env var support
ci/woodpecker/push/release unknown status Details
ci/woodpecker/push/lint Pipeline was successful Details
ci/woodpecker/push/clippy Pipeline was successful Details
ci/woodpecker/push/build Pipeline was successful Details
2023-06-05 11:33:44 +02:00
Jef Roosens b023516162
fix(ci): dumb mistake
ci/woodpecker/push/build unknown status Details
ci/woodpecker/push/clippy unknown status Details
ci/woodpecker/push/lint unknown status Details
ci/woodpecker/push/release Pipeline was successful Details
2023-06-05 10:51:25 +02:00
Jef Roosens 6092b15f25
chore: fix ci config
ci/woodpecker/push/build unknown status Details
ci/woodpecker/push/clippy unknown status Details
ci/woodpecker/push/lint unknown status Details
ci/woodpecker/push/release Pipeline was successful Details
ci/woodpecker/tag/lint Pipeline was successful Details
ci/woodpecker/tag/clippy Pipeline was successful Details
ci/woodpecker/tag/build Pipeline was successful Details
ci/woodpecker/tag/release Pipeline failed Details
2023-06-05 10:47:23 +02:00
Jef Roosens 3c846f7b2c
chore: update changelog
ci/woodpecker/push/build unknown status Details
ci/woodpecker/push/clippy unknown status Details
ci/woodpecker/push/lint unknown status Details
ci/woodpecker/push/release Pipeline is pending Details
ci/woodpecker/tag/release Pipeline is pending Details
ci/woodpecker/tag/lint Pipeline was successful Details
ci/woodpecker/tag/clippy Pipeline was successful Details
ci/woodpecker/tag/build Pipeline was successful Details
2023-06-05 10:41:55 +02:00
7 changed files with 52 additions and 18 deletions

View File

@ -1,2 +1,2 @@
[alias]
runs = "run -- paper 1.19.4-545 --config data/config --backup data/backups --world data/worlds data/paper-1.19.4-545.jar"
runs = "run -- paper --config data/config --backup data/backups --world data/worlds --jar data/paper.jar"

View File

@ -17,3 +17,5 @@ pipeline:
- cargo test --verbose
# Binaries, even debug ones, should be statically compiled
- '[ "$(readelf -d target/debug/alex | grep NEEDED | wc -l)" = 0 ]'
when:
event: [push]

View File

@ -9,3 +9,5 @@ pipeline:
commands:
- rustup component add clippy
- cargo clippy -- --no-deps -Dwarnings
when:
event: [push]

View File

@ -9,3 +9,5 @@ pipeline:
commands:
- rustup component add rustfmt
- cargo fmt -- --check
when:
event: [push]

View File

@ -3,7 +3,7 @@ matrix:
- 'linux/amd64'
# - 'linux/arm64'
platform: $PLATFORM
platform: ${PLATFORM}
branches: [ main ]
pipeline:
@ -15,7 +15,7 @@ pipeline:
# Ensure the release binary is also statically compiled
- '[ "$(readelf -d target/release/alex | grep NEEDED | wc -l)" = 0 ]'
- du -h target/release/alex
- mv target/release/alex target/release/alex-$(echo '${PLATFORM}' | sed 's:/:-:g')"
- mv target/release/alex target/release/alex-"$(echo '${PLATFORM}' | sed 's:/:-:g')"
when:
event: tag

View File

@ -7,9 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased](https://git.rustybever.be/Chewing_Bever/alex/src/branch/dev)
### Changed
* Better env var support
## [0.1.0](https://git.rustybever.be/Chewing_Bever/alex/src/tag/0.1.0)
### Added
* CLI interface
* Working backup command
* Thread for periodic backups
* Env var support

View File

@ -12,19 +12,41 @@ struct Cli {
/// Type of server
type_: ServerType,
/// Version string for the server, e.g. 1.19.4-545
#[arg(env = "ALEX_SERVER_VERSION")]
server_version: String,
/// Server jar to execute
jar: PathBuf,
/// Directory where configs are stored, and where the server will run [default: .]
#[arg(long, value_name = "CONFIG_DIR", env = "ALEX_CONFIG_DIR")]
config: Option<PathBuf>,
/// Directory where world files will be saved [default: ../worlds]
#[arg(long, value_name = "WORLD_DIR", env = "ALEX_WORLD_DIR")]
world: Option<PathBuf>,
/// Directory where backups will be stored [default: ../backups]
#[arg(long, value_name = "BACKUP_DIR", env = "ALEX_WORLD_DIR")]
backup: Option<PathBuf>,
/// Server jar to execute
#[arg(
long,
value_name = "JAR_PATH",
default_value = "server.jar",
env = "ALEX_JAR"
)]
jar: PathBuf,
/// Directory where configs are stored, and where the server will run
#[arg(
long,
value_name = "CONFIG_DIR",
default_value = ".",
env = "ALEX_CONFIG_DIR"
)]
config: PathBuf,
/// Directory where world files will be saved
#[arg(
long,
value_name = "WORLD_DIR",
default_value = "../worlds",
env = "ALEX_WORLD_DIR"
)]
world: PathBuf,
/// Directory where backups will be stored
#[arg(
long,
value_name = "BACKUP_DIR",
default_value = "../backups",
env = "ALEX_WORLD_DIR"
)]
backup: PathBuf,
/// Java command to run the server jar with
#[arg(long, value_name = "JAVA_CMD", default_value_t = String::from("java"), env = "ALEX_JAVA")]
java: String,
@ -63,9 +85,9 @@ fn main() {
let cmd = server::ServerCommand::new(cli.type_, &cli.server_version)
.java(&cli.java)
.jar(cli.jar)
.config(cli.config.unwrap_or(".".into()))
.world(cli.world.unwrap_or("../worlds".into()))
.backup(cli.backup.unwrap_or("../backups".into()))
.config(cli.config)
.world(cli.world)
.backup(cli.backup)
.xms(cli.xms)
.xmx(cli.xmx)
.max_backups(cli.max_backups);