Example #1
0
from containerregistry.tools import patched

from ftl.common import args
from ftl.common import logger
from ftl.common import context
from ftl.common import ftl_util
from ftl.common import ftl_error

from ftl.php import builder as php_builder

parser = args.base_parser()
php_parser = argparse.ArgumentParser(
    add_help=False,
    parents=[parser],
    description='Construct php images from source.')
args.extra_args(php_parser, args.php_flgs)


def main(cli_args):
    try:
        builder_args = php_parser.parse_args(cli_args)
        logger.setup_logging(builder_args)
        logger.preamble("php", builder_args)
        with ftl_util.Timing("full build"):
            with ftl_util.Timing("builder initialization"):
                php_ftl = php_builder.PHP(
                    context.Workspace(builder_args.directory), builder_args)
            with ftl_util.Timing("build process for FTL image"):
                php_ftl.Build()
    except ftl_error.UserError as e:
        ftl_error.UserErrorHandler(e, builder_args.builder_output_path,
Example #2
0
from ftl.common import args
from ftl.common import logger
from ftl.common import context
from ftl.common import ftl_util
from ftl.common import ftl_error

from ftl.node import builder as node_builder

version = args.version_parser()
parser = args.base_parser()
node_parser = argparse.ArgumentParser(
    add_help=False,
    parents=[parser],
    description='Construct node images from source.')
args.extra_args(node_parser, args.node_flgs)


def main(cli_args):
    try:
        version.parse_known_args(cli_args)
        builder_args = node_parser.parse_args(cli_args)
        logger.setup_logging(builder_args)
        logger.preamble("node", builder_args)
        with ftl_util.Timing("full build"):
            with ftl_util.Timing("builder initialization"):
                node_ftl = node_builder.Node(
                    context.Workspace(builder_args.directory), builder_args)
            with ftl_util.Timing("build process for FTL image"):
                node_ftl.Build()
    except ftl_error.UserError as e:
from containerregistry.tools import patched

from ftl.common import args
from ftl.common import logger
from ftl.common import context
from ftl.common import ftl_util

from ftl.python import builder as python_builder

parser = args.base_parser()
python_parser = argparse.ArgumentParser(
    add_help=False,
    parents=[parser],
    description='Construct python images from source.')
args.extra_args(python_parser, args.python_flgs)

# Version string used to bust caches.
_PYTHON_CACHE_VERSION = 'v1'


def main(cli_args):
    builder_args = python_parser.parse_args(cli_args)
    logger.setup_logging(builder_args)
    with ftl_util.Timing("full build"):
        with ftl_util.Timing("builder initialization"):
            python_ftl = python_builder.Python(
                context.Workspace(builder_args.directory),
                builder_args,
                _PYTHON_CACHE_VERSION,
            )