mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
Update server controller and .gitignore.
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -4,9 +4,16 @@
|
||||
*.dmb
|
||||
*.lk
|
||||
info.json
|
||||
/config/admins.txt
|
||||
|
||||
# WinMerge backups
|
||||
*.bak
|
||||
|
||||
# String dumps
|
||||
*.str
|
||||
|
||||
# Compiled Python doohickies
|
||||
*.pyc
|
||||
|
||||
#ignore any files in config/, except those in subdirectories.
|
||||
/config/*
|
||||
!/config/*/*
|
||||
|
||||
@@ -55,13 +55,28 @@ def checkForUpdate(serverState):
|
||||
if currentCommit != lastCommit and lastCommit is not None:
|
||||
subprocess.call('git reset --hard {0}/{1}'.format(GIT_REMOTE,GIT_BRANCH),shell=True)
|
||||
subprocess.call('cp -av {0} {1}'.format(CONFIGPATH,GAMEPATH),shell=True)
|
||||
|
||||
# Copy bot config, if it exists.
|
||||
botConfigSource=os.path.join(GAMEPATH,'config','CORE_DATA.py')
|
||||
botConfigDest=os.path.join(GAMEPATH,'bot','CORE_DATA.py')
|
||||
if os.file.exists(botConfigSource):
|
||||
if os.file.exists(botConfigDest):
|
||||
os.remove(botConfigDest)
|
||||
log.warn('RM {0}'.format(botConfigDest))
|
||||
shutil.move(botConfigSource,botConfigDest)
|
||||
log.warn('move {0} {1}'.format(botConfigSource,botConfigDest))
|
||||
|
||||
# Compile
|
||||
log.info('Updated to {0} ({1}). Triggering compile.'.format(currentCommit,currentBranch))
|
||||
subprocess.call(COMPILE_COMMAND,shell=True)
|
||||
|
||||
# Notify the server that we're restarting.
|
||||
updateTrigger=os.path.join(GAMEPATH,'data','UPDATE_READY.txt')
|
||||
if not os.path.isdir(os.path.dirname(updateTrigger)):
|
||||
os.makedirs(os.path.dirname(updateTrigger))
|
||||
|
||||
if serverState:
|
||||
log.info('Server will restart after round ends.')
|
||||
log.info('Server updated.')
|
||||
with open(updateTrigger,'w') as f:
|
||||
f.write('honk')
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user