def murex_deployLicence(licenceFile=None, backup=True, bounceServices=None): """ Used for deploying the licence of Murex .. note:: * It backups to $MX/../archive - usually * The backup is named licence_backup_2010_11_12_12_30_59.zip [Year_Month_Date_Hour_Min_Sec] * The licence jar file is rsync'ed from the localhost to the remote server * The licence is exploded and the orginal file removed * You are given the option of bouncing the services :type licenceFile: String :param licenceFile: The path of the licence file on the localhost machine. If this is not supplied the user will be asked :type bounceServices: Boolean :param bounceServices: If left blank, the user is questioned if services need to be bounced. For bulk operations, set to True or False for bouncing services automatically. Specify the full path of the licence directory of the remote server in the variable folderToBackup >>> fab -H test.uk murex_deployLicence In this situation you will be asked for the location of the file >>> fab -H test.uk murex_deployLicence:licenceFile=/tmp/licence.jar >>> fab server_dev murex_deployLicence:licenceFile=/tmp/licence.jar,bounceServices=True """ if (licenceFile == None): licenceFile = _getLocationOfFile_( "What is the location of the licence file on the localhost?") #The folder that needs to be backed up folderToBackup = _getMX_() + '/fs/licence' licenceFileName = os.path.basename(licenceFile) #Backup if required if (backup): _backup_(folderToBackup=folderToBackup, prefix='licence', removeDirectory=False, archiveFolder=_getMX_() + '/../archive') #Copy licence from localhost to remote server rsync(licenceFile, folderToBackup) jarCommand = _jarCommand_() + 'xf ' + licenceFileName #Explode the new licence murex_runCommand('echo "Exploding licence";\ cd ' + folderToBackup + ';\ echo "I am in `pwd`" ;\ ' + jarCommand + ';\ echo "Removing jar";rm ' + licenceFileName) _murex_confirmBounceServices_(bounceServices)
def murex_deployLicence(licenceFile=None, backup=True, bounceServices=None): """ Used for deploying the licence of Murex .. note:: * It backups to $MX/../archive - usually * The backup is named licence_backup_2010_11_12_12_30_59.zip [Year_Month_Date_Hour_Min_Sec] * The licence jar file is rsync'ed from the localhost to the remote server * The licence is exploded and the orginal file removed * You are given the option of bouncing the services :type licenceFile: String :param licenceFile: The path of the licence file on the localhost machine. If this is not supplied the user will be asked :type bounceServices: Boolean :param bounceServices: If left blank, the user is questioned if services need to be bounced. For bulk operations, set to True or False for bouncing services automatically. Specify the full path of the licence directory of the remote server in the variable folderToBackup >>> fab -H test.uk murex_deployLicence In this situation you will be asked for the location of the file >>> fab -H test.uk murex_deployLicence:licenceFile=/tmp/licence.jar >>> fab server_dev murex_deployLicence:licenceFile=/tmp/licence.jar,bounceServices=True """ if (licenceFile == None): licenceFile = _getLocationOfFile_("What is the location of the licence file on the localhost?") #The folder that needs to be backed up folderToBackup = _getMX_() + '/fs/licence' licenceFileName = os.path.basename(licenceFile) #Backup if required if (backup): _backup_(folderToBackup = folderToBackup, prefix='licence', removeDirectory=False, archiveFolder=_getMX_() + '/../archive') #Copy licence from localhost to remote server rsync(licenceFile, folderToBackup) jarCommand = _jarCommand_() + 'xf ' + licenceFileName #Explode the new licence murex_runCommand('echo "Exploding licence";\ cd ' + folderToBackup + ';\ echo "I am in `pwd`" ;\ ' + jarCommand + ';\ echo "Removing jar";rm ' + licenceFileName) _murex_confirmBounceServices_(bounceServices)
def murex_deployAppTree(appTree=None, backup=True, bounceServices=None): """ Used for deploying a packaged Murex AppTree .. note:: * It backups to $MX/../archive * The location path is created if it does not exist * Services are stopped * The backup is named appTree_backup_2010_11_12_12_30_59.zip [Year_Month_Date_Hour_Min_Sec] * Everything in the $MX folder is deleted * The appTree zip file is rsync'ed from the localhost to the remote server * The apptree is exploded and the packaged file removed * You are given the option of starting the services :type appTree: String :param appTree: Location of apptree on the localhost :type bounceServices: Boolean :param bounceServices: If left blank, the user is questioned if services need to be bounced. For bulk operations, set to True or False for bouncing services automatically. >>> fab -H test.uk murex_deployAppTree >>> fab -H test.uk murex_deployAppTree:appTree=/tmp/murex.tar.gz >>> fab server_dev murex_deployAppTree:appTree=/tmp/murex.tar.gz,bounceServices=True """ if (appTree == None): appTree = _getLocationOfFile_("What is the location of the app tree file [murex.tar.gz] on the localhost?") #The folder that needs to be backed up murexAppTreePath = _getMX_() #Get the filename appTreeFileName = os.path.basename(appTree) #Create the apptree folder in case it does not exist run('mkdir -p ' + murexAppTreePath) try: #Stop the services, if there is an error ignore it murex_stopServices(ignoreError = True) except: ignoreError = False #Do Nothing #Backup if required if (backup): _backup_(folderToBackup = murexAppTreePath, prefix='appTree', removeDirectory=True, archiveFolder=murexAppTreePath + '/../archive') #Copy apptree from localhost to remote server rsync(appTree, murexAppTreePath) tarCommand = _tarCommand_() + 'zxf ' + appTreeFileName #Explode the new apptree murex_runCommand("echo 'Exploding apptree';" + tarCommand + ";rm " + appTreeFileName) #TODO: Add init of files #If required start the services _murex_confirmBounceServices_(bounceServices)
def murex_deployAppTree(appTree=None, backup=True, bounceServices=None): """ Used for deploying a packaged Murex AppTree .. note:: * It backups to $MX/../archive * The location path is created if it does not exist * Services are stopped * The backup is named appTree_backup_2010_11_12_12_30_59.zip [Year_Month_Date_Hour_Min_Sec] * Everything in the $MX folder is deleted * The appTree zip file is rsync'ed from the localhost to the remote server * The apptree is exploded and the packaged file removed * You are given the option of starting the services :type appTree: String :param appTree: Location of apptree on the localhost :type bounceServices: Boolean :param bounceServices: If left blank, the user is questioned if services need to be bounced. For bulk operations, set to True or False for bouncing services automatically. >>> fab -H test.uk murex_deployAppTree >>> fab -H test.uk murex_deployAppTree:appTree=/tmp/murex.tar.gz >>> fab server_dev murex_deployAppTree:appTree=/tmp/murex.tar.gz,bounceServices=True """ if (appTree == None): appTree = _getLocationOfFile_( "What is the location of the app tree file [murex.tar.gz] on the localhost?" ) #The folder that needs to be backed up murexAppTreePath = _getMX_() #Get the filename appTreeFileName = os.path.basename(appTree) #Create the apptree folder in case it does not exist run('mkdir -p ' + murexAppTreePath) try: #Stop the services, if there is an error ignore it murex_stopServices(ignoreError=True) except: ignoreError = False #Do Nothing #Backup if required if (backup): _backup_(folderToBackup=murexAppTreePath, prefix='appTree', removeDirectory=True, archiveFolder=murexAppTreePath + '/../archive') #Copy apptree from localhost to remote server rsync(appTree, murexAppTreePath) tarCommand = _tarCommand_() + 'zxf ' + appTreeFileName #Explode the new apptree murex_runCommand("echo 'Exploding apptree';" + tarCommand + ";rm " + appTreeFileName) #TODO: Add init of files #If required start the services _murex_confirmBounceServices_(bounceServices)