| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# pylint: disable=wildcard-import, unused-wildcard-import, bad-continuation |
| 3 |
""" Project automation using Invoke. |
| 4 |
""" |
| 5 |
from __future__ import absolute_import, unicode_literals |
| 6 |
|
| 7 |
import os |
| 8 |
|
| 9 |
from rituals import config |
| 10 |
from rituals.easy import * # pylint: disable=redefined-builtin |
| 11 |
|
| 12 |
config.set_flat_layout() |
| 13 |
os.environ['INVOKE_RITUALS_DOCS_SOURCES'] = os.path.join(os.path.dirname(__file__), 'doc') |
| 14 |
|
| 15 |
|
| 16 |
@task(help={'distro': "base image name to use for building"}) |
| 17 |
def bdist_deb(ctx, distro=None): |
| 18 |
"""Build package for Debian stable using Docker""" |
| 19 |
ctx.run("docker build --tag dh-venv-builder --build-arg distro={} ." |
| 20 |
.format(distro or 'debian:stable')) |
| 21 |
os.path.exists('dist') or os.makedirs('dist') |
| 22 |
ctx.run("docker run --rm dh-venv-builder tar -C /dpkg -c . | tar -C dist -xv") |
| 23 |
ctx.run("ls -lth dist/") |
| 24 |
|
| 25 |
namespace.add_task(bdist_deb) |