def client(): session = aiohttp.ClientSession(raise_for_status=True, timeout=aiohttp.ClientTimeout(total=60)) client = BatchClient(session, url=os.environ.get('BATCH_URL')) yield client client.close()
PR_BUILD_SCRIPT = f.read() except FileNotFoundError as e: raise ValueError( "working directory must contain a file called `pr-build-script' " "containing a string that is passed to `/bin/sh -c'") from e try: with open('pr-deploy-script', 'r') as f: PR_DEPLOY_SCRIPT = f.read() except FileNotFoundError as e: raise ValueError( "working directory must contain a file called `pr-deploy-script' " "containing a string that is passed to `/bin/sh -c'") from e try: with open('oauth-token/oauth-token', 'r') as f: oauth_token = f.read().strip() except FileNotFoundError as e: raise ValueError( "working directory must contain `oauth-token/oauth-token' " "containing a valid GitHub oauth token") from e log.info(f'BATCH_SERVER_URL {BATCH_SERVER_URL}') log.info(f'SELF_HOSTNAME {SELF_HOSTNAME}') log.info(f'REFRESH_INTERVAL_IN_SECONDS {REFRESH_INTERVAL_IN_SECONDS}') log.info( f'WATCHED_TARGETS {[(ref.short_str(), deployable) for (ref, deployable) in WATCHED_TARGETS]}' ) log.info(f'INSTANCE_ID = {INSTANCE_ID}') log.info(f'CONTEXT = {CONTEXT}') batch_client = BatchClient(url=BATCH_SERVER_URL, api=API(timeout=5))
def client(): return BatchClient(url=os.environ.get('BATCH_URL'))
PR_BUILD_SCRIPT = f.read() except FileNotFoundError as e: raise ValueError( "working directory must contain a file called `pr-build-script' " "containing a string that is passed to `/bin/sh -c'") from e try: with open('pr-deploy-script', 'r') as f: PR_DEPLOY_SCRIPT = f.read() except FileNotFoundError as e: raise ValueError( "working directory must contain a file called `pr-deploy-script' " "containing a string that is passed to `/bin/sh -c'") from e try: with open('oauth-token/oauth-token', 'r') as f: oauth_token = f.read().strip() except FileNotFoundError as e: raise ValueError( "working directory must contain `oauth-token/oauth-token' " "containing a valid GitHub oauth token") from e log.info(f'BATCH_SERVER_URL {BATCH_SERVER_URL}') log.info(f'SELF_HOSTNAME {SELF_HOSTNAME}') log.info(f'REFRESH_INTERVAL_IN_SECONDS {REFRESH_INTERVAL_IN_SECONDS}') log.info( f'WATCHED_TARGETS {[(ref.short_str(), deployable) for (ref, deployable) in WATCHED_TARGETS]}' ) log.info(f'INSTANCE_ID = {INSTANCE_ID}') log.info(f'CONTEXT = {CONTEXT}') batch_client = BatchClient(url=BATCH_SERVER_URL)