def trigger_build(project, version=None, record=True, force=False, basic=False):
 from readthedocs.projects.tasks import update_docs
 from readthedocs.builds.models import Build
 if project.skip:
  return None
 if (not version):
  version = project.versions.get(slug=LATEST)
 kwargs = dict(pk=project.pk, version_pk=version.pk, record=record, force=force, basic=basic)
 build = None
 if record:
  build = Build.objects.create(project=project, version=version, type='html', state='triggered', success=True)
  kwargs['build_pk'] = build.pk
 options = {}
 if project.build_queue:
  options['queue'] = project.build_queue
 time_limit = DOCKER_LIMITS['time']
 try:
  if project.container_time_limit:
   time_limit = int(project.container_time_limit)
 except ValueError:
  pass
 options['soft_time_limit'] = time_limit
 options['time_limit'] = int((time_limit * 1.2))
 update_docs.apply_async(kwargs=kwargs, **options)
 return build

def trigger_build ( project , version = None , record = True , force = False , basic = False ) : from readthedocs . projects . tasks import update_docs from readthedocs . builds . models import Build if project . skip : return None if ( not version ) : version = project . versions . get ( slug = LATEST ) kwargs = dict ( pk = project . pk , version_pk = version . pk , record = record , force = force , basic = basic ) build = None if record : build = Build . objects . create ( project = project , version = version , type = 'html' , state = 'triggered' , success = True ) kwargs [ 'build_pk' ] = build . pk options = { } if project . build_queue : options [ 'queue' ] = project . build_queue time_limit = DOCKER_LIMITS [ 'time' ] try : if project . container_time_limit : time_limit = int ( project . container_time_limit ) except ValueError : pass options [ 'soft_time_limit' ] = time_limit options [ 'time_limit' ] = int ( ( time_limit * 1.2 ) ) update_docs . apply_async ( kwargs = kwargs , ** options ) return build
trigger build for project and version if project has a build_queue .