From e8d01f17c9497ecbacfadba3f55c393e635845cf Mon Sep 17 00:00:00 2001 From: Anton Sarukhanov <code@ant.sr> Date: Thu, 23 Jan 2020 16:27:34 -0500 Subject: [PATCH] Add BombSquad config, CI config, fix Dockerfile. --- .gitlab-ci.yml | 14 ++++++++++++++ Dockerfile | 18 ++++++++++++++---- config.py | 22 ++++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 config.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..eaef512 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +build_image: + stage: build + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + variables: + IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"nah\"}}}" + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + only: + - tags + diff --git a/Dockerfile b/Dockerfile index 4abddc7..a791035 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,17 @@ FROM python:2.7-stretch - -COPY ./bombsquad/ /bombsquad +ENV BS_VERSION 1.4.150 +ENV BS_MIRROR https://ant.sr WORKDIR /bombsquad -CMD /bombsquad/bombsquad_server -EXPOSE 43210/tcp +RUN wget -O BombSquad_Server_Linux_64bit_$BS_VERSION.tar.gz $BS_MIRROR/BombSquad_Server_Linux_64bit_$BS_VERSION.tar.gz \ + && tar xzf BombSquad_Server_Linux_64bit_$BS_VERSION.tar.gz \ + && rm BombSquad_Server_Linux_64bit_$BS_VERSION.tar.gz + +COPY ./config.py /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/config.py +COPY ./bsTeamGame.py /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/data/scripts/bsTeamGame.py +COPY ./bsGame.py /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/data/scripts/bsGame.py +COPY ./bsBomb.py /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/data/scripts/bsBomb.py +COPY ./bsSpaz.py /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/data/scripts/bsSpaz.py + +CMD /bombsquad/BombSquad_Server_Linux_64bit_$BS_VERSION/bombsquad_server +EXPOSE 43212/udp diff --git a/config.py b/config.py new file mode 100644 index 0000000..c60f07e --- /dev/null +++ b/config.py @@ -0,0 +1,22 @@ +config['partyName'] = os.getenv('BS_SERVER_NAME', 'Boomsicle') +config['maxPartySize'] = int(os.getenv('BS_MAX_CONNECTIONS', 32)) +config['Free-for-All Max Players'] = int(os.getenv('BS_FFA_MAX_PLAYERS', 32)) +config['port'] = int(os.getenv('BS_PORT', 43210)) +config['partyIsPublic'] = bool(os.getenv('BS_PUBLIC', True)) +config['language'] = os.getenv('BS_LANGUAGE', 'English') + +config['sessionType'] = os.getenv('BS_SESSIONTYPE', 'ffa') + +config['playlistCode'] = os.getenv('BS_PLAYLIST', None) +config['playlistShuffle'] = bool(os.getenv('BS_SHUFFLE', True)) + +config['autoBalanceTeams'] = bool(os.getenv('BS_BALANCETEAMS', True)) + +config['enableTelnet'] = bool(os.getenv('BS_TELNET', False)) +config['telnetPort'] = int(os.getenv('BS_TELNETPORT', 43250)) +config['telnetPassword'] = os.getenv('BS_TELNETPW', 'changeme') + +config['teamsSeriesLength'] = int(os.getenv('BS_SERIESLENGTH', 7)) +config['ffaSeriesScoreToWin'] = int(os.getenv('BS_FFASCORE', 69)) + +config['statsURL'] = os.getenv('BS_STATSURL', '') -- GitLab