コード例 #1
0
    def __init__(self, module):
        '''
        Constructor
        '''
        ActionBundle.__init__(self, module)
        
        # Generate a unique ActionBundle execution id
        guid = generateGUID()
        log.info("Unique ActionBundle execution ID generated: " + guid)
        
        # Check if JBOSS is running
        if getProcessPIDByPath(module.targetDeploymentPath): die("The JBOSS server at '" + module.targetDeploymentPath + "' is up. Installation will not continue")        
        
        # Prepare directory to unpack package
        unzippedPackagePath = createDirectoriesRecursively(scriptGlobals.workingDir + scriptGlobals.osDirSeparator + "unzippedPackage")
        
        # Since Builder is deployed on JBOSS some paths have an %s to allow a configurable 
        # profile, so do a little sprintf to fix them
        sprintfOnDictionaryValues(module.relativeConfigurationFiles, module.targetDeploymentProfile) 
        sprintfOnDictionaryValues(module.relativeCopyableFilesOrFolders, module.targetDeploymentProfile)
        sprintfOnListValues(module.subModule.relativeCleanUpFiles, module.targetDeploymentProfile)
        
        # Extract Builder package into tmp dir
        ExtractZipToDir(module.moduleFilename, unzippedPackagePath)
        
    
        # Do this again in case new settings have been added
        # Configure m-web-builder.properties using envprops
        # Configure mgage.properties using envprops
        for k, v in module.relativeConfigurationFiles.items():
            exactExtractedLocation = unzippedPackagePath + scriptGlobals.osDirSeparator + k
            ConfigureTemplateFile(module.name, lib.OptParser.options.envprops, exactExtractedLocation)
            CheckFileConfigurationIsComplete(exactExtractedLocation)
        
        
        # Copy m-web-builder.properties to conf
        # Copy mgage.properties to conf
        # Copy jboss-log4j.xml to conf
        for k, v in module.relativeConfigurationFiles.items():
            exactExtractedLocation = unzippedPackagePath + scriptGlobals.osDirSeparator + k
            exactTargetLocation = module.targetDeploymentPath + scriptGlobals.osDirSeparator + v 
            CopyDirOrFile(exactExtractedLocation, exactTargetLocation)       

        # Clean up files that might have been left over from previous manuall installations
        cleanUp(module)
        
        # Copy artifacts to profile
        for k, v in module.relativeCopyableFilesOrFolders.items():
            exactExtractedLocation = unzippedPackagePath + scriptGlobals.osDirSeparator + k
            exactTargetLocation = module.targetDeploymentPath + scriptGlobals.osDirSeparator + v 
            CopyDirOrFile(exactExtractedLocation, exactTargetLocation)
                
        # Install Plugins    
        staticFolder = readPropertyFromPropertiesFile("STATIC_FOLDER", module.name, lib.OptParser.options.envprops)  
        installDefaultPlugins(staticFolder, unzippedPackagePath, module)
コード例 #2
0
    def __init__(self, module, applicationServerPropertiesFilename):
        '''
        Constructor
        '''

        if module.launchType != "standalone":
            self.appServerName = module.launchType
            self.startCommand = readPropertyFromPropertiesFile("startCommand", self.appServerName, applicationServerPropertiesFilename)
            self.shutdownCommand = readPropertyFromPropertiesFile("shutdownCommand", self.appServerName, applicationServerPropertiesFilename)
            self.binPath = readPropertyFromPropertiesFile("binPath", self.appServerName, applicationServerPropertiesFilename)
            self.configurationLocation = readPropertyFromPropertiesFile("configurationLocation", self.appServerName, applicationServerPropertiesFilename)
            self.deployLocation = readPropertyFromPropertiesFile("deployLocation", self.appServerName, applicationServerPropertiesFilename)
            self.relativeCacheFolders = readPropertyFromPropertiesFile("relativeCacheFolders", self.appServerName, applicationServerPropertiesFilename)
            self.processIdentifier = readPropertyFromPropertiesFile("processIdentifier", self.appServerName, applicationServerPropertiesFilename)
        else:
            self.processIdentifier = module.subModule.processIdentifier
            self.appServerName = module.subModule.name

        # Custom JBOSS profile requested by my friend Chris Skopelitis :-)
        if self.appServerName == "jboss": 
            profile = module.targetDeploymentProfile
            self.deployLocation = self.deployLocation % (profile)
            self.configurationLocation = self.configurationLocation % (profile)  
            self.relativeCacheFolders = sprintfOnListValues(self.relativeCacheFolders.split(","), profile)

        log.info("ApplicationServer '" + self.appServerName + "' class initialized using '" + applicationServerPropertiesFilename + "' conf file")