def _update_code(self, config, nodes): for serviceNode in nodes: # Push the current code version via GIT if necessary if config.codeVersions[config.currentCodeVersion].type == 'git': _, err = git.git_push(git.DEFAULT_CODE_REPO, serviceNode.ip) if err: self.logger.debug('git-push to %s: %s' % (serviceNode.ip, err)) try: if serviceNode.isRunningBackend: ## UPLOAD TOMCAT CODE TO TOMCAT client.updateTomcatCode( serviceNode.ip, 5555, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, os.path.join(self.code_repo, config.currentCodeVersion)) if serviceNode.isRunningProxy or serviceNode.isRunningWeb: client.updatePHPCode( serviceNode.ip, 5555, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, os.path.join(self.code_repo, config.currentCodeVersion)) except client.AgentException: self.logger.exception('Failed to update code at node %s' % str(serviceNode)) self._state_set(self.S_ERROR, msg='Failed to update code at node %s' % str(serviceNode)) return
def _update_code(self, config, nodes): for serviceNode in nodes: # Push the current code version via GIT if necessary if config.codeVersions[config.currentCodeVersion].type == 'git': filepath = config.codeVersions[config.currentCodeVersion].filename _, err = git.git_push(git.DEFAULT_CODE_REPO, serviceNode.ip) if err: self.logger.debug('git-push to %s: %s' % (serviceNode.ip, err)) else: filepath = os.path.join(self.code_repo, config.currentCodeVersion) try: # UPLOAD TOMCAT CODE TO TOMCAT if serviceNode.isRunningBackend: client.updateTomcatCode( serviceNode.ip, 5555, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, filepath) if serviceNode.isRunningProxy or serviceNode.isRunningWeb: client.updatePHPCode( serviceNode.ip, 5555, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, filepath) except client.AgentException: self.logger.exception('Failed to update code at node %s' % str(serviceNode)) self.state_set(self.S_ERROR, msg='Failed to update code at node %s' % str(serviceNode)) return
def _update_code(self, config, nodes): for serviceNode in nodes: # Push the current code version via GIT if necessary if config.codeVersions[config.currentCodeVersion].type == 'git': _, err = git.git_push(git.DEFAULT_CODE_REPO, serviceNode.ip) if err: self.logger.debug('git-push to %s: %s' % (serviceNode.ip, err)) try: client.updatePHPCode(serviceNode.ip, 5555, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, os.path.join(self.code_repo, config.currentCodeVersion)) except client.AgentException: self.logger.exception('Failed to update code at node %s' % str(serviceNode)) self._state_set(self.S_ERROR, msg='Failed to update code at node %s' % str(serviceNode)) raise
def _update_code(self, config, nodes): self.logger.info("Updating code to version '%s' at agents %s" % (config.currentCodeVersion, [ node.id for node in nodes ])) for node in nodes: # Push the current code version via GIT if necessary if config.codeVersions[config.currentCodeVersion].type == 'git': filepath = config.codeVersions[config.currentCodeVersion].filename _, err = git.git_push(git.DEFAULT_CODE_REPO, node.ip) if err: self.logger.debug('git-push to %s: %s' % (node.ip, err)) else: filepath = os.path.join(self.code_repo, config.currentCodeVersion) try: client.update_code(node.ip, self.AGENT_PORT, config.currentCodeVersion, config.codeVersions[config.currentCodeVersion].type, filepath) except client.AgentException: self.logger.exception('Failed to update code at node %s' % str(node)) self._state_set(self.S_ERROR, msg='Failed to update code at node %s' % str(node)) raise