forked from plutoless/eEducation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.env.py
executable file
·40 lines (33 loc) · 1.27 KB
/
ci.env.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import re
import os
def main():
os.system("pod install")
agoraAppId = ""
agoraRTCToken = ""
agoraRTMToken = ""
whiteBoardToken = ""
if "AGORA_APP_ID" in os.environ:
agoraAppId = os.environ["AGORA_APP_ID"]
if "AGORA_RTC_TOKEN" in os.environ:
agoraRTCToken = os.environ["AGORA_RTC_TOKEN"]
if "AGORA_RTM_TOKEN" in os.environ:
agoraRTMToken = os.environ["AGORA_RTM_TOKEN"]
if "WHITE_BOARD_TOKEN" in os.environ:
whiteBoardToken = os.environ["WHITE_BOARD_TOKEN"]
f = open("./AgoraEducation/KeyCenter.m", 'r+')
content = f.read()
agoraAppIdString = "@\"" + agoraAppId + "\""
agoraRTCTokenString = "@\"" + agoraRTCToken + "\""
agoraRTMTokenString = "@\"" + agoraRTMToken + "\""
whiteBoardTokenString = "@\"" + whiteBoardToken + "\""
contentNew = re.sub(r'<#Your Agora App Id#>', agoraAppIdString, content)
contentNew = re.sub(r'<#Your Agora RTC Token#>', agoraRTCTokenString, contentNew)
contentNew = re.sub(r'<#Your Agora RTM Token#>', agoraRTMTokenString, contentNew)
contentNew = re.sub(r'<#Your White Token#>', whiteBoardTokenString, contentNew)
f.seek(0)
f.write(contentNew)
f.truncate()
if __name__ == "__main__":
main()