我想保存每晚构建的副本,我认为将每个构建放入其自己的每日文件夹中是个好主意。但是,我无法使用 buildbot master.cfg 中的时间,因为它是在配置时设置的:
copy_files = [".\\release\\MyProgram.exe",
".\\install\\ChangeLog.js",
".\\translations.txt"]
server_dest_path_by_date = server_dest_path + "\\{0}".format(time.strftime("%Y-%m-%d"))
my_return.addStep(steps.MakeDirectory(dir=server_dest_path_by_date))
for file in copy_files:
my_return.addStep(ShellCommand(command=["copy", file, server_dest_path_by_date, "/y"]))
如何获取在目的地使用的当前运行日期?
更好的方法是使用自定义渲染器util.Interpolate(...)
@util.renderer
def cur_date(props):
return datetime.date.today().isoformat()
然后在构建工厂步骤中将其用作自定义关键字
cppcheck_dst = '/home/upload/%(kw:cur_date)s/'
bF.addStep(steps.MakeDirectory(dir=util.Interpolate(cppcheck_dst, cur_date=cur_date)))
bF.addStep(steps.CopyDirectory(src='build/build.scan/static/',
dest=util.Interpolate(cppcheck_dst, cur_date=cur_date)))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)