fetch.py 421 Bytes
Newer Older
Guilhem Saurel's avatar
git    
Guilhem Saurel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import logging

from django.core.management.base import BaseCommand

from rainboard.models import Repo

logger = logging.getLogger('rainboard.management.fetch')

class Command(BaseCommand):
    help = 'Fetch all remotes'

    def handle(self, *args, **options):
        logger.info(f'Fetching all repos')
        for repo in Repo.objects.all():
            logger.info(f' fetching {repo}')
            repo.git().fetch()