From 84e61cb749a0f7f8562bbfcfe8262aa81ef4dd3b Mon Sep 17 00:00:00 2001 From: IceOfWraith <96364530+IceOfWraith@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:54:29 -0500 Subject: [PATCH] Update GatekeeperV2 (#444) * Update GatekeeperV2 Due to changes in how Python and Pip handle packages, this needed a change to use a virtual environment. This won't work in Docker until Mike adds python3-venv to the image, but I suspect it should be resolved shortly. * Fix issue * Oopsies --- gatekeeperv2.kvp | 5 +++-- gatekeepverv2updates.json | 25 +++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 gatekeepverv2updates.json diff --git a/gatekeeperv2.kvp b/gatekeeperv2.kvp index 043c247..9953837 100644 --- a/gatekeeperv2.kvp +++ b/gatekeeperv2.kvp @@ -20,7 +20,7 @@ App.DisplayName=GatekeeperV2 Bot App.RootDir=./gatekeeperv2/ App.BaseDirectory=./gatekeeperv2/ App.ExecutableWin=$PATH/python3 -App.ExecutableLinux=/usr/bin/python3 +App.ExecutableLinux=venv/bin/python3 App.WorkingDir=GatekeeperV2-main App.LinuxCommandLineArgs= App.WindowsCommandLineArgs= @@ -54,7 +54,8 @@ App.RCONConnectRetrySeconds=5 App.RCONHeartbeatMinutes=0 App.RCONHeartbeatCommand=ping App.TelnetLoginFormat={0} -App.UpdateSources=[{"UpdateStageName":"Bot Download","UpdateSourcePlatform":"All","UpdateSource":"FetchURL","UpdateSourceData":"https://github.com/k8thekat/GatekeeperV2/archive/refs/heads/main.zip","UnzipUpdateSource":true,"OverwriteExistingFiles":true,"DeleteAfterExtract":true},{"UpdateStageName":"Pip & Discord.py Script","UpdateSourcePlatform":"Linux","UpdateSource":"Executable","UpdateSourceData":"/bin/bash","UpdateSourceArgs":"-c \"pip install --upgrade pip && pip install numpy requests && git clone https://github.com/Rapptz/discord.py && cd discord.py && python3 -m pip install discord.py\""}] +App.UpdateSources=@IncludeJson[gatekeepverv2updates.json] +App.PreStartStages=[{"UpdateStageName":"Create Virtual Environment","UpdateSourcePlatform":"Linux","UpdateSource":"Executable","UpdateSourceData":"/bin/bash","UpdateSourceArgs":"-c \"source '{{$FullRootDir}}venv/bin/activate'\""}] App.Compatibility=None App.SteamUpdateAnonymousLogin=True App.SteamForceLoginPrompt=False diff --git a/gatekeepverv2updates.json b/gatekeepverv2updates.json new file mode 100644 index 0000000..108d5ca --- /dev/null +++ b/gatekeepverv2updates.json @@ -0,0 +1,25 @@ +[ + { + "UpdateStageName": "Bot Download", + "UpdateSourcePlatform": "All", + "UpdateSource": "FetchURL", + "UpdateSourceData": "https://github.com/k8thekat/GatekeeperV2/archive/refs/heads/main.zip", + "UnzipUpdateSource": true, + "OverwriteExistingFiles": true, + "DeleteAfterExtract": true + }, + { + "UpdateStageName": "Create Virtual Environment", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/bin/bash", + "UpdateSourceArgs": "-c \"rm -rf '{{$FullRootDir}}venv' && /usr/bin/python3 -m venv '{{$FullRootDir}}venv'\"" + }, + { + "UpdateStageName": "Pip & Discord.py Script", + "UpdateSourcePlatform": "Linux", + "UpdateSource": "Executable", + "UpdateSourceData": "/bin/bash", + "UpdateSourceArgs": "-c \"source '{{$FullRootDir}}venv/bin/activate' && python3 -m pip install --upgrade pip && python3 -m pip install numpy requests && git clone https://github.com/Rapptz/discord.py && cd discord.py && python3 -m pip install discord.py\"" + } +] \ No newline at end of file