-
Notifications
You must be signed in to change notification settings - Fork 58
/
Copy pathMakefile
101 lines (92 loc) · 2.48 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
SHELL := /bin/bash
CONTAINER_NAME ?= csgo-dedicated-server
IMAGE_NAME ?= kmallea/csgo:latest
SERVER_HOSTNAME ?= Counter-Strike: Global Offensive Dedicated Server
SERVER_PASSWORD ?=
RCON_PASSWORD ?= changeme
STEAM_ACCOUNT ?= changeme
AUTHKEY ?= changeme
IP ?= 0.0.0.0
PORT ?= 27015
TV_PORT ?= 27020
TICKRATE ?= 128
FPS_MAX ?= 400
GAME_TYPE ?= 0
GAME_MODE ?= 1
MAP ?= de_dust2
MAPGROUP ?= mg_active
HOST_WORKSHOP_COLLECTION ?=
WORKSHOP_START_MAP ?=
MAXPLAYERS ?= 12
TV_ENABLE ?= 1
LAN ?= 1
SOURCEMOD_ADMINS ?= STEAM_1:0:123456,STEAM_1:0:654321
RETAKES ?= 0
NOMASTER ?= 0
.PHONY: all clean image test stop
all: image
clean:
docker rmi $(IMAGE_NAME)
image: Dockerfile
docker build -t $(IMAGE_NAME) \
--build-arg STEAMCMD_URL=https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz \
.
server:
docker run \
-i \
-t \
-d \
--net=host \
--mount source=csgo-data,target=/home/steam/csgo \
-e "SERVER_HOSTNAME=$(SERVER_HOSTNAME)" \
-e "SERVER_PASSWORD=$(SERVER_PASSWORD)" \
-e "RCON_PASSWORD=$(RCON_PASSWORD)" \
-e "STEAM_ACCOUNT=$(STEAM_ACCOUNT)" \
-e "AUTHKEY=$(AUTHKEY)" \
-e "TICKRATE=$(TICKRATE)" \
-e "FPS_MAX=$(FPS_MAX)" \
-e "GAME_TYPE=$(GAME_TYPE)" \
-e "GAME_MODE=$(GAME_MODE)" \
-e "MAP=$(MAP)" \
-e "MAPGROUP=$(MAPGROUP)" \
-e "HOST_WORKSHOP_COLLECTION=$(HOST_WORKSHOP_COLLECTION)" \
-e "WORKSHOP_START_MAP=$(WORKSHOP_START_MAP)" \
-e "MAXPLAYERS=$(MAXPLAYERS)" \
-e "TV_ENABLE=$(TV_ENABLE)" \
-e "LAN=$(LAN)" \
-e "SOURCEMOD_ADMINS=$(SOURCEMOD_ADMINS)" \
-e "RETAKES=$(RETAKES)" \
--name $(CONTAINER_NAME) \
$(IMAGE_NAME)
test:
docker run \
-i \
-t \
--rm \
--net=host \
--mount type=bind,source="$(PWD)/test",target=/home/steam/csgo \
-e "CI=true" \
-e "SERVER_HOSTNAME=$(SERVER_HOSTNAME)" \
-e "SERVER_PASSWORD=$(SERVER_PASSWORD)" \
-e "RCON_PASSWORD=$(RCON_PASSWORD)" \
-e "STEAM_ACCOUNT=$(STEAM_ACCOUNT)" \
-e "AUTHKEY=$(AUTHKEY)" \
-e "TICKRATE=$(TICKRATE)" \
-e "FPS_MAX=$(FPS_MAX)" \
-e "GAME_TYPE=$(GAME_TYPE)" \
-e "GAME_MODE=$(GAME_MODE)" \
-e "MAP=$(MAP)" \
-e "MAPGROUP=$(MAPGROUP)" \
-e "HOST_WORKSHOP_COLLECTION=$(HOST_WORKSHOP_COLLECTION)" \
-e "WORKSHOP_START_MAP=$(WORKSHOP_START_MAP)" \
-e "MAXPLAYERS=$(MAXPLAYERS)" \
-e "TV_ENABLE=$(TV_ENABLE)" \
-e "LAN=$(LAN)" \
-e "SOURCEMOD_ADMINS=$(SOURCEMOD_ADMINS)" \
-e "RETAKES=$(RETAKES)" \
-e "SM_PUGSETUP_SNAKE_CAPTAIN_PICKS=2" \
--name $(CONTAINER_NAME) \
$(IMAGE_NAME)
stop:
docker stop $(CONTAINER_NAME)
docker rm $(CONTAINER_NAME)