in ftl/php/layer_builder.py [0:0]
def BuildLayer(self):
"""Override."""
is_gcp_build = False
if self._ctx and self._ctx.Contains(constants.COMPOSER_JSON):
is_gcp_build = ftl_util.is_gcp_build(
json.loads(self._ctx.GetFile(constants.COMPOSER_JSON)))
if is_gcp_build:
ftl_util.gcp_build(self._directory, 'composer', 'run-script',
install_flags=["--no-dev"],
run_flags=["--timeout=600", "--no-dev"])
self._cleanup_build_layer()
cached_img = None
key = self.GetCacheKey()
if self._cache:
with ftl_util.Timing('checking_cached_composer_json_layer'):
cached_img = self._cache.Get(key)
self._log_cache_result(False if cached_img is None else True,
key)
if cached_img:
self.SetImage(cached_img)
else:
with ftl_util.Timing('building_composer_json_layer'):
self._build_layer()
self._cleanup_build_layer()
if self._cache:
with ftl_util.Timing('uploading_composer_json_layer'):
self._cache.Set(key, self.GetImage())