master
JieLing 2022-04-12 10:37:24 +08:00
commit 316227c146
59 changed files with 630 additions and 3 deletions

Binary file not shown.

View File

@ -0,0 +1,5 @@
{
"cdn_type":"cos_aiwan_Ani",
"dir":"aiwan",
"platform":"Android",
}

View File

@ -0,0 +1,24 @@
{
"Setting":{
"LanguagePackager":{"desc":"", "versionCode":"1", "isActive":"0"},
"PACKAGE_CC_CODE":{"desc":"", "value":"4001", "versionCode":"1", "isActive":"1"},
"ServerVersion":{"desc":"", "value":"0", "versionCode":"1", "isActive":"1"},
"ThinkAnalysis_GetDeviceID":{"desc":"", "versionCode":"1", "isActive":"1"},
"LayoutBuilderWrap":{"desc":"", "versionCode":"1", "isActive":"1"},
"NOTICE_CHANNEL":{"desc":"", "value":"40001", "versionCode":"1", "isActive":"1"},
"IS_TITLE_EFFECT_SCALE":{"desc":"", "versionCode":"1", "isActive":"1","value":"1"},
"IS_PLAY_LOGIN_VIDEO":{"desc":"", "versionCode":"1", "isActive":"0"},
"UPDATE_PANEL_BG":{"desc":"","versionCode":"1","isActive":"1","value":"loading7"},
"IS_PLAY_VOICE":{"desc":"", "versionCode":"1", "isActive":"1"},
"IS_SHOW_HEALTH_TIP":{"desc":"", "versionCode":"1", "isActive":"1"},
"SPRITE_LOADER":{"desc":"", "versionCode":"1", "isActive":"1"},
"UI_Layout_CanvasScaler":{"desc":"", "versionCode":"1", "isActive":"1"},
"PACKAGE_CONFIG":{"desc":"", "versionCode":"1", "isActive":"1","value":"YX"},
"IS_LOAD_STREAMING":{"desc":"", "versionCode":"1", "isActive":"1"},
"CURVED_TEXT_CODE":{"desc":"", "versionCode":"1", "isActive":"1"},
"IS_NO_TALKING":{"desc":"", "versionCode":"1", "isActive":"0"},
"IS_SELECT_RESLUTION":{"desc":"","versionCode":"1","isActive":"1"},
"INNER_WEB_CONTROL":{"desc":"","versionCode":"1","isActive":"1"},
"IS_NULL":{"desc":"","versionCode":"5","isActive":"1"}
}
}

View File

@ -0,0 +1 @@
{"subChannel":"2000","buglyId":"261348dcd3","channel":"AIWAN","resUrl":"http://cdn-jl.lanjingshidai.com/aiwan/","packageVersion":"0.1","version":"1.1.1","serverUrl":"http://82.157.34.193:8080/"}

View File

@ -0,0 +1,6 @@
{
"cdn_type":"cos_aiwan_ios",
"dir":"aiwan",
"platform":"IOS",
"EncryptKey":""
}

View File

