Commit b18de578 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

management commands docker-{build,pull,push}

parent 49f3f750
import logging
from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
logger = logging.getLogger('rainboard.docker')
class Command(BaseCommand):
help = 'Create all docker images'
def handle(self, *args, **options):
logger.info('Creating all docker images…')
for robotpkg in Robotpkg.objects.all():
logger.info(f' {robotpkg}')
robotpkg.update_images()
logger.info('Building all docker images…')
for image in Image.objects.all():
ret = call(image.build())
logger.info(f' {image}: {ret}')
import logging
from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
logger = logging.getLogger('rainboard.docker')
class Command(BaseCommand):
help = 'Pull all docker images'
def handle(self, *args, **options):
logger.info('Pulling all docker images…')
for image in Image.objects.all():
ret = call(image.pull())
import logging
from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
logger = logging.getLogger('rainboard.docker')
class Command(BaseCommand):
help = 'Push all docker images'
def handle(self, *args, **options):
logger.info('Pushing all docker images…')
for image in Image.objects.all():
ret = call(image.push())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment