Skip to content
Open
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
69 changes: 61 additions & 8 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,67 @@ jobs:
go-version: ">=1.19.3"
- run: apt update && apt install -y make
- run: make build-tree
- name: Get registry binary
uses: robinraju/release-downloader@v1.7
- name: Checkout druid-cli
uses: actions/checkout@v3
with:
repository: "highcard-dev/druid-cli"
latest: true
fileName: "druid"
repository: highcard-dev/druid-cli
ref: feat/druid-k8s-runtime-owner
path: .ci/druid-cli
token: ${{ secrets.GO_REPO_TOKEN }}
- run: chmod +x ./druid
- name: Build druid
working-directory: .ci/druid-cli
run: make build
- name: Install druid
run: mv ./druid /usr/local/bin/druid
- run: ./scripts/validate_all_scrolls.sh
run: |
install .ci/druid-cli/bin/druid /usr/local/bin/druid
- name: Validate all scrolls
run: |
set -euo pipefail
for dir in $(find ./scrolls -type f -name scroll.yaml -exec dirname {} \; | sort); do
[ -f "$dir/scroll.yaml" ] || continue
druid validate --strict "$dir"
done
- name: Login to registry
if: github.event.pull_request.head.repo.full_name == github.repository
run: druid login --host ${{ secrets.SCROLL_REGISTRY_HOST }} --user '${{ secrets.SCROLL_REGISTRY_USER }}' --password ${{ secrets.SCROLL_REGISTRY_PASSWORD }}
- name: Ensure experimental registry project
if: github.event.pull_request.head.repo.full_name == github.repository
shell: bash
run: |
set -euo pipefail
registry_host="${{ secrets.SCROLL_REGISTRY_HOST }}"
registry_host="${registry_host#http://}"
registry_host="${registry_host#https://}"
registry_host="${registry_host%%/*}"
status="$(curl -sS -o /tmp/druid-project-create.json -w '%{http_code}' \
-u '${{ secrets.SCROLL_REGISTRY_USER }}:${{ secrets.SCROLL_REGISTRY_PASSWORD }}' \
-H 'Content-Type: application/json' \
-X POST "https://${registry_host}/api/v2.0/projects" \
--data '{"project_name":"druid-team-experimental","metadata":{"public":"false"},"storage_limit":-1}')"
case "$status" in
201|409) ;;
*) cat /tmp/druid-project-create.json; exit 1 ;;
esac
- name: Push experimental Minecraft Vanilla artifacts
if: github.event.pull_request.head.repo.full_name == github.repository
shell: bash
run: |
set -euo pipefail
pr_number="${{ github.event.pull_request.number }}"
for dir in ./scrolls/minecraft/minecraft-vanilla/*; do
[ -f "$dir/scroll.yaml" ] || continue
version="$(basename "$dir")"
druid push "artifacts.druid.gg/druid-team-experimental/scroll-minecraft-vanilla:${version}-pr${pr_number}" "$dir" \
-p main=25565 -p rcon=25575 \
-i artifacts.druid.gg/druid-team/druid:stable-nix \
--min-disk 3Gi --min-ram 512Mi --min-cpu 0.25 \
--smart --category minecraft

if [ "$version" = "1.21.7" ]; then
druid push "artifacts.druid.gg/druid-team-experimental/scroll-minecraft-vanilla:latest-pr${pr_number}" "$dir" \
-p main=25565 -p rcon=25575 \
-i artifacts.druid.gg/druid-team/druid:stable-nix \
--min-disk 3Gi --min-ram 512Mi --min-cpu 0.25 \
--smart --category minecraft
fi
done
226 changes: 113 additions & 113 deletions .github/workflows/release.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/validate_all_scrolls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ ALL_SCROLL_DIRS=$(find . -type f -name "scroll.yaml" -exec dirname {} \; | sort

for SCROLL_DIR in $ALL_SCROLL_DIRS; do
echo "Validating $SCROLL_DIR"
druid scroll validate "$SCROLL_DIR"
druid validate --strict "$SCROLL_DIR"
done
44 changes: 22 additions & 22 deletions scrolls/.sample/sample-variation/sample-version/scroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ name: sample@1.23
desc: Sample Game
version: 0.0.1
app_version: 0.0.1
init: "install"
commands:
start:
should_change_status: start
procedures:
- mode: exec
data:
- sh
- ./start.sh
- image: alpine:3.20
mounts:
- path: "/server"
working_dir: "/server"
command:
- sh
- "./start.sh"
id: start
stop:
type: stop
procedures:
- mode: rcon_web_rust
data:
- quit
- type: signal
target: start
signal: SIGTERM
run: always
install:
should_change_status: start
procedures:
- mode: exec
data:
- steamcmd
- app/resources/druid-deployment
- +login
- anonymous
- +app_update
- 258550
- +quit
plugins:
rcon_web_rust: {}
- image: alpine:3.20
mounts:
- path: "/server"
working_dir: "/server"
command:
- sh
- "-c"
- echo sample install complete
run: once
serve: start
102 changes: 60 additions & 42 deletions scrolls/hytale/hytale-druid-gg/scroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,72 @@ desc: Hytale
version: 0.0.1
app_version: latest
ports:
- name: main
protocol: udp
port: 5520
init: "start"
- name: main
protocol: udp
port: 5520
commands:
install:
run: once
dependencies: [wget, cacert]
procedures:
- mode: exec
data:
- wget
- -q
- -O
- update-server.sh
- https://github.com/highcard-dev/hsm/releases/latest/download/gsp-update-hytale-server.sh
- mode: exec
data:
- wget
- -q
- -O
- start-server.sh
- https://github.com/highcard-dev/hsm/releases/latest/download/gsp-start-hytale-server.sh
- mode: exec
data:
- chmod
- "+x"
- update-server.sh
- start-server.sh
- image: artifacts.druid.gg/druid-team/druid:stable
mounts:
- path: "/server"
working_dir: "/server"
command:
- wget
- "-q"
- "-O"
- update-server.sh
- https://github.com/highcard-dev/hsm/releases/latest/download/gsp-update-hytale-server.sh
- image: artifacts.druid.gg/druid-team/druid:stable
mounts:
- path: "/server"
working_dir: "/server"
command:
- wget
- "-q"
- "-O"
- start-server.sh
- https://github.com/highcard-dev/hsm/releases/latest/download/gsp-start-hytale-server.sh
- image: artifacts.druid.gg/druid-team/druid:stable
mounts:
- path: "/server"
working_dir: "/server"
command:
- chmod
- "+x"
- update-server.sh
- start-server.sh
install-server:
run: once
needs: [install]
dependencies: [wget, cacert, unzip]
needs:
- install
procedures:
- mode: exec
data:
- bash
- -c
- HSM_URL="https://hytale.druid.gg" JWT_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) ./update-server.sh
- image: eclipse-temurin:25-jre
mounts:
- path: "/server"
working_dir: "/server"
command:
- sh
- "-c"
- HSM_URL="https://hytale.druid.gg" JWT_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
./update-server.sh
start:
needs: [install-server]
dependencies: [jdk25]
needs:
- install-server
procedures:
- mode: exec
data:
- bash
- -c
- HSM_URL="https://hytale.druid.gg" JWT_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token) ./start-server.sh

plugins:
rcon: {}
- image: eclipse-temurin:25-jre
mounts:
- path: "/server"
working_dir: "/server"
command:
- sh
- "-c"
- HSM_URL="https://hytale.druid.gg" JWT_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)
./start-server.sh
id: start
expectedPorts:
- name: main
keepAliveTraffic: 10kb/5m
run: restart
serve: start
2 changes: 1 addition & 1 deletion scrolls/hytale/hytale-standalone/data/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ else
fi

echo "Downloading hsm ${VERSION} for ${OS}/${ARCH}..."
curl -fL "$URL" -o hsm
wget -q -O hsm "$URL"
chmod +x hsm
echo "Done"
71 changes: 43 additions & 28 deletions scrolls/hytale/hytale-standalone/scroll.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,57 @@ desc: Hytale
version: 0.0.1
app_version: standalone
ports:
- name: main
protocol: udp
port: 5520
init: "start"
- name: main
protocol: udp
port: 5520
commands:
install-hsm:
run: once
dependencies: [wget, cacert, curl]
procedures:
- mode: exec
data:
- bash
- install.sh
- image: artifacts.druid.gg/druid-team/druid:stable
mounts:
- path: "/server"
working_dir: "/server"
command:
- sh
- install.sh
login:
run: once
needs: [install-hsm]
needs:
- install-hsm
procedures:
- mode: exec
data:
- ./hsm
- login
- image: eclipse-temurin:25-jre
mounts:
- path: "/server"
working_dir: "/server"
command:
- "./hsm"
- login
update:
needs: [login]
needs:
- login
procedures:
- mode: exec
data:
- ./hsm
- update
- image: eclipse-temurin:25-jre
mounts:
- path: "/server"
working_dir: "/server"
command:
- "./hsm"
- update
start:
needs: [update]
dependencies: [jdk25]
needs:
- update
procedures:
- mode: exec
data:
- ./hsm
- start

plugins:
rcon: {}
- image: eclipse-temurin:25-jre
mounts:
- path: "/server"
working_dir: "/server"
command:
- "./hsm"
- start
id: start
expectedPorts:
- name: main
keepAliveTraffic: 10kb/5m
run: restart
serve: start
Loading
Loading