UNPKG

@atomist/sdm

Version:

Atomist Software Delivery Machine SDK

43 lines 2.15 kB
import { GoalInvocation } from "../../api/goal/GoalInvocation"; import { CacheConfiguration } from "../../api/machine/SoftwareDeliveryMachineOptions"; import { GoalCacheArchiveStore } from "../../core/goal/cache/CompressingGoalCache"; export interface GoogleCloudStorageCacheConfiguration extends CacheConfiguration { cache?: { /** * Google Cloud Storage bucket to perist cache entries to. If * not provided, it defaults to * "sdm-WORKSPACE_ID-SDM_NAME-goal-cache", with "WORKSPACE_ID" * replaced with your Atomist workspace ID and "SDM_NAME" * replaced with the name of the running SDM, converting * letters to lower case and removing all characters that are * not letters, numbers, and dashes (-). It makes no attempt * to create this bucket, so make sure it exists before trying * to use it. */ bucket?: string; /** Set to true to enable goal input/output caching */ enabled?: boolean; /** Path prefix, defaults to "goal-cache". */ path?: string; }; } export declare type CacheConfig = Required<Required<GoogleCloudStorageCacheConfiguration>["cache"]>; /** * Goal archive store that stores the compressed archives in a Google * Cloud Storage bucket. All failures are caught and logged. If * retrieval fails, the error is rethrown so the cache-miss listeners * will be invoked. */ export declare class GoogleCloudStorageGoalCacheArchiveStore implements GoalCacheArchiveStore { store(gi: GoalInvocation, classifier: string, archivePath: string): Promise<string>; delete(gi: GoalInvocation, classifier: string): Promise<void>; retrieve(gi: GoalInvocation, classifier: string, targetArchivePath: string): Promise<void>; private gcs; } /** Construct object path for cache configuration and classifier. */ export declare function getCachePath(cacheConfig: CacheConfig, classifier?: string): string; /** * Retrieve cache configuration and populate with default values. */ export declare function getCacheConfig(gi: GoalInvocation): CacheConfig; //# sourceMappingURL=cache.d.ts.map