1 Star 0 Fork 0

小小梦想--/CloudClass-Android

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ci.env.py 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
陈镜吾 提交于 2021-06-17 18:29 . release release/apaas/1.1.2
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import ast
import os
import re
import shutil
TARGET_LIBS_ZIP = "agora_sdk.zip"
TARGET_INTERNAL_FOLDER = "agora_sdk"
def main():
rtcSdkUrl = ""
if "rtcSdkUrl" in os.environ:
rtcSdkUrl = os.environ["rtcSdkUrl"]
downloadSDK(rtcSdkUrl)
rtmSdkUrl = ""
if "rtmSdkUrl" in os.environ:
rtmSdkUrl = os.environ["rtmSdkUrl"]
downloadSDK(rtmSdkUrl)
if rtcSdkUrl.strip() or rtmSdkUrl.strip():
if not os.path.exists("app/libs"):
os.mkdir("app/libs")
mv = "cp -f -r " + TARGET_INTERNAL_FOLDER + "/*/libs/* app/libs"
os.system(mv)
os.remove(TARGET_LIBS_ZIP)
shutil.rmtree(TARGET_INTERNAL_FOLDER, ignore_errors=True)
if "configFile" in os.environ and "configMap" in os.environ:
configFile = os.environ["configFile"]
print("configFile", configFile)
configMap = ast.literal_eval(os.environ["configMap"])
print("configMap", configMap)
if configFile and configMap:
# if need reset
f = open(configFile, 'r+')
content = f.read()
contentNew = content
for key in configMap:
print("key", key)
contentNew = re.sub(r'<#' + key + '#>', configMap[key], contentNew)
f.seek(0)
f.write(contentNew)
f.truncate()
def downloadSDK(url):
wget = "wget " + url + " -O " + TARGET_LIBS_ZIP
os.system(wget)
unzip = "unzip " + TARGET_LIBS_ZIP + " \"*/libs/*\" -d " + TARGET_INTERNAL_FOLDER
os.system(unzip)
if __name__ == "__main__":
main()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/naojiangzhalie666/CloudClass-Android.git
git@gitee.com:naojiangzhalie666/CloudClass-Android.git
naojiangzhalie666
CloudClass-Android
CloudClass-Android
master

搜索帮助