def deploy_valid_repos(): if len(sys.argv) != 5: return project_type = int(sys.argv[1]) deploy_id = int(sys.argv[2]) total_deployer = int(sys.argv[3]) database = Database.objects.get(name=sys.argv[4]) for repo in Repository.objects.filter(project_type=project_type): # for repo in Repository.objects.filter(project_type = project_type).exclude(Q(latest_attempt__result = 'DE') | Q(latest_attempt__result = 'OK')): # for repo in Repository.objects.filter(project_type = 1).filter(latest_attempt__result = 'OK').filter(latest_attempt__log__contains = "[Errno 13] Permission denied: '/var/log/mysql/mysql.log'"): if repo.id % total_deployer != deploy_id - 1: continue if Information.objects.filter( attempt=repo.latest_successful_attempt).filter( name='key_column_usage'): continue print 'Attempting to deploy {} using {} ...'.format( repo, repo.project_type.deployer_class) try: utils.vagrant_deploy(repo, deploy_id, database) except: traceback.print_exc() finally: time.sleep(5)
def main(): if len(sys.argv) != 4: return deploy_id = int(sys.argv[1]) repo_name = sys.argv[2] database = Database.objects.get(name = sys.argv[3]) repo = Repository.objects.get(name = repo_name) print 'Attempting to deploy {} using {} ...'.format(repo, repo.project_type.deployer_class) try: utils.vagrant_deploy(repo, deploy_id, database) except: pass
def main(): if len(sys.argv) != 4: return deploy_id = int(sys.argv[1]) repo_name = sys.argv[2] database = Database.objects.get(name=sys.argv[3]) repo = Repository.objects.get(name=repo_name) print 'Attempting to deploy {} using {} ...'.format( repo, repo.project_type.deployer_class) try: utils.vagrant_deploy(repo, deploy_id, database) except: traceback.print_exc()
def deploy_repo(repo_name, database = 'PostgreSQL'): repo = Repository.objects.get(name=repo_name) print 'Attempting to deploy {} using {} ...'.format(repo, repo.project_type.deployer_class) try: result = utils.vagrant_deploy(repo, 0, database) except Exception, e: LOG.exception(e) raise e
def deploy_valid_repos(): if len(sys.argv) != 5: return project_type = int(sys.argv[1]) deploy_id = int(sys.argv[2]) total_deployer = int(sys.argv[3]) database = Database.objects.get(name=sys.argv[4]) for repo in Repository.objects.filter(project_type = project_type): # for repo in Repository.objects.filter(project_type = project_type).exclude(Q(latest_attempt__result = 'DE') | Q(latest_attempt__result = 'OK')): # for repo in Repository.objects.filter(project_type = 1).filter(latest_attempt__result = 'OK').filter(latest_attempt__log__contains = "[Errno 13] Permission denied: '/var/log/mysql/mysql.log'"): if repo.id % total_deployer != deploy_id - 1: continue if Information.objects.filter(attempt = repo.latest_successful_attempt).filter(name = 'key_column_usage'): continue print 'Attempting to deploy {} using {} ...'.format(repo, repo.project_type.deployer_class) try: utils.vagrant_deploy(repo, deploy_id, database) except: traceback.print_exc() finally: time.sleep(5)
def deploy_with_timeout(repo, deploy_id, database): utils.vagrant_deploy(repo, deploy_id, database)