Пример #1
0
 def handle(self, *args, **options):
     for version in Version.internal.filter(active=True, built=False):
         # pylint: disable=no-value-for-parameter
         update_docs_task(
             version.pk,
             record=False,
         )
Пример #2
0
 def handle(self, *args, **options):
     docker = options.get('docker', False)
     for slug in options['projects']:
         project_data = api.project(slug).get()
         p = APIProject(**project_data)
         log.info("Building %s", p)
         # pylint: disable=no-value-for-parameter
         tasks.update_docs_task(p.pk, docker=docker)
Пример #3
0
 def handle(self, *args, **options):
     for version in Version.objects.filter(active=True, built=False):
         # pylint: disable=no-value-for-parameter
         update_docs_task(
             version.project_id,
             record=False,
             version_pk=version.pk,
         )
Пример #4
0
    def handle(self, *args, **options):
        force = options['force']
        version = options['version']

        if options.get('slugs', []):
            for slug in options['slugs']:
                if version and version != 'all':
                    log.info('Updating version %s for %s', version, slug)
                    for version in Version.objects.filter(
                            project__slug=slug,
                            slug=version,
                    ):
                        trigger_build(project=version.project, version=version)
                elif version == 'all':
                    log.info('Updating all versions for %s', slug)
                    for version in Version.objects.filter(
                            project__slug=slug,
                            active=True,
                            uploaded=False,
                    ):

                        build = Build.objects.create(
                            project=version.project,
                            version=version,
                            type='html',
                            state='triggered',
                        )

                        # pylint: disable=no-value-for-parameter
                        tasks.update_docs_task(
                            version.project_id,
                            build_pk=build.pk,
                            version_pk=version.pk,
                        )
                else:
                    p = Project.all_objects.get(slug=slug)
                    log.info('Building %s', p)
                    trigger_build(project=p, force=force)
        else:
            if version == 'all':
                log.info('Updating all versions')
                for version in Version.objects.filter(
                        active=True,
                        uploaded=False,
                ):
                    # pylint: disable=no-value-for-parameter
                    tasks.update_docs_task(
                        version.project_id,
                        force=force,
                        version_pk=version.pk,
                    )
            else:
                log.info('Updating all docs')
                for project in Project.objects.all():
                    # pylint: disable=no-value-for-parameter
                    tasks.update_docs_task(
                        project.pk,
                        force=force,
                    )
Пример #5
0
    def handle(self, *args, **options):
        force = options['force']
        version = options['version']

        if options.get('slugs', []):
            for slug in options['slugs']:
                if version and version != 'all':
                    log.info('Updating version %s for %s', version, slug)
                    for version in Version.objects.filter(
                            project__slug=slug,
                            slug=version,
                    ):
                        trigger_build(project=version.project, version=version)
                elif version == 'all':
                    log.info('Updating all versions for %s', slug)
                    for version in Version.objects.filter(
                            project__slug=slug,
                            active=True,
                            uploaded=False,
                    ):

                        build = Build.objects.create(
                            project=version.project,
                            version=version,
                            type='html',
                            state='triggered',
                        )

                        # pylint: disable=no-value-for-parameter
                        tasks.update_docs_task(
                            version.project_id,
                            build_pk=build.pk,
                            version_pk=version.pk,
                        )
                else:
                    p = Project.all_objects.get(slug=slug)
                    log.info('Building %s', p)
                    trigger_build(project=p, force=force)
        else:
            if version == 'all':
                log.info('Updating all versions')
                for version in Version.objects.filter(
                        active=True,
                        uploaded=False,
                ):
                    # pylint: disable=no-value-for-parameter
                    tasks.update_docs_task(
                        version.project_id,
                        force=force,
                        version_pk=version.pk,
                    )
            else:
                log.info('Updating all docs')
                for project in Project.objects.all():
                    # pylint: disable=no-value-for-parameter
                    tasks.update_docs_task(
                        project.pk,
                        force=force,
                    )