예제 #1
0
    def updateProductVersion(self):

        os.chdir(self.productRepoPath)

        lastTag = utility.captureCommandOutput(
            "git describe --tags --abbrev=0")

        matches = re.search("v?(\d+(?:\.\d+)+)-(\w+)", lastTag)

        if not matches:
            utility.printError(
                "Unable to extract version information from Git tags.")
            raise SystemExit(1)

        self.productVersion = matches.group(1)
        self.productStage = matches.group(2)
        self.productRevision = utility.captureCommandOutput(
            "git rev-parse --short=8 HEAD")
        self.productPackageName = "-".join([
            self.productName, self.productVersion, self.productStage,
            self.platformVersion
        ]).lower()

        utility.printItem("productVersion: ", self.productVersion)
        utility.printItem("productStage: ", self.productStage)
        utility.printItem("productRevision: ", self.productRevision)
        utility.printItem("productPackageName: ", self.productPackageName)

        os.chdir(self.toplevelPath)
예제 #2
0
    def updateProductVersion(self):

        if not os.path.exists(self.productVersionPath):

            utility.printWarning(
                "Unable to determine product version at this time; version file was missing:\n\t",
                self.productVersionPath)

        else:

            versionFile = open(self.productVersionPath, "r")
            versionData = versionFile.read()
            versionFile.close()

            versionParts = re.findall(r'set \(SYNERGY_VERSION_\w+ "?(\w+)"?\)',
                                      versionData)

            if len(versionParts) == 0:
                utility.printError("Failed to extract version information.")
                raise SystemExit(1)

            self.productVersion = ".".join(versionParts[0:-1])
            self.productStage = versionParts[-1]
            self.productRevision = utility.captureCommandOutput(
                "git rev-parse --short=8 HEAD")

        self.productPackageName = "-".join([
            self.productName, self.productVersion, self.productStage,
            self.platformVersion
        ]).lower()

        utility.printItem("productVersion: ", self.productVersion)
        utility.printItem("productStage: ", self.productStage)
        utility.printItem("productRevision: ", self.productRevision)
        utility.printItem("productPackageName: ", self.productPackageName)
예제 #3
0
         def resolvePath( self, name, mustExist = True ):

            path = getattr( self, name )
            if not path: return

            path = utility.joinPath( self.toplevelPath, os.path.expanduser( path ) )

            utility.printItem( name + ": ", path )

            if not os.path.exists( path ) and mustExist:
               utility.printError( "Required path does not exist:\n\t", path )
               raise SystemExit( 1 )

            setattr( self, name, path )
예제 #4
0
      def validateToplevelPath( self ):

         queriedURL = utility.captureCommandOutput( "git config --get remote.origin.url" )

         self.toplevelPath = utility.captureCommandOutput( "git rev-parse --show-toplevel" )

         utility.printItem( "toplevelPath: ", self.toplevelPath )
         utility.printItem( "upstreamURL: ", self.upstreamURL )
         utility.printItem( "queriedURL: ", queriedURL )

         if not os.path.exists( self.toplevelPath ):
            utility.printError( "Git top level path does not exist:\n\t", self.toplevelPath )
            raise SystemExit( 1 )

         if queriedURL != self.upstreamURL:
            utility.printError( "The upstream URL at the current working directory does not match project upstream URL:\n\t", queriedURL )
            raise SystemExit( 1 )