def main(cli_args):
    builder_args = php_parser.parse_args(cli_args)
    logger.setup_logging(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,
                _PHP_CACHE_VERSION)
        with ftl_util.Timing("build process for FTL image"):
            php_ftl.Build()
Ejemplo n.º 2
0
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)
    except ftl_error.InternalError as e:
        ftl_error.InternalErrorHandler(e, builder_args.builder_output_path)
Ejemplo n.º 3
0
    def setUp(self, mock_from):
        mock_from.return_value.__enter__.return_value = None
        self._tmpdir = tempfile.mkdtemp()
        self.ctx = context.Memory()
        self.ctx.AddFile("app.php", _APP)
        args = mock.Mock()
        args.name = 'gcr.io/test/test:latest'
        args.base = 'gcr.io/google-appengine/php:latest'
        args.tar_base_image_path = None
        self.builder = builder.PHP(self.ctx, args)
        self.layer_builder = layer_builder.PhaseOneLayerBuilder(
            self.builder._ctx, self.builder._descriptor_files, "/app")

        # Mock out the calls to package managers for speed.
        self.layer_builder._gen_composer_install_tar = mock.Mock()
        self.layer_builder._gen_composer_install_tar.return_value = ('layer',
                                                                     'sha')