From 22f37cbdeca5b517ed780133c23ece13a4a1c466 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 13 Mar 2022 21:38:52 +0900 Subject: [PATCH] feat: for v0.29 --- hidche/app/entrypoint.sh | 1 + hidche/game.orig.env | 1 + hidche/install/install_hidche.py | 14 +++++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/hidche/app/entrypoint.sh b/hidche/app/entrypoint.sh index 58bd9d3..aa2445f 100755 --- a/hidche/app/entrypoint.sh +++ b/hidche/app/entrypoint.sh @@ -14,6 +14,7 @@ if [ ! -f "$samRoot/index.php" ]; then mkdir -p $samRoot chown -R www-data:www-data $wwwRoot gosu www-data git clone $gameGitPath $samRoot + gosu www-data git checkout $gameGitBranch fi if [ "$HIDCHE_IMAGE_USE_INTERNAL" = "yes" ] && [ ! -d "$imageRoot" ]; then diff --git a/hidche/game.orig.env b/hidche/game.orig.env index cceec05..9e49f88 100644 --- a/hidche/game.orig.env +++ b/hidche/game.orig.env @@ -2,6 +2,7 @@ #서버 git 주소. #만약 https:// 대신 ssh://로 시작하는 주소를 사용하는 경우 app/id_ecdsa, app/known_host 에 ecdsa 개인키와 ssh값을 추가할 것. gameGitPath=ssh://git@storage.hided.net:2525/devsam/core.git +gameGitBranch=devel imgGitPath=ssh://git@storage.hided.net:2525/devsam/image.git #게임 시간대. diff --git a/hidche/install/install_hidche.py b/hidche/install/install_hidche.py index bb14f77..6383493 100755 --- a/hidche/install/install_hidche.py +++ b/hidche/install/install_hidche.py @@ -43,14 +43,18 @@ if not os.path.exists(indexPHP): fp.close() while True: - try: + try: r = requests.head('http://web/sam/f_install/j_install_status.php') - if r.status_code == 200: + if r.status_code == 503 or r.status_code == 500: + b = requests.get('http://web/sam/install.php', timeout=60000) + elif r.status_code == 200: break except Exception: pass print("Waiting for web connection...", flush=True) - time.sleep(2) + time.sleep(2) + +requests.get('http://web/sam/install.php', timeout=60000) #NPM while True: result = subprocess.call('nc -z -v -w30 db 3306'.split(' '), stderr=subprocess.STDOUT) @@ -109,8 +113,8 @@ serverList.reverse() for serverName in serverList: updateResult = session.post('http://web/sam/j_updateServer.php', { 'server':serverName, - 'target':'origin/devel' - }, headers=headers) + 'target':'origin/'+env['gameGitBranch'] + }, headers=headers, timeout=60000) print(serverName, updateResult.text, flush=True) db_pw = hash_password(serverName+env['HIDCHE_PW_SALT'], env['MARIADB_ROOT_PASSWORD'])[:32]