diff --git a/python/switchBundle.py b/python/switchBundle.py index 6c0edc7..64f08c1 100644 --- a/python/switchBundle.py +++ b/python/switchBundle.py @@ -23,6 +23,7 @@ BundleConfig = { '2006': 'betterjack', '6007': 'BRWhot', '2008': 'slots', + '2005': 'christmas', } unlinkArray = [ @@ -36,6 +37,7 @@ unlinkArray = [ ] def remove_folder(path): + print('remove path: ', path) if os.path.exists(path): if os.path.isfile(path) or os.path.islink(path): os.remove(path) @@ -44,6 +46,16 @@ def remove_folder(path): remove_folder(os.path.join(path, filename)) os.rmdir(path) +# 上传src相共用文件 +SrcDir = BuildDir + '\\src\\' +SrcDst = SubgamePath + 'lib/src/' +rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + SrcDst + ' --recursive'], capture_output=True, text=True) +print('remove dir src result: ', rmResult) +cmd = 'call aws s3 cp '+ SrcDir +' '+SrcDst + ' --recursive --region ap-east-1' +result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) +print('upload dir src result: ', result) +remove_folder(SrcDir) + for filename in os.listdir(BuildDir): file_path = os.path.join(BuildDir, filename) if filename in unlinkArray: @@ -51,6 +63,10 @@ for filename in os.listdir(BuildDir): for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/assets/' + BundleConfig[gameid] +'/' + + rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + awsPath + ' --recursive'], capture_output=True, text=True) + print('remove game gameid: ', gameid, ' result: ', rmResult) + subgameDir = BuildDir + 'assets\\' + BundleConfig[gameid] +'\\' cmd = 'call aws s3 cp '+ subgameDir +' '+awsPath + ' --recursive --region ap-east-1' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) @@ -65,4 +81,4 @@ for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/' cmd = 'call aws s3 cp '+ BuildDir +' '+awsPath + ' --recursive --region ap-east-1' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) - print(result) \ No newline at end of file + print('upload game gameid: ', gameid, ' result: ', result) \ No newline at end of file diff --git a/python/switchBundleR.py b/python/switchBundleR.py index b471d5f..4e3565d 100644 --- a/python/switchBundleR.py +++ b/python/switchBundleR.py @@ -23,6 +23,7 @@ BundleConfig = { '2006': 'betterjack', '6007': 'BRWhot', '2008': 'slots', + '2005': 'christmas', } unlinkArray = [ @@ -36,6 +37,7 @@ unlinkArray = [ ] def remove_folder(path): + print('remove path: ', path) if os.path.exists(path): if os.path.isfile(path) or os.path.islink(path): os.remove(path) @@ -44,6 +46,15 @@ def remove_folder(path): remove_folder(os.path.join(path, filename)) os.rmdir(path) +SrcDir = BuildDir + '\\src\\' +SrcDst = SubgamePath + 'lib/src/' +rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + SrcDst + ' --recursive'], capture_output=True, text=True) +print('remove dir src result: ', rmResult) +cmd = 'call aws s3 cp '+ SrcDir +' '+SrcDst + ' --recursive --region eu-west-3' +result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) +print('upload dir src result: ', result) +remove_folder(SrcDir) + for filename in os.listdir(BuildDir): file_path = os.path.join(BuildDir, filename) if filename in unlinkArray: @@ -51,6 +62,10 @@ for filename in os.listdir(BuildDir): for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/assets/' + BundleConfig[gameid] +'/' + + rmResult = subprocess.run(['cmd', '/c', 'aws s3 rm ' + awsPath + ' --recursive'], capture_output=True, text=True) + print('remove game gameid: ', gameid, ' result: ', rmResult) + subgameDir = BuildDir + 'assets\\' + BundleConfig[gameid] +'\\' cmd = 'call aws s3 cp '+ subgameDir +' '+awsPath + ' --recursive --region eu-west-3' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) @@ -65,4 +80,4 @@ for gameid in BundleConfig: awsPath = SubgamePath + gameid + '/' cmd = 'call aws s3 cp '+ BuildDir +' '+awsPath + ' --recursive --region eu-west-3' result = subprocess.run(['cmd', '/c', cmd], capture_output=True, text=True) - print(result) \ No newline at end of file + print('upload game gameid: ', gameid, ' result: ', result) \ No newline at end of file