Skip to content

Commit

Permalink
feat: โœจ Adds server startup information (#32) #minor
Browse files Browse the repository at this point in the history
* build: add auto-labeler and sponsors information (#17)

* Update README.md

* Create sponsors.yml

* Create label.yml

* test: resolve issue thing

* style: remove typo

* chore: update

* build(deps): bump softprops/action-gh-release from 1 to 2 (#18)

Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 1 to 2.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](softprops/action-gh-release@v1...v2)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* build(deps): bump actions/checkout from 3 to 4 (#19)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: ๐Ÿ“ Improve documentation (#21)

* docs: docker whale image

* Update README.md

* Update README.md

* Update README.md

* docs: add more examples

* docs: add more examples

* docs: improve docs

* Update README.md

* Update README.md

* Update README.md

* test

* Update BUILDING_AN_IMAGE.md

* Update label.yml

* Delete crowbar.png

* Update README.md

* Update sponsors.yml

* docs: more doc improvements/spell checks etc

* Deploying to beta from @ ee94d7c ๐Ÿš€

* Update sponsors.yml

* Update README.md

* docs: server -> joinable not error

* Update CUSTOM_MODS.md

* Update SERVER_CONFIGS_AND_PLUGINS.md

* Update README.md

* Update README.md

* Update BUG.yml

* docs: fix clipping issue

* build: ๐Ÿ”ง adjust docker-compose.local to docker-compose.build as it more accurately describes its task

* feat: split things into container dir

* docs: shuffle docs around

* Update beta.yml

* Update publish.yml

* Update README.md

* docs: improve REAMDE

* Update README.md

* Update CONTRIBUTING.md

* docs: remove old examples

* docs: cleanup docs

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* docs: more doc examples.

* Update docker-compose.yml

* Update .gitignore

* Update entrypoint.sh

* build(deps): bump anothrNick/github-tag-action from 1.69.0 to 1.70.0 (#24)

Bumps [anothrNick/github-tag-action](https://github.com/anothrnick/github-tag-action) from 1.69.0 to 1.70.0.
- [Release notes](https://github.com/anothrnick/github-tag-action/releases)
- [Commits](anothrNick/github-tag-action@1.69.0...1.70.0)

---
updated-dependencies:
- dependency-name: anothrNick/github-tag-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* docs: ๐Ÿ“ Improved bug report form and added rcon_password example (#26)

* Update BUG.yml

* t

* Update BUG.yml

* Update BUG.yml

* docs: include private sponsors [skip ci]

* chore: Update sponsors ๐Ÿ’– [skip ci]

* docs: update sponsors again [skip ci]

* chore: Update sponsors ๐Ÿ’– [skip ci]

* Update sponsors.yml

* chore: Update sponsors ๐Ÿ’– [skip ci]

* chore: Update sponsors ๐Ÿ’– [skip ci]

* feat: support titles with legacy beta versions, ie valve-legacy, cstrike-legacy and czero-legacy

* fix: properly pass in flags

* fix: adjust how flags are passed in

* build: ๐Ÿ”ง Rename FLAGS -> FLAG to mirror GAME

* fix: pass in correct game name

* docs: remove build: docker as its not needed

* build(startup): ๐Ÿ”ง Setup initial build debug scripts

* build: add meta data for image

* fix: adjust ordering of ascii art

* chore: adjust default startup to use hldm

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: JamesIves <JamesIves@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 9, 2024
1 parent 5fc9658 commit 83f5faa
Show file tree
Hide file tree
Showing 7 changed files with 88 additions and 18 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,17 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: beta
IMAGE: jives/hlds:${{ matrix.game }}-beta
with:
context: ./container
push: true
tags: jives/hlds:${{ matrix.game }}-beta
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
IMAGE=jives/hlds:${{ matrix.game }}-beta
VERSION=beta
- name: Set repo owner to lowercase
id: repo_owner
Expand All @@ -88,10 +92,14 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: beta
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
with:
context: ./container
push: true
tags: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
VERSION=beta
IMAGE=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
DRY_RUN: true

build:
Expand Down Expand Up @@ -91,6 +90,8 @@ jobs:
env:
GAME: ${{ env.GAME }}
FLAG: ${{ env.FLAG }}
VERSION: ${{ needs.version.outputs.version }}
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
with:
context: ./container
push: true
Expand All @@ -100,6 +101,8 @@ jobs:
build-args: |
GAME=${{ env.GAME}}
FLAG=${{ env.FLAG }}
VERSION=${{ needs.version.outputs.version }}
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
- name: Set repo owner to lowercase
id: repo_owner
Expand All @@ -110,6 +113,8 @@ jobs:
env:
GAME: ${{ matrix.game }}
FLAG: ${{ env.FLAG }}
VERSION: ${{ needs.version.outputs.version }}
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
with:
context: ./container
push: true
Expand All @@ -119,6 +124,8 @@ jobs:
build-args: |
GAME=${{ env.GAME }}
FLAG=${{ env.FLAG }}
VERSION=${{ needs.version.outputs.version }}
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
publish:
needs: build
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ docker run -d \
-p 27015:27015 \
-p 26900:26900/udp \
-e GAME=${GAME} \
jives/hlds:cstrike \
"+log on +rcon_password changeme +maxplayers 12 +map cs_italy" # ๐Ÿ“ฃ Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above.
jives/hlds:valve \
"+log on +rcon_password changeme +maxplayers 12 +map crossfire" # ๐Ÿ“ฃ Modify your server startup commands here. You can specify the image with the desired game you want the server to run in the line above.
```

> [!TIP]
Expand Down
31 changes: 21 additions & 10 deletions container/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
FROM ubuntu:18.04

LABEL org.opencontainers.image.title="hlds"
LABEL org.opencontainers.image.description="๐Ÿ‹ ๐Ÿ“ฆ Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins."
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
LABEL org.opencontainers.image.authors="James Ives"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"

# Sets an environment variable for the game to install.
# Supported games: valve, cstrike, czero, dod, dmc, gearbox, ricochet, tfc
# Default is valve. This get replaced when building the image with --build-arg GAME=<game>
Expand All @@ -21,6 +12,25 @@ ENV GAME ${GAME}
ARG FLAG
ENV FLAG ${FLAG}

# Sets an environment variable for the version of the image.
ARG VERSION=custom
ENV VERSION ${VERSION}

# Sets an environment variable for the image name.
ARG IMAGE=custom
ENV IMAGE ${IMAGE}

# Tags the image with the Open Containers Initiative (OCI) image format.
LABEL org.opencontainers.image.title="hlds:${GAME}"
LABEL org.opencontainers.image.description="๐Ÿ‹ ๐Ÿ“ฆ Half-Life Dedicated Server powered by Docker. Supports all the classic GoldSrc Half-Life games and mods, including the ability to add custom configurations and plugins."
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
LABEL org.opencontainers.image.authors="James Ives (https://jamesiv.es)"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"
LABEL org.opencontainers.image.version="${VERSION}"

RUN dpkg --add-architecture i386 && \
apt-get update && \
apt-get install -y --no-install-recommends curl rsync file libc6:i386 lib32stdc++6 ca-certificates && \
Expand Down Expand Up @@ -60,4 +70,5 @@ COPY --chown=steam:steam mods .

RUN chmod +x ./entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]

ENTRYPOINT ["./entrypoint.sh"]
6 changes: 5 additions & 1 deletion container/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ services:
args:
- GAME=${GAME}
- FLAG=${FLAG}
- VERSION=${VERSION}
- IMAGE=${IMAGE}
volumes:
- "./config:/temp/config"
- "./mods:/temp/mods"
Expand All @@ -15,4 +17,6 @@ services:
environment:
- GAME=${GAME}
- FLAG=${FLAG}
command: +maxplayers 12 +log on
- VERSION=${VERSION}
- IMAGE=${IMAGE}
command: +maxplayers 12 +log on +rcon_password "changeme" +map crossfire
44 changes: 42 additions & 2 deletions container/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh

# Set GAME to its value if defined, or 'valve' if not
GAME=${GAME:-valve}
VERSION=${VERSION:-custom}
IMAGE=${IMAGE:-custom}

if echo "$@" | grep -qv "+map"; then
echo -e "\e[33mWarning: No +map specified in the command. Server will start but may not be joinable.\e[0m"
Expand All @@ -18,7 +19,46 @@ then
rsync --chown=steam:steam /temp/config/* /opt/steam/hlds/$GAME
fi

echo -e "\e[32mStarting Half-Life Dedicated Server for $GAME...\e[0m"

echo "
..::::::..
:-=++++++++++++=-:
:=++++=--::...::-=++++=:
:=+++=: :-++++:
=+++- =====: -+++=
++++. ===+++. .=+++
=+++ :+++ =+++
:+++. -+++= .+++:
=++= =+++++- =++=
=++- .=++-:+++: -+++
=++= .+++- -+++. =++=
:+++. :+++. =+++ .+++:
=+++ =++=. ++++++= =++=
=+++. -==- .+++=-: .=+++
=+++-. -+++=
:=+++=: :=+++=:
:=+++++=-::..::-=+++++=:
:-=++++++++++++=-:
..::::::..
hlds-docker
====================================================================
๐Ÿ’ฟ Image: $IMAGE
๐Ÿ“Ž Version: $VERSION
๐ŸŽฎ Game: $GAME
====================================================================
โ–„โ–„ LINKS โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„
โ–ˆ โ–ˆ
โ–ˆ ๐Ÿ”ง Maintained by Jives: https://jives.dev โ–ˆ
โ–ˆ ๐Ÿ’– Support: https://github.com/sponsors/JamesIves โ–ˆ
โ–ˆ ๐Ÿ”” Feedback / Issues: https://github.com/JamesIves/hlds-docker โ–ˆ
โ–ˆ โ–ˆ
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
"

echo "\e[32mStarting Half-Life Dedicated Server...\e[0m"

# Start the server with the specified game and any additional arguments.
./hlds_run "-game $GAME $@"
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
# ๐Ÿ”ง jives/hlds:valve-legacy (Half-Life Deathmatch) (Pre 25th Anniversary Edition)
# ๐Ÿ”ง jives/hlds:cstrike-legacy (Counter-Strike) (Pre 25th Anniversary Edition)
# ๐Ÿ”ง jives/hlds:czero-legacy (Counter-Strike: Condition Zero) (Pre 25th Anniversary Edition)
image: jives/hlds:cstrike
image: jives/hlds:valve
# ๐Ÿ“ฃ Learn more about these volumes in the advanced setup guides: https://github.com/JamesIves/hlds-docker?tab=readme-ov-file#advanced-setup-%EF%B8%8F
volumes:
- "./config:/temp/config"
Expand All @@ -26,4 +26,4 @@ services:
# ๐Ÿ“ฃ Modify your server startup commands here, you can add more FLAG as needed (see: https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server),
# ๐Ÿ“ฃ Remember: Stating map is based on the game, and will likely be different between images.
# ๐Ÿ“ฃ You should also modify the rcon_password value so you can use server admin commands.
command: +log on +rcon_password "changeme" +maxplayers 12 +map cs_italy
command: +log on +rcon_password "changeme" +maxplayers 12 +map crossfire

0 comments on commit 83f5faa

Please sign in to comment.