-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
heimanba
committed
Apr 12, 2022
1 parent
3331f54
commit 86d4b64
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import subprocess | ||
import time | ||
|
||
with open('update.list') as f: | ||
publish_list = [eve_app.strip() for eve_app in f.readlines()] | ||
|
||
for eve_app in publish_list: | ||
times = 1 | ||
while times <= 3: | ||
print("----------------------: ", eve_app) | ||
publish_script = 'https://serverless-registry.oss-cn-hangzhou.aliyuncs.com/publish-file/python3/hub-publish.py' | ||
command = 'cd %s && wget %s && python hub-publish.py' % (eve_app, publish_script) | ||
child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, ) | ||
stdout, stderr = child.communicate() | ||
if child.returncode == 0: | ||
print("stdout:", stdout.decode("utf-8")) | ||
break | ||
else: | ||
print("stdout:", stdout.decode("utf-8")) | ||
print("stderr:", stderr.decode("utf-8")) | ||
time.sleep(3) | ||
if times == 3: | ||
raise ChildProcessError(stderr) | ||
times = times + 1 |