74
74
build_dir_path = os.path.join(uploads_path, build_path)
75
75
user_name = ret_val[0]
76
76
job_name = '_'.join(ret_val[1:])
77
target_dir = '/'.join([args.job_type, "~%s" % user_name, job_name,
77
target_dir = '/'.join([args.job_type, "~%s" % user_name,
78
job_name, str(args.build_num)])
79
79
target_dir_path = os.path.join(target_path, target_dir)
80
80
elif args.job_type == "kernel-hwpack":
81
81
kernel_tree = ret_val
130
130
return build_dir_path, target_dir_path
132
def create_symlink(self, target_dir_path):
133
target_parent_dir = os.path.dirname(target_dir_path)
134
symlink_path = os.path.join(target_parent_dir, "lastSuccessful")
132
def create_symlink(self, args, target_dir_path):
133
symlink_path = os.path.dirname(target_dir_path)
134
if args.job_type == "android":
135
symlink_path = os.path.join(symlink_path, "lastSuccessful")
137
symlink_path = os.path.join(symlink_path, "latest")
139
header_path = os.path.join(target_path, "HEADER.html")
140
header_symlink_path = os.path.join(target_dir_path, "HEADER.html")
136
142
if os.path.islink(symlink_path):
137
143
os.unlink(symlink_path)
145
if os.path.islink(header_symlink_path):
146
os.unlink(header_symlink_path)
148
os.symlink(header_path, header_symlink_path)
139
149
os.symlink(target_dir_path, symlink_path)
140
print "The lastSuccessful build is now linked to ", target_dir_path
150
print "The latest build is now linked to ", target_dir_path
142
152
except Exception, details:
143
153
print "Failed to create symlink", symlink_path, ":", details
206
216
self.move_dir_content(build_dir_path, target_dir_path)
208
if args.job_type == "android":
209
ret = self.create_symlink(target_dir_path)
218
if args.job_type == "android" or\
219
args.job_type == "ubuntu-hwpacks" or\
220
args.job_type == "ubuntu-images" or\
221
args.job_type == "ubuntu-sysroots":
222
ret = self.create_symlink(args, target_dir_path)