Don't build from scm locally

This commit is contained in:
Jakub Kadlcik
2017-07-24 23:07:59 +02:00
parent aebfb1b812
commit 92102a2ac0

View File

@@ -241,7 +241,7 @@ class CoprModuleBuilder(GenericBuilder):
with CoprModuleBuilder._build_lock:
# Git sources are treated specially.
if source.startswith(("git://", "http://", "https://")):
return build_from_scm(artifact_name, source, self.config, self.build_srpm)
return self.build_scm(source)
else:
return self.build_srpm(artifact_name, source)
@@ -257,13 +257,14 @@ class CoprModuleBuilder(GenericBuilder):
return response.data["ids"][0], koji.BUILD_STATES["BUILDING"], response.message, None
def build_scm(self, source):
# @TODO use this method once support on Copr side is finished
# Copr is currently able to create a build from fedora distgit,
# but not from custom distgit, such as copr-dist-git
url, branch = source.split("?#")
url = (url.replace("git://", "https://")
.replace("pkgs.fedoraproject.org", "src.fedoraproject.org/git"))
self.client.create_new_build_distgit(self.copr.projectname, url, branch=branch, username=self.copr.username)
response = self.client.create_new_build_distgit(self.copr.projectname, url, branch=branch, username=self.copr.username)
if response.output != "ok":
log.error(response.error)
return response.data["ids"][0], koji.BUILD_STATES["BUILDING"], response.message, None
def finalize(self):
modulemd = tempfile.mktemp()