Skip to content

Tighten up AWS deployment script #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
csgo-data
csgo-data*
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
csgo-data
csgo-data*
inventory*
44 changes: 13 additions & 31 deletions cs_aws.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/bin/sh
set -eux

# Install Docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
Expand All @@ -12,39 +15,18 @@ sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

# Clone repo locally
mkdir ~/cs_server_1/
git clone https://github.com/FragSoc/csgo-server-scrim.git ~/cs_server_1/.
mkdir ~/cs_server_2/
git clone https://github.com/FragSoc/csgo-server-scrim.git ~/cs_server_2/.

# Configure ports and source tokens
sed -i 's/SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E/SRCDS_TOKEN=3C1836105A719D05E6E2377A823F66E1/g' ~/cs_server_1/docker-compose.yml

sed -i 's/SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E/SRCDS_TOKEN=5BA590C6B96839FC248667027F2E8D79/g' ~/cs_server_2/docker-compose.yml
sed -i 's/SRCDS_PORT=27015/SRCDS_PORT=27016/g' ~/cs_server_2/docker-compose.yml
sed -i 's/SRCDS_TV_PORT=27020/SRCDS_TV_PORT=27021/g' ~/cs_server_2/docker-compose.yml

# Configure passwords
sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #1"/g' ~/cs_server_1/custom_server_template.cfg
sed -i 's/sv_password "default"/sv_password "z6gMtKvm"/g' ~/cs_server_1/custom_server_template.cfg
sed -i 's/rcon_password "default"/rcon_password "6zzPYFwQ"/g' ~/cs_server_1/custom_server_template.cfg
# sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #1"/g' ~/cs_server_1/custom_server_template.cfg
# sed -i 's/sv_password "default"/sv_password "z6gMtKvm"/g' ~/cs_server_1/custom_server_template.cfg
# sed -i 's/rcon_password "default"/rcon_password "6zzPYFwQ"/g' ~/cs_server_1/custom_server_template.cfg

sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #2"/g' ~/cs_server_2/custom_server_template.cfg
sed -i 's/sv_password "default"/sv_password "mLMQ7LgM"/g' ~/cs_server_2/custom_server_template.cfg
sed -i 's/rcon_password "default"/rcon_password "zuKUW8wR"/g' ~/cs_server_2/custom_server_template.cfg
# sed -i 's/hostname "UoY Esports"/hostname "UoY Esports #2"/g' ~/cs_server_2/custom_server_template.cfg
# sed -i 's/sv_password "default"/sv_password "mLMQ7LgM"/g' ~/cs_server_2/custom_server_template.cfg
# sed -i 's/rcon_password "default"/rcon_password "zuKUW8wR"/g' ~/cs_server_2/custom_server_template.cfg

# Make install directory
mkdir ~/cs_server_1/csgo-data
chmod 777 ~/cs_server_1/csgo-data
mkdir ~/cs_server_2/csgo-data
chmod 777 ~/cs_server_2/csgo-data
# Make install directories
install -m 0777 -d ./csgo-data1
install -m 0777 -d ./csgo-data2

# Run container composes
sudo docker-compose -f ~/cs_server_1/docker-compose.yml up -d
sudo docker-compose -f ~/cs_server_2/docker-compose.yml up -d


# rsync -av csgo-server-scrim/ csgo-server-scrim_2/


sudo docker-compose up -d
30 changes: 23 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
version: "3"
services:
csgo-scrim:
version: "3.4"

x-defaults: &defaults
build: .
volumes:
- ./csgo-data:/home/steam/csgo-dedicated/
image: fragsoc/csgo-server-scrim
network_mode: "host"
environment:
- SRCDS_TOKEN=309E76122D3C7522154AC7513C51984E
restart: unless-stopped

services:
scrim1:
<<: *defaults
volumes:
- ./csgo-data1:/home/steam/csgo-dedicated/
environment:
- SRCDS_TOKEN=3C1836105A719D05E6E2377A823F66E1
- SRCDS_PORT=27015
- SRCDS_TV_PORT=27020
- SCRIM=true # Set false for a team structured config

scrim2:
<<: *defaults
volumes:
- ./csgo-data1:/home/steam/csgo-dedicated/
environment:
- SRCDS_TOKEN=5BA590C6B96839FC248667027F2E8D79
- SRCDS_PORT=27016
- SRCDS_TV_PORT=27021
- SCRIM=true # Set false for a team structured config