@ -0,0 +1,24 @@
{
"Setting":{
"LanguagePackager":{"desc":"", "versionCode":"1", "isActive":"0"},
"PACKAGE_CC_CODE":{"desc":"", "value":"4001", "versionCode":"1", "isActive":"1"},
"ServerVersion":{"desc":"", "value":"0", "versionCode":"1", "isActive":"1"},
"ThinkAnalysis_GetDeviceID":{"desc":"", "versionCode":"1", "isActive":"1"},
"LayoutBuilderWrap":{"desc":"", "versionCode":"1", "isActive":"1"},
"NOTICE_CHANNEL":{"desc":"", "value":"40001", "versionCode":"1", "isActive":"1"},
"IS_TITLE_EFFECT_SCALE":{"desc":"", "versionCode":"1", "isActive":"1","value":"1"},
"IS_PLAY_LOGIN_VIDEO":{"desc":"", "versionCode":"1", "isActive":"0"},
"UPDATE_PANEL_BG":{"desc":"","versionCode":"1","isActive":"1","value":"loading7"},
"IS_PLAY_VOICE":{"desc":"", "versionCode":"1", "isActive":"1"},
"IS_SHOW_HEALTH_TIP":{"desc":"", "versionCode":"1", "isActive":"1"},
"SPRITE_LOADER":{"desc":"", "versionCode":"1", "isActive":"1"},
"UI_Layout_CanvasScaler":{"desc":"", "versionCode":"1", "isActive":"1"},
"PACKAGE_CONFIG":{"desc":"", "versionCode":"1", "isActive":"1","value":"YX"},
"IS_LOAD_STREAMING":{"desc":"", "versionCode":"1", "isActive":"1"},
"CURVED_TEXT_CODE":{"desc":"", "versionCode":"1", "isActive":"1"},
"IS_NO_TALKING":{"desc":"", "versionCode":"1", "isActive":"0"},
"IS_SELECT_RESLUTION":{"desc":"","versionCode":"1","isActive":"1"},
"INNER_WEB_CONTROL":{"desc":"","versionCode":"1","isActive":"1"},
"IS_NULL":{"desc":"","versionCode":"1","isActive":"1"}
}
}

View File

@ -0,0 +1 @@
{"subChannel":"2000","buglyId":"261348dcd3","channel":"AIWAN","resUrl":"http://jl.tyu89.wang/mht_china/aiwan/","packageVersion":"0.1","version":"1.1.2","serverUrl":"http://82.157.34.193:8080/","EncyptKey":""}

View File

@ -0,0 +1,15 @@
热更文件版本china/mht_sw_2c64ae36a04e4b3c35db3e0ed3c95a86eaf3c8a5_2022_03_28_11_53_00
热更文件的工程对应的提交信息:
commit 2c64ae36a04e4b3c35db3e0ed3c95a86eaf3c8a5
Merge: 2a5863b575 a6fa8cdc4b
Author: zhangshanxue <zhangshanxue911@gmail.com>
Date: Mon Mar 28 11:07:02 2022 +0800
Merge branch 'china/test' into china/mht_sw
热更大小10.2625026702880859375
热更文件:
lz4/prefabs/ui/fightlevel.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lzma/luabytes.unity3d
lzma/resconfigs.unity3d
files.unity3d

View File

@ -0,0 +1,5 @@
lz4/prefabs/ui/fightlevel.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lzma/luabytes.unity3d
lzma/resconfigs.unity3d
files.unity3d

View File

@ -0,0 +1,13 @@
热更文件版本lanjing/sw_cdn_lj_sw_2022_03_28_11_53_49
热更版本号0.1.19
热更大小10.2625026702880859375
热更文件:
lz4/prefabs/ui/fightlevel.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lzma/luabytes.unity3d
lzma/resconfigs.unity3d
files.unity3d
CDN TYPE: cos_lj
TOOLS DIR: E:/JL/JL_HotFix/Tools/cos_lj
UPLOAD COMMAND: python UpLoad.py E:/JL/JL_HotFix/Root/lanjing/sw cdn_lj_sw lanjing_sw_cdn_lj_sw_2022_03_28_11_53_49 0 >>E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw//__HotFixLog/lanjing_sw_cdn_lj_sw_2022_03_28_11_53_49_UpLoad.log
Flush COMMAND: python Flush.py http://cdn-jl.lanjingshidai.com/shangwu/ >>E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw//__HotFixLog/lanjing_sw_cdn_lj_sw_2022_03_28_11_53_49_UpLoad.log

View File

