-- coding: utf-8 --
import os
os.system(“rm -f log”)
os.system(“ssh -p 29418 username@XXXXXXX gerrit ls-projects > log”)
f = open(“log”)
while True:
line = f.readline().replace(“\r”,“”).strip()
if line:
os.system(“ssh -p 29418 username@192.168.10.200 gerrit create-project %s --branch master --parent All-Projects --empty-commit”%(line))
print (line)
else:
break
f.close()
‘’'ssh -p 29418 username@192.168.10.200 gerrit set-project-parent ----parent All-Projects %s
设置父项目
ssh -p 29418 username@192.168.10.200 gerrit create-account SCM --http-password 123456
gerrit create-account USERNAME [–] [–deadline VAL] [–email EMAIL] [–full-name NAME] [–group (-g) GROUP] [–help (-h)] [–http-password PASSWORD] [–ssh-key -|KEY] [–trace] [–trace-id VAL]
创建账号
‘’’