Skip to content

Commit 83f5faa

Browse files
feat: โœจ Adds server startup information (#32) #minor
* 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JamesIves <[email protected]>
1 parent 5fc9658 commit 83f5faa

File tree

7 files changed

+88
-18
lines changed

7 files changed

+88
-18
lines changed

โ€Ž.github/workflows/beta.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,17 @@ jobs:
7171
env:
7272
GAME: ${{ env.GAME }}
7373
FLAG: ${{ env.FLAG }}
74+
VERSION: beta
75+
IMAGE: jives/hlds:${{ matrix.game }}-beta
7476
with:
7577
context: ./container
7678
push: true
7779
tags: jives/hlds:${{ matrix.game }}-beta
7880
build-args: |
7981
GAME=${{ env.GAME }}
8082
FLAG=${{ env.FLAG }}
83+
IMAGE=jives/hlds:${{ matrix.game }}-beta
84+
VERSION=beta
8185
8286
- name: Set repo owner to lowercase
8387
id: repo_owner
@@ -88,10 +92,14 @@ jobs:
8892
env:
8993
GAME: ${{ env.GAME }}
9094
FLAG: ${{ env.FLAG }}
95+
VERSION: beta
96+
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
9197
with:
9298
context: ./container
9399
push: true
94100
tags: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta
95101
build-args: |
96102
GAME=${{ env.GAME }}
97103
FLAG=${{ env.FLAG }}
104+
VERSION=beta
105+
IMAGE=ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-beta

โ€Ž.github/workflows/publish.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
WITH_V: true
23-
DEFAULT_BUMP: patch
2423
DRY_RUN: true
2524

2625
build:
@@ -91,6 +90,8 @@ jobs:
9190
env:
9291
GAME: ${{ env.GAME }}
9392
FLAG: ${{ env.FLAG }}
93+
VERSION: ${{ needs.version.outputs.version }}
94+
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
9495
with:
9596
context: ./container
9697
push: true
@@ -100,6 +101,8 @@ jobs:
100101
build-args: |
101102
GAME=${{ env.GAME}}
102103
FLAG=${{ env.FLAG }}
104+
VERSION=${{ needs.version.outputs.version }}
105+
IMAGE: jives/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
103106
104107
- name: Set repo owner to lowercase
105108
id: repo_owner
@@ -110,6 +113,8 @@ jobs:
110113
env:
111114
GAME: ${{ matrix.game }}
112115
FLAG: ${{ env.FLAG }}
116+
VERSION: ${{ needs.version.outputs.version }}
117+
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
113118
with:
114119
context: ./container
115120
push: true
@@ -119,6 +124,8 @@ jobs:
119124
build-args: |
120125
GAME=${{ env.GAME }}
121126
FLAG=${{ env.FLAG }}
127+
VERSION=${{ needs.version.outputs.version }}
128+
IMAGE: ghcr.io/${{ steps.repo_owner.outputs.repo_owner }}/hlds:${{ matrix.game }}-${{ needs.version.outputs.version }}
122129
123130
publish:
124131
needs: build

โ€ŽREADME.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ docker run -d \
2626
-p 27015:27015 \
2727
-p 26900:26900/udp \
2828
-e GAME=${GAME} \
29-
jives/hlds:cstrike \
30-
"+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.
29+
jives/hlds:valve \
30+
"+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.
3131
```
3232

3333
> [!TIP]

โ€Žcontainer/Dockerfile

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
FROM ubuntu:18.04
22

3-
LABEL org.opencontainers.image.title="hlds"
4-
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."
5-
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
6-
LABEL org.opencontainers.image.authors="James Ives"
7-
LABEL org.opencontainers.image.licenses="MIT"
8-
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
9-
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
10-
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"
11-
123
# Sets an environment variable for the game to install.
134
# Supported games: valve, cstrike, czero, dod, dmc, gearbox, ricochet, tfc
145
# Default is valve. This get replaced when building the image with --build-arg GAME=<game>
@@ -21,6 +12,25 @@ ENV GAME ${GAME}
2112
ARG FLAG
2213
ENV FLAG ${FLAG}
2314

15+
# Sets an environment variable for the version of the image.
16+
ARG VERSION=custom
17+
ENV VERSION ${VERSION}
18+
19+
# Sets an environment variable for the image name.
20+
ARG IMAGE=custom
21+
ENV IMAGE ${IMAGE}
22+
23+
# Tags the image with the Open Containers Initiative (OCI) image format.
24+
LABEL org.opencontainers.image.title="hlds:${GAME}"
25+
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."
26+
LABEL org.opencontainers.image.vendor="https://jamesiv.es"
27+
LABEL org.opencontainers.image.authors="James Ives (https://jamesiv.es)"
28+
LABEL org.opencontainers.image.licenses="MIT"
29+
LABEL org.opencontainers.image.url="https://github.com/jamesives/hlds-docker"
30+
LABEL org.opencontainers.image.documentation="https://github.com/jamesives/hlds-docker"
31+
LABEL org.opencontainers.image.source="https://github.com/jamesives/hlds-docker"
32+
LABEL org.opencontainers.image.version="${VERSION}"
33+
2434
RUN dpkg --add-architecture i386 && \
2535
apt-get update && \
2636
apt-get install -y --no-install-recommends curl rsync file libc6:i386 lib32stdc++6 ca-certificates && \
@@ -60,4 +70,5 @@ COPY --chown=steam:steam mods .
6070

6171
RUN chmod +x ./entrypoint.sh
6272

63-
ENTRYPOINT ["./entrypoint.sh"]
73+
74+
ENTRYPOINT ["./entrypoint.sh"]

โ€Žcontainer/docker-compose.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ services:
55
args:
66
- GAME=${GAME}
77
- FLAG=${FLAG}
8+
- VERSION=${VERSION}
9+
- IMAGE=${IMAGE}
810
volumes:
911
- "./config:/temp/config"
1012
- "./mods:/temp/mods"
@@ -15,4 +17,6 @@ services:
1517
environment:
1618
- GAME=${GAME}
1719
- FLAG=${FLAG}
18-
command: +maxplayers 12 +log on
20+
- VERSION=${VERSION}
21+
- IMAGE=${IMAGE}
22+
command: +maxplayers 12 +log on +rcon_password "changeme" +map crossfire

โ€Žcontainer/entrypoint.sh

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env sh
22

3-
# Set GAME to its value if defined, or 'valve' if not
43
GAME=${GAME:-valve}
4+
VERSION=${VERSION:-custom}
5+
IMAGE=${IMAGE:-custom}
56

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

21-
echo -e "\e[32mStarting Half-Life Dedicated Server for $GAME...\e[0m"
22+
23+
echo "
24+
..::::::..
25+
:-=++++++++++++=-:
26+
:=++++=--::...::-=++++=:
27+
:=+++=: :-++++:
28+
=+++- =====: -+++=
29+
++++. ===+++. .=+++
30+
=+++ :+++ =+++
31+
:+++. -+++= .+++:
32+
=++= =+++++- =++=
33+
=++- .=++-:+++: -+++
34+
=++= .+++- -+++. =++=
35+
:+++. :+++. =+++ .+++:
36+
=+++ =++=. ++++++= =++=
37+
=+++. -==- .+++=-: .=+++
38+
=+++-. -+++=
39+
:=+++=: :=+++=:
40+
:=+++++=-::..::-=+++++=:
41+
:-=++++++++++++=-:
42+
..::::::..
43+
44+
hlds-docker
45+
46+
====================================================================
47+
๐Ÿ’ฟ Image: $IMAGE
48+
๐Ÿ“Ž Version: $VERSION
49+
๐ŸŽฎ Game: $GAME
50+
====================================================================
51+
52+
โ–„โ–„ LINKS โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„โ–„
53+
โ–ˆ โ–ˆ
54+
โ–ˆ ๐Ÿ”ง Maintained by Jives: https://jives.dev โ–ˆ
55+
โ–ˆ ๐Ÿ’– Support: https://github.com/sponsors/JamesIves โ–ˆ
56+
โ–ˆ ๐Ÿ”” Feedback / Issues: https://github.com/JamesIves/hlds-docker โ–ˆ
57+
โ–ˆ โ–ˆ
58+
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
59+
"
60+
61+
echo "\e[32mStarting Half-Life Dedicated Server...\e[0m"
2262

2363
# Start the server with the specified game and any additional arguments.
2464
./hlds_run "-game $GAME $@"

โ€Ždocker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
# ๐Ÿ”ง jives/hlds:valve-legacy (Half-Life Deathmatch) (Pre 25th Anniversary Edition)
1313
# ๐Ÿ”ง jives/hlds:cstrike-legacy (Counter-Strike) (Pre 25th Anniversary Edition)
1414
# ๐Ÿ”ง jives/hlds:czero-legacy (Counter-Strike: Condition Zero) (Pre 25th Anniversary Edition)
15-
image: jives/hlds:cstrike
15+
image: jives/hlds:valve
1616
# ๐Ÿ“ฃ 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
1717
volumes:
1818
- "./config:/temp/config"
@@ -26,4 +26,4 @@ services:
2626
# ๐Ÿ“ฃ Modify your server startup commands here, you can add more FLAG as needed (see: https://developer.valvesoftware.com/wiki/Half-Life_Dedicated_Server),
2727
# ๐Ÿ“ฃ Remember: Stating map is based on the game, and will likely be different between images.
2828
# ๐Ÿ“ฃ You should also modify the rcon_password value so you can use server admin commands.
29-
command: +log on +rcon_password "changeme" +maxplayers 12 +map cs_italy
29+
command: +log on +rcon_password "changeme" +maxplayers 12 +map crossfire

0 commit comments

Comments
ย (0)