Beispiel #1
0
 def redeploy_all_projects(deploy_function, ignoretime=False):
     one_day_ago = datetime.utcnow() - timedelta(hours=24)
     for obj in App.cdn_s3_handler().get_objects(prefix='u/',
                                                 suffix='build_log.json'):
         last_modified = obj.last_modified.replace(tzinfo=None)
         if one_day_ago <= last_modified and not ignoretime:
             continue
         App.lambda_handler().invoke(function_name=deploy_function,
                                     payload={
                                         'prefix': App.prefix,
                                         'build_log_key': obj.key
                                     })
     return True
 def redeploy_all_projects(deploy_function):
     i = 0
     one_day_ago = datetime.utcnow() - timedelta(hours=24)
     for obj in App.cdn_s3_handler().get_objects(prefix='u/', suffix='build_log.json'):
         i += 1
         last_modified = obj.last_modified.replace(tzinfo=None)
         if one_day_ago <= last_modified:
             continue
         App.lambda_handler().invoke(
             FunctionName=deploy_function,
             InvocationType='Event',
             LogType='Tail',
             Payload=json.dumps({
                 'prefix': App.prefix,
                 'build_log_key': obj.key
             })
         )
     return True
Beispiel #3
0
 def redeploy_all_projects(deploy_function):
     i = 0
     one_day_ago = datetime.utcnow() - timedelta(hours=24)
     for obj in App.cdn_s3_handler().get_objects(prefix='u/',
                                                 suffix='build_log.json'):
         i += 1
         last_modified = obj.last_modified.replace(tzinfo=None)
         if one_day_ago <= last_modified:
             continue
         App.lambda_handler().invoke(FunctionName=deploy_function,
                                     InvocationType='Event',
                                     LogType='Tail',
                                     Payload=json.dumps({
                                         'prefix':
                                         App.prefix,
                                         'build_log_key':
                                         obj.key
                                     }))
     return True
Beispiel #4
0
 def send_payload_to_linter(self, payload, linter):
     """
     :param dict payload:
     :param TxModule linter:
     :return bool:
     """
     # TODO: Make this use urllib2 to make a async POST to the API. Currently invokes Lambda directly
     payload = {'data': payload, 'vars': {'prefix': App.prefix}}
     App.logger.debug('Sending Payload to linter {0}:'.format(linter.name))
     App.logger.debug(payload)
     linter_function = '{0}tx_lint_{1}'.format(App.prefix, linter.name)
     response = App.lambda_handler().invoke(function_name=linter_function,
                                            payload=payload,
                                            async=True)
     App.logger.debug('finished.')
     return response
 def send_payload_to_linter(self, payload, linter):
     """
     :param dict payload:
     :param TxModule linter:
     :return bool:
     """
     # TODO: Make this use urllib2 to make a async POST to the API. Currently invokes Lambda directly
     payload = {
         'data': payload,
         'vars': {
             'prefix': App.prefix
         }
     }
     App.logger.debug('Sending Payload to linter {0}:'.format(linter.name))
     App.logger.debug(payload)
     linter_function = '{0}tx_lint_{1}'.format(App.prefix, linter.name)
     response = App.lambda_handler().invoke(function_name=linter_function, payload=payload, async=True)
     App.logger.debug('finished.')
     return response