Beispiel #1
0
    def run(self):
        """ execute everything """
        for package in self.packages:
            self.log.info("Checking package: %s", package)
            owner, package, branch, version = self.parsePackage(package)
            prerelease = not self.properRelease
            try:
                dryRun = not self.makeTags
                thisPackage = Repo(owner,
                                   package,
                                   branch=branch,
                                   newVersion=version,
                                   preRelease=prerelease,
                                   dryRun=dryRun,
                                   lastTag=self.lastTag)
                self.repos.append(thisPackage)
            except RuntimeError as e:
                self.log.error("Failure for %s/%s/%s/%s", owner, package,
                               branch, version)
                self.errors.append(str(e))

        if self.errors:
            self.abort()

        self._printReleaseNotes()
        self._commitAndTag()

        self._printVersionsFile()
        checkRate()
Beispiel #2
0
 def test_ctor_2(self):
     """ test the constructor """
     self.repo = Repo(owner="tester",
                      repo="testrepo",
                      branch="testbranch",
                      newVersion="v01-03-20",
                      preRelease=False,
                      dryRun=True)
     self.assertEqual(self.repo.newVersion, "v01-03-20")
     self.assertEqual(self.repo.newTag, "v01-03-20")
     self.assertFalse(self.repo.isPreRelease)
     self.assertTrue(self.repo._dryRun)
Beispiel #3
0
 def test_ctor_fail_2(self):
     """ test the constructor when the desired pre-version is the same as an existing one"""
     myTagInfo = [{
         "name": "v01-03-20",
         "commit": {
             "sha": "MyTagSha2",
             "url": "http://localhost/foo/bar"
         },
         "zipball_url": "zipball/v0.1",
         "tarball_url": "tarball/v0.1"
     }]
     with self.assertRaisesRegexp( RuntimeError, "Invalid version required"), \
          patch( "tagging.gitinterface.Repo.getGithubTags", new=Mock( return_value=myTagInfo)):
         self.repo = Repo(owner="tester",
                          repo="testrepo",
                          branch="testbranch",
                          newVersion="v01-03-19",
                          preRelease=True,
                          dryRun=True)