Skip to content

Commit 86d4b64

Browse files
author
heimanba
committed
add publish.py
1 parent 3331f54 commit 86d4b64

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

publish.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import subprocess
2+
import time
3+
4+
with open('update.list') as f:
5+
publish_list = [eve_app.strip() for eve_app in f.readlines()]
6+
7+
for eve_app in publish_list:
8+
times = 1
9+
while times <= 3:
10+
print("----------------------: ", eve_app)
11+
publish_script = 'https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py'
12+
command = 'cd %s && wget %s && python hub-publish.py' % (eve_app, publish_script)
13+
child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, )
14+
stdout, stderr = child.communicate()
15+
if child.returncode == 0:
16+
print("stdout:", stdout.decode("utf-8"))
17+
break
18+
else:
19+
print("stdout:", stdout.decode("utf-8"))
20+
print("stderr:", stderr.decode("utf-8"))
21+
time.sleep(3)
22+
if times == 3:
23+
raise ChildProcessError(stderr)
24+
times = times + 1

0 commit comments

Comments
 (0)