#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Cockpit. # # Copyright (C) 2016 Red Hat, Inc. # # Cockpit is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later version. # # Cockpit is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Cockpit; If not, see . import argparse import glob import os import subprocess import sys import shutil import tempfile sys.dont_write_bytecode = True import task BOTS = os.path.dirname(__file__) def run(context, verbose=False, **kwargs): system = context or "f26" make_srpm = os.path.join(BOTS, "..", "tools", "make-srpm") srpm = subprocess.check_output([make_srpm], shell=True).strip() # Do a build cmd = ["koji", "build", "--wait", "--scratch", system, srpm] subprocess.check_call(cmd) if __name__ == '__main__': task.main(function=run, title="Build source code in Koji")