File: tasks.py

package info (click to toggle)
dh-virtualenv 1.2.2-1
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 364 kB
  • sloc: python: 1,190; perl: 157; makefile: 146; sh: 22
file content (25 lines) | stat: -rw-r--r-- 884 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# -*- coding: utf-8 -*-
# pylint: disable=wildcard-import, unused-wildcard-import, bad-continuation
""" Project automation using Invoke.
"""
from __future__ import absolute_import, unicode_literals

import os

from rituals import config
from rituals.easy import *  # pylint: disable=redefined-builtin

config.set_flat_layout()
os.environ['INVOKE_RITUALS_DOCS_SOURCES'] = os.path.join(os.path.dirname(__file__), 'doc')


@task(help={'distro': "base image name to use for building"})
def bdist_deb(ctx, distro=None):
    """Build package for Debian stable using Docker"""
    ctx.run("docker build --tag dh-venv-builder --build-arg distro={} ."
            .format(distro or 'debian:stable'))
    os.path.exists('dist') or os.makedirs('dist')
    ctx.run("docker run --rm dh-venv-builder tar -C /dpkg -c . | tar -C dist -xv")
    ctx.run("ls -lth dist/")

namespace.add_task(bdist_deb)