Пример #1
0
    def build(self):
        """ this is where all the magic happens """

        try:
            spec = self._spec
            for project in self._spec.projects:
                LOG.info("Beginning to build '%s'", project.name)
                os.makedirs(project.install_path)

                LOG.info("Fetching source code for '%s'", project.name)
                repo = OpenstackGitRepo(project.giturl, project.gitref)
                repo.clone(project.install_path)
                review = GerritReview(repo.change_id, project.git_path)

                LOG.info("Creating the virtualenv for '%s'", project.name)
                execute(project.venv_command, project.install_path)

                LOG.info("Installing '%s' pip dependencies to the virtualenv",
                         project.name)
                execute(project.install_command %
                        review.build_pip_dependencies(string=True),
                        project.install_path)

                LOG.info("Installing '%s' to the virtualenv", project.name)
                execute(".venv/bin/python setup.py install",
                        project.install_path)

                if not spec.settings.all_in_one:
                    pkg = Package(project.package_name, project.version,
                                  project.install_path, True)
                    pkg.build()

        except Exception as e:
            LOG.exception("Oops. Something went wrong. Error was:\n%s", e)
            sys.exit(-1)
Пример #2
0
 def _get_gerrit_dependencies(self, repo, project):
     try:
         review = GerritReview(repo.head.change_id, project.git_path)
         return review.build_pip_dependencies()
     except Exception as e:
         LOG.warning("Could not install gerrit dependencies!!! "
                     "Error was: %s", e)
         return []
Пример #3
0
 def _get_gerrit_dependencies(self, repo, project):
     try:
         review = GerritReview(repo.head.change_id, project.git_path)
         return review.build_pip_dependencies()
     except Exception as e:
         LOG.warning(
             "Could not install gerrit dependencies!!! "
             "Error was: %s", e)
         return []
Пример #4
0
 def _install_gerrit_dependencies(self, repo, project, install_path):
     try:
         review = GerritReview(repo.head.change_id, project.git_path)
         LOG.info("Installing '%s' pip dependencies to the virtualenv",
                  project.name)
         execute(project.install_command %
                 review.build_pip_dependencies(string=True), install_path)
     except Exception as e:
         LOG.warning("Could not install gerrit dependencies!!! "
                     "Error was: %s", e)
Пример #5
0
 def _install_gerrit_dependencies(self, repo, project, install_path):
     try:
         review = GerritReview(repo.head.change_id, project.git_path)
         LOG.info("Installing '%s' pip dependencies to the virtualenv",
                  project.name)
         execute(
             project.install_command %
             review.build_pip_dependencies(string=True), install_path)
     except Exception as e:
         LOG.warning(
             "Could not install gerrit dependencies!!! "
             "Error was: %s", e)
Пример #6
0
 def gerrit_review(self):
     if not self._gerrit_review:
         self._gerrit_review = GerritReview(self.change_id, self.project,
                                            self.branch)
     return self._gerrit_review