@@ -342,7 +342,7 @@ def __init__(
342
342
343
343
# pylint: disable=arguments-differ
344
344
def run (
345
- self , pk , version_pk = None , build_pk = None , record = True , docker = None ,
345
+ self , pk , version_pk = None , build_pk = None , record = True ,
346
346
force = False , ** __
347
347
):
348
348
"""
@@ -365,18 +365,13 @@ def run(
365
365
:param version_pk int: Project Version id (latest if None)
366
366
:param build_pk int: Build id (if None, commands are not recorded)
367
367
:param record bool: record a build object in the database
368
- :param docker bool: use docker to build the project (if ``None``,
369
- ``settings.DOCKER_ENABLE`` is used)
370
368
:param force bool: force Sphinx build
371
369
372
370
:returns: whether build was successful or not
373
371
374
372
:rtype: bool
375
373
"""
376
374
try :
377
- if docker is None :
378
- docker = settings .DOCKER_ENABLE
379
-
380
375
self .project = self .get_project (pk )
381
376
self .version = self .get_version (self .project , version_pk )
382
377
self .build = self .get_build (build_pk )
@@ -418,7 +413,7 @@ def run(
418
413
# No exceptions in the setup step, catch unhandled errors in the
419
414
# build steps
420
415
try :
421
- self .run_build (docker = docker , record = record )
416
+ self .run_build (record = record )
422
417
except Exception as e : # noqa
423
418
log .exception (
424
419
'An unhandled exception was raised during project build' ,
@@ -451,7 +446,11 @@ def run_setup(self, record=True):
451
446
452
447
Return True if successful.
453
448
"""
454
- self .setup_env = LocalBuildEnvironment (
449
+ if settings .DOCKER_ENABLE :
450
+ env_cls = DockerBuildEnvironment
451
+ else :
452
+ env_cls = LocalBuildEnvironment
453
+ self .setup_env = env_cls (
455
454
project = self .project ,
456
455
version = self .version ,
457
456
build = self .build ,
@@ -517,19 +516,16 @@ def additional_vcs_operations(self):
517
516
if version_repo .supports_submodules :
518
517
version_repo .update_submodules (self .config )
519
518
520
- def run_build (self , docker , record ):
519
+ def run_build (self , record ):
521
520
"""
522
521
Build the docs in an environment.
523
522
524
- :param docker: if ``True``, the build uses a ``DockerBuildEnvironment``,
525
- otherwise it uses a ``LocalBuildEnvironment`` to run all the
526
- commands to build the docs
527
523
:param record: whether or not record all the commands in the ``Build``
528
524
instance
529
525
"""
530
526
env_vars = self .get_env_vars ()
531
527
532
- if docker :
528
+ if settings . DOCKER_ENABLE :
533
529
env_cls = DockerBuildEnvironment
534
530
else :
535
531
env_cls = LocalBuildEnvironment
0 commit comments