@ -0,0 +1,29 @@
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/Android/lz4/prefabs/ui/fightlevel.unity3d
shangwu/Android/lz4/prefabs/ui/fightlevel.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/lz4/prefabs/ui/fightlevel.unity3d ,headers=:{}
"947d354657d2d391214c5da9a4508774"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/Android/lz4/prefabs/ui/findtreasure.unity3d
shangwu/Android/lz4/prefabs/ui/findtreasure.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/lz4/prefabs/ui/findtreasure.unity3d ,headers=:{}
"34e32475070db37b15a46b248804e3c4"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/Android/lzma/luabytes.unity3d
shangwu/Android/lzma/luabytes.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/lzma/luabytes.unity3d ,headers=:{}
"2ac1f776834f64c85e274ae8224da3fb"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/Android/lzma/resconfigs.unity3d
shangwu/Android/lzma/resconfigs.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/lzma/resconfigs.unity3d ,headers=:{}
"16753f970bb66c570704bd5ac7173bbc"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/Android/files.unity3d
shangwu/Android/files.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/files.unity3d ,headers=:{}
"98375a34c05b1d1c10226e0347aa0676"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/config.txt
shangwu/Android/config.txt
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/config.txt ,headers=:{}
"46fb683207701cf1d0072bcf0e26072d"
E:/JL/JL_HotFix/Root/lanjing/sw/cdn_lj_sw/version.txt
shangwu/Android/version.txt
INFO:qcloud_cos.cos_client:put object, url=:https://jl-1253729609.cos.ap-beijing.myqcloud.com/shangwu/Android/version.txt ,headers=:{}
"4f298eb54fe60d6271389fa224573c4b"
{"RequestId": "8ca15abc-e00d-4516-9fd5-a2d24aa8634d", "TaskId": "400824518072922876"}

View File

@ -1 +1 @@
{"channel":"pc", "resUrl":"http://cdn-jl.lanjingshidai.com/shangwu/", "packageVersion":"0.1", "subChannel":"999", "version":"0.1.18", "serverUrl":"http://154.8.225.157:8080/"}
{"channel":"pc", "resUrl":"http://cdn-jl.lanjingshidai.com/shangwu/", "packageVersion":"0.1", "subChannel":"999", "version":"0.1.19", "serverUrl":"http://154.8.225.157:8080/"}

View File

@ -0,0 +1,19 @@
热更文件版本china/xq_1eb3b4746a28992a3c3683fae1c705e2a2eb54f4_2022_03_29_17_58_22
热更文件的工程对应的提交信息:
commit 1eb3b4746a28992a3c3683fae1c705e2a2eb54f4
Merge: 5fbff92741 810fd2cacb
Author: zhangshanxue <zhangshanxue911@gmail.com>
Date: Tue Mar 29 17:04:53 2022 +0800
Merge branch 'china/test' into china/xq
热更大小25.82496547698974609375
热更文件:
lz4/icons.unity3d
lz4/icon/fabao.unity3d
lz4/icon/hero.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lz4/prefabs/ui/gem.unity3d
lz4/prefabs/ui/generalpanel.unity3d
lz4/prefabs/ui/roleinfo.unity3d
lzma/luabytes.unity3d
files.unity3d

View File

@ -1 +1 @@
{"subChannel":"2000","buglyId":"261348dcd3","channel":"MHT","resUrl":"http://jl.tyu89.wang/mht_china/test/","packageVersion":"0.1","version":"0.1.222","serverUrl":"http://81.71.44.85:8080/"}
{"subChannel":"2000","buglyId":"261348dcd3","channel":"MHT","resUrl":"http://jl.tyu89.wang/mht_china/test/","packageVersion":"0.1","version":"0.1.223","serverUrl":"http://81.71.44.85:8080/"}

View File

@ -0,0 +1,9 @@
lz4/icons.unity3d
lz4/icon/fabao.unity3d
lz4/icon/hero.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lz4/prefabs/ui/gem.unity3d
lz4/prefabs/ui/generalpanel.unity3d
lz4/prefabs/ui/roleinfo.unity3d
lzma/luabytes.unity3d
files.unity3d

View File

@ -0,0 +1,17 @@
热更文件版本mht_china/xq_cdn_xq_test_2022_03_29_17_59_23
热更版本号0.1.224
热更大小25.82496547698974609375
热更文件:
lz4/icons.unity3d
lz4/icon/fabao.unity3d
lz4/icon/hero.unity3d
lz4/prefabs/ui/findtreasure.unity3d
lz4/prefabs/ui/gem.unity3d
lz4/prefabs/ui/generalpanel.unity3d
lz4/prefabs/ui/roleinfo.unity3d
lzma/luabytes.unity3d
files.unity3d
CDN TYPE: cos
TOOLS DIR: E:/JL/JL_HotFix/Tools/cos
UPLOAD COMMAND: python UpLoad.py E:/JL/JL_HotFix/Root/mht_china/xq cdn_xq_test mht_china_xq_cdn_xq_test_2022_03_29_17_59_23 1 >>E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test//__HotFixLog/mht_china_xq_cdn_xq_test_2022_03_29_17_59_23_UpLoad.log
Flush COMMAND: python Flush.py http://jl.tyu89.wang/mht_china/test/ >>E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test//__HotFixLog/mht_china_xq_cdn_xq_test_2022_03_29_17_59_23_UpLoad.log

View File

@ -0,0 +1,45 @@
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/icons.unity3d
mht_china/test/Android/lz4/icons.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/icons.unity3d ,headers=:{}
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/icon/hero.unity3d
mht_china/test/Android/lz4/icon/hero.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/icon/hero.unity3d ,headers=:{}
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/icon/fabao.unity3d
mht_china/test/Android/lz4/icon/fabao.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/icon/fabao.unity3d ,headers=:{}
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/prefabs/ui/findtreasure.unity3d
mht_china/test/Android/lz4/prefabs/ui/findtreasure.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/prefabs/ui/findtreasure.unity3d ,headers=:{}
"34e32475070db37b15a46b248804e3c4"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/prefabs/ui/gem.unity3d
mht_china/test/Android/lz4/prefabs/ui/gem.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/prefabs/ui/gem.unity3d ,headers=:{}
"6e349414ca30ef67eae75c8c4c24e03c"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/prefabs/ui/generalpanel.unity3d
mht_china/test/Android/lz4/prefabs/ui/generalpanel.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/prefabs/ui/generalpanel.unity3d ,headers=:{}
"5b1052c0804a42a4b6c3b75eee40f9c4"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lz4/prefabs/ui/roleinfo.unity3d
mht_china/test/Android/lz4/prefabs/ui/roleinfo.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lz4/prefabs/ui/roleinfo.unity3d ,headers=:{}
"16120e7e18d817b6b75897043540b9ab"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/lzma/luabytes.unity3d
mht_china/test/Android/lzma/luabytes.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/lzma/luabytes.unity3d ,headers=:{}
"ac9912919e78b0fbcdc0ab50bbaf354b"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/Android/files.unity3d
mht_china/test/Android/files.unity3d
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/files.unity3d ,headers=:{}
"ee702928d95e1372975a715e9fe6d7da"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/config.txt
mht_china/test/Android/config.txt
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/config.txt ,headers=:{}
"6a3ad19b37fadd0d86bdaae6276c540c"
E:/JL/JL_HotFix/Root/mht_china/xq/cdn_xq_test/version.txt
mht_china/test/Android/version.txt
INFO:qcloud_cos.cos_client:put object, url=:https://internal-jieling-1302131159.cos.ap-guangzhou.myqcloud.com/mht_china/test/Android/version.txt ,headers=:{}
"45f2a1373c15b9a5912c54541feb7325"
"0029d42db2773612dc0fb962945c8efb"
"4a9d61e248ed7c2c6fd8e58a1291e383"
"8616f03f54ccc8833e669419f03b7a03"
{"RequestId": "c36eb076-a92e-4de5-bee9-36a2be663d65", "TaskId": "401006298184868850"}

View File

@ -1 +1 @@
{"subChannel":"2000","buglyId":"261348dcd3","channel":"MHT","resUrl":"http://jl.tyu89.wang/mht_china/test/","packageVersion":"0.1","version":"0.1.223","serverUrl":"http://81.71.44.85:8080/"}
{"subChannel":"2000","buglyId":"261348dcd3","channel":"MHT","resUrl":"http://jl.tyu89.wang/mht_china/test/","packageVersion":"0.1","version":"0.1.224","serverUrl":"http://81.71.44.85:8080/"}

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
import json
import sys
import requests
if sys.argv.__len__() == 2:
flashPath = sys.argv[1]
urlPath = "http://smi.51sfsy.com/mrj/cdnrefresh?nonce=1532319693&token=881d1b9844fb78c165dad28752d67eb8&dirs="
# path = urlPath + "'" + flashPath +"'"
path = urlPath + flashPath
print(path)
r = requests.get(url= path)
print(r.status_code)
print(r.text)
else:
print("params error!")

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import json
import sys
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdn.v20180606 import cdn_client, models
if sys.argv.__len__() == 2:
try:
path = sys.argv[1]
cred = credential.Credential("AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN", "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M")
httpProfile = HttpProfile()
httpProfile.endpoint = "cdn.tencentcloudapi.com"
clientProfile = ClientProfile()
clientProfile.httpProfile = httpProfile
client = cdn_client.CdnClient(cred, "", clientProfile)
req = models.PurgePathCacheRequest()
params = {
"Paths": [ path ],
"FlushType": "flush"
}
req.from_json_string(json.dumps(params))
resp = client.PurgePathCache(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
else:
print("params error!")

View File

@ -0,0 +1,138 @@
# -*- coding: utf-8 -*-
# Auther Wang Qi
# !usrbinenv python
# encoding utf-8
import os
import sys
import base64
import hashlib
import requests
import subprocess
import urllib3
import logging
import time
import random
import argparse
import json
from threading import Thread, current_thread
from concurrent.futures import ProcessPoolExecutor
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
# url = "http://jl.tyu89.wang/" + cos_object_key
# print(url)
#self.flushurl(url)
# def flushurl(self,url)
# keydict = {
# 'Action' 'RefreshCdnUrl',
# 'Timestamp' str(int(time.time())),
# 'Nonce' str(int(random.random() 1000)),
# 'SecretId' jlrg.secret_id,
# 'urls.0' url
# }
# return keydict
def upload_file_to_txy_cos(self, path, file):
file = file.replace("\\", "/")
path = path.replace("\\", "/")
local_file_path = path + file
print(local_file_path)
cos_object_key = self.cdn_sub_dir + "/" + self.platform +"/" + file
print(cos_object_key)
response = self.client.upload_file(
Bucket=self.bucket,
LocalFilePath=local_file_path,
Key=cos_object_key,
PartSize=1,
MAXThread=10,
EnableMD5=False
)
print(response['ETag'])
class Cos_Upload():
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
def __init__(self, *args):
abDir = args[0]
settingDir = args[1]
changeVersion = args[2]
isThread = "1"
if args.__len__() > 3:
isThread = args[3]
self.init(abDir, settingDir, changeVersion, isThread)
def init(self, abDir, settingDir, changeVersion, isThread):
self.settingFile = "Setting.txt"
self.configFile = "config.txt"
self.versionFile = "version.txt"
self.fileList = []
self.setting_dir = abDir + "/" + settingDir
self.ab_dir = self.setting_dir
self.change_version = changeVersion
self.change_file = self.setting_dir + "/__HotFixLog/" + changeVersion + ".log"
self.loadSetting()
if self.EncryptKey:
self.configFile = self.EncryptKey + self.configFile
self.versionFile = self.EncryptKey + self.versionFile
self.IsThread = isThread
# cdn config
self.bucket = '648sy-tcx-1251752472'
self.secret_id = "AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN"
self.secret_key = "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M"
self.region = "ap-beijing"
self.config = CosConfig(Region=self.region, SecretId=self.secret_id, SecretKey=self.secret_key, Token=None, Scheme='https')
self.client = CosS3Client(self.config)
def loadSetting(self):
settingContent = open(self.setting_dir +"/"+ self.settingFile, "rb")
settingJson = json.load(settingContent)
self.cdn_sub_dir = settingJson["dir"]
self.platform = settingJson["platform"]
if ("EncryptKey" in settingJson) :
self.EncryptKey = settingJson["EncryptKey"]
else:
self.EncryptKey = ""
def get_all_file(self):
fo = open(self.change_file, "r")
files = fo.readlines()
#print(files)
for f in files:
file = f.strip()
self.fileList.append(file)
return self.fileList
def up(self):
filelist = self.get_all_file()
if self.IsThread == "1":
pool = ProcessPoolExecutor(4)
for file in filelist:
pool.submit(upload_file_to_txy_cos, self, self.ab_dir + "/" + self.platform + "/", file)
pool.submit(upload_file_to_txy_cos, self, self.setting_dir +"/", self.configFile)
pool.submit(upload_file_to_txy_cos, self, self.setting_dir +"/", self.versionFile)
else:
for file in filelist:
upload_file_to_txy_cos(self, self.ab_dir + "/" + self.platform + "/", file)
upload_file_to_txy_cos(self, self.setting_dir +"/", self.configFile)
upload_file_to_txy_cos(self, self.setting_dir +"/", self.versionFile)
if __name__ == '__main__':
if sys.argv.__len__() == 4:
t = Cos_Upload(sys.argv[1], sys.argv[2], sys.argv[3])
t.up()
elif sys.argv.__len__() == 5:
t = Cos_Upload(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])
t.up()
else:
print("params error!")
# if __name__ == '__main__':
# z = Cos_Upload("D:/HotFix/Root/mht_china/local", "cdn_v3", 'version_1')
# z.up()

Binary file not shown.

View File

@ -0,0 +1,10 @@
依赖python 2.7
安装多线程库
pip install futures
安装 腾讯云 cosclient
pip install cos-python-sdk-v5
安装 tencentcloud-sdk-python
pip install tencentcloud-sdk-python

View File

@ -0,0 +1,8 @@
账号未提供
bucket = '648sy-tcx-1251752472'
secret_id = "AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN"
secret_key = "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M"
region = "ap-beijing"
域名http://c-tcx.648sy.com/

View File

@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
import json
import sys
import requests
if sys.argv.__len__() == 2:
flashPath = sys.argv[1]
urlPath = "http://smi.51sfsy.com/mrj/cdnrefresh?nonce=1532319693&token=881d1b9844fb78c165dad28752d67eb8&dirs="
# path = urlPath + "'" + flashPath +"'"
path = urlPath + flashPath
print(path)
r = requests.get(url= path)
print(r.status_code)
print(r.text)
else:
print("params error!")

View File

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
import json
import sys
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdn.v20180606 import cdn_client, models
if sys.argv.__len__() == 2:
try:
path = sys.argv[1]
cred = credential.Credential("AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN", "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M")
httpProfile = HttpProfile()
httpProfile.endpoint = "cdn.tencentcloudapi.com"
clientProfile = ClientProfile()
clientProfile.httpProfile = httpProfile
client = cdn_client.CdnClient(cred, "", clientProfile)
req = models.PurgePathCacheRequest()
params = {
"Paths": [ path ],
"FlushType": "flush"
}
req.from_json_string(json.dumps(params))
resp = client.PurgePathCache(req)
print(resp.to_json_string())
except TencentCloudSDKException as err:
print(err)
else:
print("params error!")

View File

@ -0,0 +1,138 @@
# -*- coding: utf-8 -*-
# Auther Wang Qi
# !usrbinenv python
# encoding utf-8
import os
import sys
import base64
import hashlib
import requests
import subprocess
import urllib3
import logging
import time
import random
import argparse
import json
from threading import Thread, current_thread
from concurrent.futures import ProcessPoolExecutor
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client
# url = "http://jl.tyu89.wang/" + cos_object_key
# print(url)
#self.flushurl(url)
# def flushurl(self,url)
# keydict = {
# 'Action' 'RefreshCdnUrl',
# 'Timestamp' str(int(time.time())),
# 'Nonce' str(int(random.random() 1000)),
# 'SecretId' jlrg.secret_id,
# 'urls.0' url
# }
# return keydict
def upload_file_to_txy_cos(self, path, file):
file = file.replace("\\", "/")
path = path.replace("\\", "/")
local_file_path = path + file
print(local_file_path)
cos_object_key = self.cdn_sub_dir + "/" + self.platform +"/" + file
print(cos_object_key)
response = self.client.upload_file(
Bucket=self.bucket,
LocalFilePath=local_file_path,
Key=cos_object_key,
PartSize=1,
MAXThread=10,
EnableMD5=False
)
print(response['ETag'])
class Cos_Upload():
logging.basicConfig(level=logging.INFO, stream=sys.stdout)
def __init__(self, *args):
abDir = args[0]
settingDir = args[1]
changeVersion = args[2]
isThread = "1"
if args.__len__() > 3:
isThread = args[3]
self.init(abDir, settingDir, changeVersion, isThread)
def init(self, abDir, settingDir, changeVersion, isThread):
self.settingFile = "Setting.txt"
self.configFile = "config.txt"
self.versionFile = "version.txt"
self.fileList = []
self.setting_dir = abDir + "/" + settingDir
self.ab_dir = self.setting_dir
self.change_version = changeVersion
self.change_file = self.setting_dir + "/__HotFixLog/" + changeVersion + ".log"
self.loadSetting()
if self.EncryptKey:
self.configFile = self.EncryptKey + self.configFile
self.versionFile = self.EncryptKey + self.versionFile
self.IsThread = isThread
# cdn config
self.bucket = '648sy-tcx-1251752472'
self.secret_id = "AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN"
self.secret_key = "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M"
self.region = "ap-beijing"
self.config = CosConfig(Region=self.region, SecretId=self.secret_id, SecretKey=self.secret_key, Token=None, Scheme='https')
self.client = CosS3Client(self.config)
def loadSetting(self):
settingContent = open(self.setting_dir +"/"+ self.settingFile, "rb")
settingJson = json.load(settingContent)
self.cdn_sub_dir = settingJson["dir"]
self.platform = settingJson["platform"]
if ("EncryptKey" in settingJson) :
self.EncryptKey = settingJson["EncryptKey"]
else:
self.EncryptKey = ""
def get_all_file(self):
fo = open(self.change_file, "r")
files = fo.readlines()
#print(files)
for f in files:
file = f.strip()
self.fileList.append(file)
return self.fileList
def up(self):
filelist = self.get_all_file()
if self.IsThread == "1":
pool = ProcessPoolExecutor(4)
for file in filelist:
pool.submit(upload_file_to_txy_cos, self, self.ab_dir + "/" + self.platform + "/", file)
pool.submit(upload_file_to_txy_cos, self, self.setting_dir +"/", self.configFile)
pool.submit(upload_file_to_txy_cos, self, self.setting_dir +"/", self.versionFile)
else:
for file in filelist:
upload_file_to_txy_cos(self, self.ab_dir + "/" + self.platform + "/", file)
upload_file_to_txy_cos(self, self.setting_dir +"/", self.configFile)
upload_file_to_txy_cos(self, self.setting_dir +"/", self.versionFile)
if __name__ == '__main__':
if sys.argv.__len__() == 4:
t = Cos_Upload(sys.argv[1], sys.argv[2], sys.argv[3])
t.up()
elif sys.argv.__len__() == 5:
t = Cos_Upload(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])
t.up()
else:
print("params error!")
# if __name__ == '__main__':
# z = Cos_Upload("D:/HotFix/Root/mht_china/local", "cdn_v3", 'version_1')
# z.up()

Binary file not shown.

View File

@ -0,0 +1,10 @@
依赖python 2.7
安装多线程库
pip install futures
安装 腾讯云 cosclient
pip install cos-python-sdk-v5
安装 tencentcloud-sdk-python
pip install tencentcloud-sdk-python

View File

@ -0,0 +1,8 @@
账号未提供
bucket = '648sy-tcx-1251752472'
secret_id = "AKIDwhBYeT2LN8cqoa6ML2SbT5RVJq76pHSN"
secret_key = "f4C5h38vRhgPr2wZw2rPfeNpzsTord8M"
region = "ap-beijing"
域名http://c-tcx.648sy.com/