generated from root/miduo_client
cdn提交
parent
79486dbe06
commit
c82718ecef
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"cdn_type":"cos_fengTi_Ani",
|
||||||
|
"dir":"onePiece",
|
||||||
|
"platform":"Android"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"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":"0", "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"},
|
||||||
|
"USER_PROTO":{"desc":"", "versionCode":"0", "isActive":"1"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"subChannel":"2000","buglyId":"261348dcd3","channel":"FENGTI","resUrl":"http://bucket-crazy01-1253473776.cos.ap-beijing.myqcloud.com/fengTi/","packageVersion":"0.1","version":"1.1.20","serverUrl":"http://82.157.137.144:8080/"}
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"cdn_type":"cos_readOne",
|
||||||
|
"dir":"oneTest",
|
||||||
|
"platform":"Android"
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
{
|
||||||
|
"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":"40002", "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":"ZF"},
|
||||||
|
"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"},
|
||||||
|
"USER_PROTO":{"desc":"", "versionCode":"1", "isActive":"1"}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
{"subChannel":"2000","buglyId":"261348dcd3","channel":"XQOT","resUrl":"http://tcx01zx72-1254421167.cos.ap-beijing.myqcloud.com/oneTest/","packageVersion":"0.1","version":"1.1.1","serverUrl":"http://101.42.178.28:8080/"}
|
||||||
|
|
@ -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("AKID9KbyHSd2KROMHKRepqhOwY4WzQl1ENas", "Karz2DUalsrmgbZSBmHcrvlNo47FTZGt")
|
||||||
|
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!")
|
||||||
|
|
@ -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 = 'tcx01zx72-1254421167'
|
||||||
|
self.secret_id = "AKID9KbyHSd2KROMHKRepqhOwY4WzQl1ENas"
|
||||||
|
self.secret_key = "Karz2DUalsrmgbZSBmHcrvlNo47FTZGt"
|
||||||
|
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.
|
|
@ -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
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
账号未提供
|
||||||
|
|
||||||
|
bucket = 'tcx01zx7b-1254421167'
|
||||||
|
secret_id = "AKIDxqiXJ6mFc1MZnvztcM1X6kSMDA5pW3Pb"
|
||||||
|
secret_key = "FJDygBSX8ZoqncHxWwNyOl6FSjqlU2Qf"
|
||||||
|
region = "ap-beijing"
|
||||||
|
|
||||||
|
域名: tcx01z-1254421167.cos.ap-beijing.myqcloud.com
|
||||||
Binary file not shown.
Loading…
Reference in New Issue