Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ArturSkowronski/2a06e56bf83b1723a9406ef68e7ff42e to your computer and use it in GitHub Desktop.
Save ArturSkowronski/2a06e56bf83b1723a9406ef68e7ff42e to your computer and use it in GitHub Desktop.
class BuildAndCacheApplicationLayerStep
implements AsyncStep<CachedLayerWithMetadata>, Callable<CachedLayerWithMetadata> {
/*(...)*/
@Override
public CachedLayerWithMetadata call() throws IOException, CacheMetadataCorruptedException {
/*(...)*/
CachedLayerWithMetadata cachedLayer =
new CacheReader(cache)
.getUpToDateLayerByLayerEntries(layerConfiguration.getLayerEntries());
if (cachedLayer != null) {
return cachedLayer;
}
ReproducibleLayerBuilder reproducibleLayerBuilder = new ReproducibleLayerBuilder();
for (LayerEntry layerEntry : layerConfiguration.getLayerEntries()) {
reproducibleLayerBuilder.addFiles(
layerEntry.getSourceFiles(), layerEntry.getExtractionPath());
}
cachedLayer = new CacheWriter(cache).writeLayer(reproducibleLayerBuilder);
/*(...)*/
return cachedLayer;
}
}
/*(...)*/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment