Skip to content

Commit

Permalink
TEST: mod support
Browse files Browse the repository at this point in the history
  • Loading branch information
wiemanboy committed Jan 17, 2025
1 parent 3e0d93c commit 2ec577c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ build\:swarm:
sudo docker swarm init

deploy:
chmod +x ./envsubstitute.sh; \
for file in swarm-compose*.yml; do \
if [ -f "$$file" ]; then \
./envsubstitute.sh $$file; \
files="$$files -c $$file"; \
fi; \
done; \
sudo docker stack deploy $$files server

update:
sudo docker service update --image $(image):$(version) $(service)
Expand Down
26 changes: 26 additions & 0 deletions envsubstitute.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Check if filename is provided
if [ -z "$1" ]; then
echo "Usage: $0 <filename>"
exit 1
fi

# Get the filename from the first argument
filename="$1"

# Check if the file exists
if [ ! -f "$filename" ]; then
echo "File '$filename' not found!"
exit 1
fi

# Process the file
while IFS= read -r line; do
while [[ "$line" =~ %%([^%]+)%% ]]; do
varname="${BASH_REMATCH[1]}"
varvalue="${!varname}"
line="${line//%%$varname%%/$varvalue}"
done
echo "$line"
done < "$filename" > temp.yml && mv temp.yml "$filename"
11 changes: 6 additions & 5 deletions swarm-compose.minecraft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@ services:
networks:
- reverse_proxy_network
- minecraft_network
image: itzg/minecraft-server
image: itzg/minecraft-server:java8
tty: true
stdin_open: true
environment:
EULA: "TRUE"
MAX_MEMORY: "16G"
TYPE: "FABRIC"
VERSION: "SNAPSHOT"
TYPE: "FORGE"
VERSION: "1.12.2"
DIFFICULTY: "hard"
ICON: "https://jarnowieman.nl/api/files/minecraft/server_icon"
MOTD: "§l§5WiemanServer§r\n§rWelcome to my server!"
VANILLATWEAKS_SHARECODE: "cFTVFy,M6j9tu"
DATAPACKS: ""
CF_API_KEY: $${CF_API_KEY}
CF_PAGE_URL: "https://www.curseforge.com/minecraft/modpacks/rlcraft/files/4612979"
CF_API_KEY: %%CF_API_KEY%%
MAX_PLAYERS: "20"
SNOOPER_ENABLED: "false"
MAX_BUILD_HEIGHT: "256"
SPAWN_PROTECTION: "0"
VIEW_DISTANCE: "10"
LEVEL: "world"
LEVEL: "rlcraft"
ALLOW_FLIGHT: "TRUE"
SERVER_NAME: "WiemanServer"
PLAYER_IDLE_TIMEOUT: "0"
Expand Down

0 comments on commit 2ec577c

Please sign in to comment.