import os
import sys
import shutil
-import hashlib
from xml.dom import minidom
from common.buildtrigger import trigger_info
-from common.buildservice import BuildService
from common.utils import sync
def restructure_output_dir(package_build_dict, target_path):
return package_build_dict
-def get_buildconf(build, project, target_path_base):
- """ Get build conf from through OSC api
- """
-
- conf_str = build.get_project_config(project)
-
- with open(os.path.join(target_path_base,
- "%s-build.conf" %hashlib.md5(conf_str).hexdigest()),
- 'w') as conf_fh:
- conf_fh.write(conf_str)
-
def main():
"""Script entry point.
"""
print '---[JOB STARTED: buildlog ]-------------------------'
- obs_api = os.getenv("OBS_API_URL")
- obs_user = os.getenv("OBS_API_USERNAME")
- obs_passwd = os.getenv("OBS_API_PASSWD")
-
build_base_path = os.getenv("PATH_OBS_BUILD_BASE", "/srv/obs/build")
sync_out_dir = os.path.join(os.getenv('WORKSPACE'),
'buildlogs',
repository))
- build = BuildService(obs_api, obs_user, obs_passwd)
-
- # Get OBS project build conf
- get_buildconf(build, project, os.path.join(sync_out_dir, 'builddata'))
-
# sync to donwload server
sync(sync_out_dir, sync_dest)