Advertisement
Guest User

Untitled

a guest
Apr 6th, 2017
13
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class PackageFactory(BuildFactory):
  2. from buildbot.steps.shell import ShellCommand
  3. from buildbot.process.properties import Property
  4. def __init__(self, project, projectdir, git, distro, arches, **kwargs):
  5. self._project = project
  6. self._projectdir = projectdir
  7. self._git = git
  8. self._distro = distro
  9. self._buildroot = "build"
  10. self._workdir = os.path.join(self._buildroot, self._projectdir)
  11. self._base_master_path = os.path.join("public_html", "pkgs", self._distro, self._project)
  12. self._base_pkg_url = "/" + os.path.join("buildbot", "pkgs", self._distro, self._project)
  13.  
  14. BuildFactory.__init__(self, **kwargs)
  15. self.addStep(Git(workdir=self._workdir, repourl=self._git, mode='full'))
  16. self.addStep(FileDownload(workdir=self._buildroot, mastersrc="~/local-files/debian-packaging/debian_" + self._project + ".tar.gz", slavedest="debian.tar.gz"))
  17. self.addStep(ShellCommand(workdir=self._workdir, command=["tar", "xvzf", "../debian.tar.gz"], logEnviron=False, name="debian prep"))
  18. #self.addStep(Autogen(workdir=self._workdir))
  19. # use haltOnFailure=True later
  20. #self.addStep(PyFlakes(command=["pyflakes", "."], haltOnFailure=True))
  21. self.addStep(PyFlakes(command=["pyflakes", "."]))
  22. self.addStep(DebGetVersion(workdir=self._workdir))
  23. #self.addStep(UpstreamGetVersion(workdir=self._workdir))
  24. self.addStep(shell.SetPropertyFromCommand(command='grep version setup.py | grep = | cut -d = -f2 | cut -d"\'" -f2 ', property="upstreamPkgVer"))
  25. self.addStep(DebComputeNewVersion(master_path=self._base_master_path, pkg_url=self._base_pkg_url))
  26. self.addStep(DebDch(workdir=self._workdir))
  27. self.addStep(DebBuildorig(workdir=self._workdir))
  28. self.addStep(DebTempDir(workdir=self._workdir))
  29. for arch in arches:
  30. self.addStep(DebCowbuilder(workdir=self._workdir, distribution=distro, architecture=arch, warningPattern='IDONTWANTANYWARNINGHERE'))
  31. self.addStep(DebCollectSrc(workdir=self._workdir))
  32. self.addStep(DebCollectBin(workdir=self._workdir))
  33. self.addStep(DebPrepareUpload(workdir=self._workdir))
  34. self.addStep(DirectoryUpload(slavesrc=Interpolate("%(prop:debTempDir)s"), masterdest=Interpolate("%(prop:masterPath)s"), url=Interpolate("%(prop:pkgUrl)s")))
  35. self.addStep(DebPackages())
  36. self.addStep(DebSources())
  37. # Add back when fixed
  38. #self.addStep(PyLint(command=["pylint", "."]))
  39. self.addStep(RepoLinkCurrent(to="latest", path=self._base_master_path))
  40. self.addStep(RemoveDirectory(dir=Interpolate("%(prop:debTempDir)s", alwaysRun=True)))
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement